blogscot / snake-game

A simple implementation of the Snake Game using Clojure and Java Swing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

clojure-snake

Playing

clojure-snake is a simple implementation of the snake game written in Clojure and Swing. The original implemention was developed by Milos Stojanovic approximately 7 years ago at the time of writing.

My original intention was to merely improve my understanding of Clojure by analysing a real application. However, this intention gradually expanded such that my version is: simplified (by removing the AI handling, removing and updating dependencies, plus merging files), expanded (the board is larger and the snake smaller), and extended (by adding extra features such as scoring and progressively increasing the game speed) to enhance game play.

Compilation and Usage

In you are feeling in the mood and assuming that Java and Leiningen are installed on your machine, run the

lein uberjar

command to create a standalone jar file. The resulting exectuable is created in a target/uberjar directory, which can be invoked using the command:

java -jar clojure-snake-0.1.0-standalone.jar -s <speed>

The optional parameter specifies the snake's initial speed and it must be an integer in the range 0 (slow) and 40 (fast).

Alternatively, the latest release can be downloaded directly and ran using the aforementioned command.

Enjoy!

About

A simple implementation of the Snake Game using Clojure and Java Swing

License:Eclipse Public License 1.0


Languages

Language:Clojure 100.0%