Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

v0 source realm

Conway's Game of Life on Gno — the entire board lives on-chain. Anyone can call Step() to tick the simulation forward...

Readme View source

Conway's Game of Life

⚠️ Experimental — generated with no human supervision. This realm was produced automatically by an MCP-driven agent to exercise the gno MCP server and tooling, and to generate test content for gno compilers, linters and formatters. Not audited. Not for production. Full context & folder README: r/moul/x/daily


A port of Conway's classic cellular automaton to gno.land. The full board lives on-chain — every generation tick is a real transaction, shared state for whoever is watching.

Realm path: gno.land/r/g12cs4cehujpffpjpywmkqj43m6u5ya53nj69sjz/life

How it works

The board starts as a 20×15 grid seeded with a glider. Anyone can call Step() to tick the simulation, load a classic pattern, or sculpt cells by hand. All state persists between blocks.

Example calls

 1# Advance one generation
 2gnokey maketx call -pkgpath gno.land/r/g12cs4cehujpffpjpywmkqj43m6u5ya53nj69sjz/life -func Step ...
 3
 4# Jump 10 generations at once
 5gnokey maketx call -pkgpath gno.land/r/g12cs4cehujpffpjpywmkqj43m6u5ya53nj69sjz/life -func MultiStep \
 6  -args '10' ...
 7
 8# Load the classic glider (top-left corner)
 9gnokey maketx call -pkgpath gno.land/r/g12cs4cehujpffpjpywmkqj43m6u5ya53nj69sjz/life -func LoadPreset \
10  -args 'glider' ...
11
12# Paint a live cell at (5, 5)
13gnokey maketx call -pkgpath gno.land/r/g12cs4cehujpffpjpywmkqj43m6u5ya53nj69sjz/life -func SetCell \
14  -args '5 5 true' ...
15
16# Resize to a 30×20 board (clears state)
17gnokey maketx call -pkgpath gno.land/r/g12cs4cehujpffpjpywmkqj43m6u5ya53nj69sjz/life -func Reset \
18  -args '30 20' ...

Presets

Name Type Period Notes
glider Spaceship 4 Travels diagonally
blinker Oscillator 2 Simplest oscillator
toad Oscillator 2 Two-row alternation
beacon Oscillator 2 Two interlocked blocks
block Still life Stable 2×2 square
pulsar Oscillator 3 Large symmetric pattern

Part of moul/gno-contracts — moul's versioned gno.land contracts. See the repository for the full catalog, build/test tooling, and usage.

🧪 Highly experimental — potentially vibe-coded. Not audited; may break, change, or be removed at any time. Do not use with anything of value. Full disclaimer: DISCLAIMER.

Overview

Conway's Game of Life on Gno — the entire board lives on-chain. Anyone can call Step() to tick the simulation forward, load classic patterns, or sculpt cells one by one.

Constants 1

Functions 6

func LoadPreset

Action
1func LoadPreset(name string)
source

LoadPreset loads a classic Game of Life pattern onto the current board. Names: glider, blinker, toad, beacon, block, pulsar.

func MultiStep

Action
1func MultiStep(n int)
source

MultiStep advances the simulation by n generations (capped at 100).

func Render

1func Render(path string) string
source

Render returns a Markdown snapshot of the current board.

func Reset

Action
1func Reset(w, h int)
source

Reset clears the board and resizes it to w×h.

func Step

Action
1func Step()
source

Step advances the simulation by exactly one generation.

Imports 2

  • strconv stdlib
  • strings stdlib

Source Files 3