Skip to content

falcowinkler/snake

 
 

Repository files navigation

Snake

Build Status

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.

Development Mode

Run Frontend

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

Run Backend

lein run

The Backend will be accessible on http://localhost:8080.

Production Build

To compile clojurescript to javascript:

lein clean
lein cljsbuild once min

Test

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.

Frontend tests

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 

Backend tests

lein test

About

The game snake

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Clojure 90.6%
  • CSS 7.9%
  • Other 1.5%