A re-frame Snake game for the browser. Interact with your keyboard or with its api.
The purpose of this game is to be used as a test bed for running Reinforcement Learning algorithms.
lein clean
lein figwheel dev
Figwheel will automatically push cljs changes to the browser.
Wait a bit, then browse to http://localhost:3449.
You have to also compile the stylesheets:
lein sass4clj auto
This will compile the sass and watch for changes
lein run
The Backend will be accessible on http://localhost:8080.
To compile clojurescript to javascript:
lein clean
lein cljsbuild once min
To run the frontend and the backend tests:
lein test-all
Please note the section Frontend tests for more details about running the frontend tests.
For testing reframe apps read this.
lein doo once
This will run all tests that are passed within test/snake/test_runner.cljs
.
The tests will be executed with phantom.js. By default the phantom.js binary found in
./dev-resources
will be used to execute the tests. The shipped version of phantom.js
only works for linux.
If you want to specify a custom phantom.js binary (e.g. you are working with MacOS and
need another phantom.js binary) export a environment variable PHANTOMJSBIN
which has
the path to your custom phantom.js binary.
For example:
export PHANTOMJSBIN="phantomjs" && lein doo once
lein test