gridSize
untyped bigint// 4x4
Value
(16 <untyped> bigint)
numPairs
untyped bigintValue
(8 <untyped> bigint)
faces
[8]stringfaces are the 8 distinct emoji; each appears exactly twice on the board.
- OID
- 0b2df3…a2d6:4
faces details
tile
typetile holds the face index (0..7) for a cell and whether it is matched.
Value
v0.tile
board
struct{...}board is the full game state. It is a package-level singleton so the realm persists a single shared game.
- OID
- 0b2df3…a2d6:6
board details
shuffle
func(seed int64) [16]v0.tileshuffle produces a deterministic permutation of the 16 tile faces from a 64-bit seed. It fills a slice with two of each face index then applies a Fisher-Yates shuffle driven by a simple LCG — fully deterministic, no RNG.
- OID
- 0b2df3…a2d6:24
shuffle details
ensureStarted
func()- OID
- 0b2df3…a2d6:26
ensureStarted details
reset
func(height int64)- OID
- 0b2df3…a2d6:27
reset details
NewGame
func()NewGame reshuffles the board using the current block height as the seed.
- OID
- 0b2df3…a2d6:28
NewGame details
Flip
func(index int)Flip reveals the tile at index (0..15). Rules: - If two tiles are already showing from a previous unmatched attempt, this Flip first clears them (they turn back to hidden), then reveals the requested tile as the first of a new attempt. - Revealing the second tile of an attempt completes a move: matching faces stay face-up (matched); a mismatch leaves both showing until the next Flip clears them. - Flipping an already-matched or already-showing tile is rejected.
- OID
- 0b2df3…a2d6:29
Flip details
solved
func() bool- OID
- 0b2df3…a2d6:30
solved details
cellFace
func(i int) stringcellFace returns the emoji to display for a cell given the current state.
- OID
- 0b2df3…a2d6:31
cellFace details
Render
func(path string) stringRender draws the board as Markdown: a 4x4 grid, move count and solved state.
- OID
- 0b2df3…a2d6:32