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 state

Back to all declarations

MaxWidth

untyped bigint

Value

(50 <untyped> bigint)

MaxHeight

untyped bigint

Value

(40 <untyped> bigint)

width

int

Value

20

height

int

Value

15

generation

int

Value

0

population

int

Value

5

countNeighbors

func(x int, y int) int
Open
OID
04ad15…c31e:13
countNeighbors details

Inspect func

Step

func()

Step advances the simulation by exactly one generation.

Open
OID
04ad15…c31e:14
Step details

Inspect func

MultiStep

func(n int)

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

Open
OID
04ad15…c31e:15
MultiStep details

Inspect func

SetCell

func(x int, y int, live bool)

SetCell sets or clears a specific cell.

Open
OID
04ad15…c31e:16
SetCell details

Inspect func

Reset

func(w int, h int)

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

Open
OID
04ad15…c31e:17
Reset details

Inspect func

LoadPreset

func(name string)

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

Open
OID
04ad15…c31e:18
LoadPreset details

Inspect func

Render

func(path string) string

Render returns a Markdown snapshot of the current board.

Open
OID
04ad15…c31e:19
Render details

Inspect func
MaxWidth : untyped bigint =(50 <untyped> bigint)
MaxHeight : untyped bigint =(40 <untyped> bigint)
width : int =20
height : int =15
cells : []bool (len=300) Inspect
generation : int =0
population : int =5
init.7 : func() Inspect
initBoard : func(w int, h int) Inspect
cellIdx : func(x int, y int) int Inspect
alive : func(x int, y int) bool Inspect
countNeighbors : func(x int, y int) int Inspect
Step : func() Inspect
MultiStep : func(n int) Inspect
SetCell : func(x int, y int, live bool) Inspect
Reset : func(w int, h int) Inspect
LoadPreset : func(name string) Inspect
Render : func(path string) string Inspect