Menu

  • Home
  • Archives
  • Tags
  • RSS
July 25, 2014

simple game of life

(Just for fun)

{% gist a832613064f958641330 %}

Maybe I'll add a GUI and some tools later, but for now you have to do something like:


(start-game)

(add-life 4 5)

(add-life 5 5)

(add-life 6 5)

(print-board)

(step-board)

(print-board)

which should show

#
#
#

followed by

###

and so on ...

Update:

It's easy to try out patterns. Here are a few typical ones:

{% gist 527c5fa85b316c84e9ba %}

Then you can do something like


(loop repeat 5 do (print-board) (step-board))

and watch a few iterations. Of course, this is probably better implemented as a mobile app, I suppose. But yeah, still fun. Try out a few other spaceships if you like ...


Tags: old-post

« on moving from development to writing back to github »

Copyright © 2020 Agam Brahma

Powered by Cryogen