Table of Contents
gameoflife is Game_of_Life library in pure Nim.
gameoflife examples/read_file/in/glider.txt
glider.txt
is:
00000000000000000000000000000000000000
00000000000000000000000001000000000000
00000000000000000000000101000000000000
00000000000001100000011000000000000110
00000000000010001000011000000000000110
01100000000100000100011000000000000000
01100000000100010110000101000000000000
00000000000100000100000001000000000000
00000000000010001000000000000000000000
00000000000001100000000000000000000000
00000000000000000000000000000000000000
00000000000000000000000000000000000000
00000000000000000000000000000000000000
00000000000000000000000000000000000000
00000000000000000000000000000000000000
00000000000000000000000000000000000000
00000000000000000000000000000000000000
00000000000000000000000000000000000000
Generate random data with maze.
Setup:
nimble install -Y maze
And run:
maze -r:1 -w:0 -W:20 -H:20 | gameoflife
import gameoflife
from os import sleep
var board: Board = @[
@[dead, dead, dead, dead, dead],
@[dead, dead, dead, dead, dead],
@[dead, live, live, live, dead],
@[dead, dead, dead, dead, dead],
@[dead, dead, dead, dead, dead],
]
while true:
board.nextStep()
board.print
echo "-----------------------------------"
sleep(100)
I created simple Game of Life on web application.
Javascript library of Game of Life of the application is generated by this
module (nimble js
).