Skip to content

RESTful, purely functional implementation of the Minesweeper game in Clojure.

License

Notifications You must be signed in to change notification settings

danwerner/restsweeper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RESTsweeper

RESTsweeper is a purely functional, RESTful implementation of the Minesweeper game. It is written in Clojure on top of the excellent Moustache web micro-framework and the equally excellent Enlive template transformation engine.

Installation

You have to have the Sun JDK or Open JDK plus Maven pre-installed. If you do not have a copy of Leiningen yet, download the lein shell script and drop it somewhere into your PATH.

Leiningen will deal with all other dependencies automatically. Just run:

$ lein self-install
$ cd /path/to/restsweeper
$ lein deps

Usage

The easiest way to start RESTsweeper is to run it as a Java class:

$ lein compile
$ java -cp "classes:lib/*" restsweeper.Main

If you want to experiment with the source, change things and then immediately see the effect:

$ lein repl
user=> (run)
; Then, every time after you've changed the source:
user=> (require '[restsweeper.run :reload-all true])

Now point your browser to http://localhost:8080/ and enjoy.

Leiningen has much improved the Java classpath and dependency handling already. However, if after an extended amout of fiddling you still can't seem to get this software to work, just send me a message and I'll try to help you.

Hacking

Sure, please do! I wrote this software for the learning experience, so if you learn something by reading, using or even improving this code, it has served its purpose.

Some enhancements that could provide a challenge:

  • Use Gaka or csslj to construct CSS styles. Or simply move them out to a static file.
  • The reversible hashing algorithm used to compress the game board into URLs is ugly and breaks for larger board sizes. There's probably an easier way to do this.
  • Almost all unit tests are outdated because I stopped updating them halfway through development. Please fix and extend them at your leisure :-)

License

Copyright (C) 2010-2011 Daniel D. Werner

Distributed under the 2-clause BSD License. See the file COPYING.

About

RESTful, purely functional implementation of the Minesweeper game in Clojure.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published