maxHistory
untyped bigintValue
(10 <untyped> bigint)
maxRecords
untyped bigintValue
(5 <untyped> bigint)
guessLog
typeValue
v1.guessLog
record
typeValue
v1.record
secret
[4]int- OID
- 070a1e…2f96:24
secret details
round
intValue
1
attempts
intValue
0
history
[]v1.guessLogValue
<zero>
records
[]v1.recordValue
<zero>
init.9
func()- OID
- 070a1e…2f96:9
init.9 details
seedFor
func(r int) int64seedFor derives a per-round PRNG seed from the current chain height so nobody can precompute the next secret before the round actually starts.
- OID
- 070a1e…2f96:11
seedFor details
nextRand
func(seed int64) int64nextRand is a minimal LCG (glibc constants) — no crypto strength needed for a casual puzzle, just enough spread across digits.
- OID
- 070a1e…2f96:12
nextRand details
newSecret
func(seed int64) [4]int- OID
- 070a1e…2f96:13
newSecret details
parseGuess
func(guess string) ([4]int, bool)parseGuess validates a 4-digit, distinct-digit guess string.
- OID
- 070a1e…2f96:14
parseGuess details
score
func(target [4]int, guess [4]int) (int, int)score returns (bulls, cows) for guess against target, assuming both have distinct digits (guaranteed by parseGuess / newSecret).
- OID
- 070a1e…2f96:15
score details
addHistory
func(l v1.guessLog)- OID
- 070a1e…2f96:16
addHistory details
addRecord
func(r v1.record)addRecord keeps the top maxRecords fastest solves, ascending by attempts.
- OID
- 070a1e…2f96:17
addRecord details
startNewRound
func()- OID
- 070a1e…2f96:18
startNewRound details
Guess
func(guess string) stringGuess submits a 4-distinct-digit code against the current round's secret. Returns the bulls/cows feedback, or "solved!" text when it's a win.
- OID
- 070a1e…2f96:19
Guess details
GiveUp
func() stringGiveUp reveals the current secret and starts a fresh round without awarding a leaderboard record.
- OID
- 070a1e…2f96:20
GiveUp details
digitsToString
func(d [4]int) string- OID
- 070a1e…2f96:21
digitsToString details
Render
func(path string) string- OID
- 070a1e…2f96:22
Render details
shortAddr
func(a string) string- OID
- 070a1e…2f96:23