Introducing GoLaaS: Game of Life as a Service
you@local:~$ curl 'https://game-of-life.reb.gg/fig8.txt'
............
............
............
......###...
......###...
......###...
...###......
...###......
...###......
............
............
............
(with ?next=true
, changes on refresh!)
Redirects to this repository!
Render your existing game as txt or svg!
param | usage | default |
---|---|---|
next |
iterate to the next generation | false |
alive |
(txt) char for the alive cell | # |
dead |
(txt) char for the dead cell | . |
separator |
(txt) char for the line separator | \n |
cell_size |
(svg) width/height of the rendered cell | 20 |
stroke_width |
(svg) width of the stroke | 2 |
stroke_color |
(svg) color of the stroke | white |
fill_color |
(svg) color of the alive cells and text | black |
header | example | description |
---|---|---|
x-life-generation |
0 | generation iteration |
x-life-delta |
0 | changed cells in this generation |
ℹ️ Examples
you@local:~$ curl 'https://game-of-life.reb.gg/fig8.txt?alive=%E2%AC%9C&dead=%E2%AC%9B'
⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛
⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛
⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛
⬛⬛⬛⬛⬛⬛⬜⬜⬜⬛⬛⬛👾
⬛⬛⬛⬛⬛⬛⬜⬜⬜⬛⬛⬛
⬛⬛⬛⬛⬛⬛⬜⬜⬜⬛⬛⬛
⬛⬛⬛⬜⬜⬜⬛⬛⬛⬛⬛⬛
⬛⬛⬛⬜⬜⬜⬛⬛⬛⬛⬛⬛
⬛⬛⬛⬜⬜⬜⬛⬛⬛⬛⬛⬛
⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛
⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛
⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛
you@local:~$ curl 'https://game-of-life.reb.gg/foo.svg'
<svg xmlns="http://www.w3.org/2000/svg" width="240" height="260"><rect x="120" y="60" width="20" height="20" fill="black" stroke="white" stroke-width="2"/><rect x="140" y="60" width="20" height="20" fill="black" stroke="white" stroke-width="2"/><rect x="160" y="60" width="20" height="20" fill="black" stroke="white" stroke-width="2"/><rect x="120" y="80" width="20" height="20" fill="black" stroke="white" stroke-width="2"/><rect x="140" y="80" width="20" height="20" fill="black" stroke="white" stroke-width="2"/><rect x="160" y="80" width="20" height="20" fill="black" stroke="white" stroke-width="2"/><rect x="120" y="100" width="20" height="20" fill="black" stroke="white" stroke-width="2"/><rect x="140" y="100" width="20" height="20" fill="black" stroke="white" stroke-width="2"/><rect x="160" y="100" width="20" height="20" fill="black" stroke="white" stroke-width="2"/><rect x="60" y="120" width="20" height="20" fill="black" stroke="white" stroke-width="2"/><rect x="80" y="120" width="20" height="20" fill="black" stroke="white" stroke-width="2"/><rect x="100" y="120" width="20" height="20" fill="black" stroke="white" stroke-width="2"/><rect x="60" y="140" width="20" height="20" fill="black" stroke="white" stroke-width="2"/><rect x="80" y="140" width="20" height="20" fill="black" stroke="white" stroke-width="2"/><rect x="100" y="140" width="20" height="20" fill="black" stroke="white" stroke-width="2"/><rect x="60" y="160" width="20" height="20" fill="black" stroke="white" stroke-width="2"/><rect x="80" y="160" width="20" height="20" fill="black" stroke="white" stroke-width="2"/><rect x="100" y="160" width="20" height="20" fill="black" stroke="white" stroke-width="2"/><text x="50%" y="255" font-family="monospace" font-size="12" fill="black" dominant-baseline="center" text-anchor="middle">t = 0, Δ = 0</text></svg>
Create a new game. Submit the game as a raw body.
param | usage | default |
---|---|---|
alive |
char for the alive cell | # |
dead |
char for the dead cell | . |
separator |
char for the line separator | \n |
ℹ️ Examples
you@local:~$ curl -X POST --data-binary @examples/fig8 https://game-of-life.reb.gg/foo
............
............
............
......###...
......###...
......###...
...###......
...###......
...###......
............
............
............
Q: How is state persisted?
CloudFlare Workers KV and serialized as a JSON blob.
Q: Where is it hosted?
Q: Is it toroidal?
No, but feel free to open a PR!