UP | HOME
2015-10-14 | ../../ | Slides

Game of Life, Redo

1 Conway's Game of Life

  1. Any live cell with
    1. < 2 live neighbours dies (as if caused by under-population).
    2. 2 or 3 live neighbours lives on to the next generation.
    3. > 3 live neighbours dies (as if by over-population).
  2. Any dead cell with exactly three live neighbours becomes a live cell (as if by reproduction).
  3. https://en.wikipedia.org/wiki/Conway's_Game_of_Life

1.1 GUI Needs of GoL

  1. A (stationary) grid of cells; infinite in x and y axes
  2. Draw/Erase a cell; filled? color?
  3. Control: speed, size, …
  4. Themes: colors, circle, square, …
  5. Kbd/Mouse/Touch interface
  6. Extensible (plugins)

1.2 Observations

  1. Inherently concurrent
  2. Systolic (as in heart beat)
  3. Non-Trivial: Correct implementation of the rules
  4. Non-Trivial: Infinite grid
  5. Non-Trivial: Detecting rule applicability

2 Open Source GoL Implementations

2.1 Edwin Martin's Implementation

  1. http://www.bitstorm.org/gameoflife/code
  2. A quick tour
    1. Java files 18, xml files 2
    2. Java SLOC 1549, xml SLOC 769
  3. Browse Game-Of-Life files generated by Doxygen
  4. Uses Java JDK 1.1
  5. import java.awt.*

2.2 Other Implementations

  1. https://github.com/Dricus/game-of-life "A small practice project for doing Test Driven Development and doing basic 2D stuff with JavaFX." Java, JavaFX and XML; Open Source Code, 2014
  2. http://pmav.eu/stuff/javascript-game-of-life-v3.1.1/ Javascript, Canvas
  3. https://www.youtube.com/watch?v=Ti8cXWvclKo&list by "ForseenParadox"; cliams to have programmed in 1 hour while video recording
  4. Google Play for Android has several APKs. Probably not open source.

3 Game of Life Redo

  1. Re-write/ Refactor/ Annotate/ Document GoL
  2. Concurrent design and implementation
  3. Event driven design and implementation
  4. Wiki has several patterns – all these must "work"
  5. Tabs, one GoL running in each
  6. Look elegant
  7. A portion of the above is Lab L2
  8. http://codegolf.stackexchange.com/questions/88783/build-a-digital-clock-in-conways-game-of-life/

4 Concurrency

  1. Non-Trivial: Correct implementation of the rules
  2. Inherently concurrent
  3. The rules must be evaluated concurrently.
  4. Assuming systolic (i.e., like a heart beat) updates

5 References

6 End


Copyright © 2015 www.wright.edu/~pmateti