Creating an Interface

With a solid foundation, introducing an interface and a playable version of the game should be a breeze. Let’s start with a basic web application. The noir web framework will serve as a nice base for us to build our application. Creating a new noir project is easy.

First, you will need to install the lein-noir plug-in to leiningen:

 ​$ lein plugin install lein-noir 1.2.0​

Now we can generate our application and launch it:

 ​$ lein noir new clojurebreaker​
 ​$ cd clojurebreaker​
 ​$ lein run​

Point your browser to http://localhost:8080. You will get the default noir landing page, which isn’t interesting to you at the moment, but it will ensure that you have things set up correctly.

It’s Finally Time for Some State

This ...

Get Programming Clojure, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.