The Game Of Life implemented in Scala and AngularJS
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 16 commits ahead of lsgu-hack-the-tower:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
project
src
.gitignore
README.md

README.md

RESTful API

The restful API will accept a simulation request with the following format:

{
  "board": [ [2, 3], [3, 6], ...],
  "steps": 10
}

And will respond with the following:

[[ [x, y], [w, z], ...], ...]

Running the application

In the root of the project, run 'sbt run' command to start the server. You can use curl to test the API:

curl -X POST -H "Content-Type: application/json" -d '{"board": [[0,0],[0,1],[0,2]],"steps": 10}' http://localhost:9909/

There is a minimal web UI written in AngularJS in src/web. The built version of the UI is in the src/main/resources folder and is available at http://127.0.0.1:9909/web/index.html when running the spray service.

Rules of the game of life

Any live c with fewer than two live neighbours dies, as if caused by under-population.

Any live c with two or three live neighbours lives on to the next generation.

Any live c with more than three live neighbours dies, as if by overcrowding.

Any dead c with exactly three live neighbours becomes a live c, as if by reproduction.