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

maxAttempts

untyped bigint

maxAttempts is the number of guesses a player gets per day.

Value

(6 <untyped> bigint)

wordLen

untyped bigint

wordLen is the fixed length of every word / guess.

Value

(5 <untyped> bigint)

blocksPerDay

untyped bigint

blocksPerDay controls how many blocks share the same secret word. Testnet blocks are fast, so this is a pragmatic "day" for a demo puzzle rather than a wall-clock day. Deterministic: derived only from block height.

Value

(17280 <untyped> bigint)

words

[]string (len=15)

words is the built-in dictionary of candidate secret words. All entries are exactly wordLen lowercase letters.

Open
OID
05b8a8…2bc4:4
words details (len=15)

+15 more Inspect slice

board

type

board holds one player's guesses for a given day.

Value

v0.board

players

map[string]*v0.board

players maps a caller address string to that player's current board. A plain map is fine here: keys are addresses, iteration order is never used for rendering (we only ever look up the caller's own board).

Open
OID
05b8a8…2bc4:6
players details

Inspect map

dayIndex

func(height int64) int64

dayIndex returns the deterministic day index for a given block height.

Open
OID
05b8a8…2bc4:7
dayIndex details

Inspect func

wordForDay

func(day int64) string

wordForDay returns the secret word for the given day index. Deterministic: a pure function of the day index and the built-in dictionary.

Open
OID
05b8a8…2bc4:9
wordForDay details

Inspect func

currentDay

func() int64

currentDay returns today's day index from the chain height.

Open
OID
05b8a8…2bc4:10
currentDay details

Inspect func

score

func(guess string, secret string) string

score compares a guess against the secret and returns wordLen emoji tiles: 🟩 right letter right spot, 🟨 right letter wrong spot, ⬜ letter absent. Standard Wordle two-pass scoring so duplicate letters are handled correctly.

Open
OID
05b8a8…2bc4:11
score details

Inspect func

isFiveLetters

func(w string) bool

isFiveLetters reports whether w is exactly wordLen ASCII lowercase letters.

Open
OID
05b8a8…2bc4:12
isFiveLetters details

Inspect func

Guess

func(word string)

Guess records a five-letter guess for the caller against today's word. It is a crossing (state-mutating) function: callers invoke it as Guess(cross(cur), "crane"). Identity is taken from the live crossing frame after the IsCurrent authentication check.

Open
OID
05b8a8…2bc4:13
Guess details

Inspect func

Render

func(path string) string

Render returns the caller's board as Markdown. It is NOT a crossing function (no cur realm parameter). It reads the viewer via the stack-walking unsafe.PreviousRealm(); an unknown viewer simply sees an empty board.

Open
OID
05b8a8…2bc4:14
Render details

Inspect func

writeRules

func(sb *strings.Builder)

writeRules appends the legend / how-to-play block.

Open
OID
05b8a8…2bc4:15
writeRules details

Inspect func

itoa

func(n int) string

itoa formats a small non-negative int (attempt counts) without importing strconv, keeping the dependency surface minimal.

Open
OID
05b8a8…2bc4:16
itoa details

Inspect func

i64toa

func(n int64) string

i64toa formats an int64 as decimal.

Open
OID
05b8a8…2bc4:17
i64toa details

Inspect func
maxAttempts : untyped bigint =(6 <untyped> bigint)
wordLen : untyped bigint =(5 <untyped> bigint)
blocksPerDay : untyped bigint =(17280 <untyped> bigint)
words : []string (len=15) Inspect
board : type =v0.board
players : map[string]*v0.board Inspect
dayIndex : func(height int64) int64 Inspect
wordForDay : func(day int64) string Inspect
currentDay : func() int64 Inspect
score : func(guess string, secret string) string Inspect
isFiveLetters : func(w string) bool Inspect
Guess : func(word string) Inspect
Render : func(path string) string Inspect
writeRules : func(sb *strings.Builder) Inspect
itoa : func(n int) string Inspect
i64toa : func(n int64) string Inspect