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

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

quizstreak/v0 package

Overview

Package quizstreak is a multiple-choice trivia quiz where every player runs their own independent streak instead of racing others for a single shared question.

Each address gets its own current question, picked deterministically from the address and the block height of its first answer so different players don't all start on the same question. A correct answer extends the player's streak and advances them to their next question; a wrong answer breaks the streak back to zero but leaves the same question live so they can retry. The realm tracks each player's best-ever streak on a global leaderboard.

Function

Answer

func Answer(cur realm, choiceIdx int) string
Ask AI Claude ChatGPT

Answer submits a choice (0..3) for the caller's current question. Crossing function: caller invokes as Answer(cross(cur), choiceIdx).

Param

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/nym-moultest123/x/daily/quizstreak/v0" -func "Answer" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "onyx-1" -remote "https://rpc.onyx.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.onyx.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/nym-moultest123/x/daily/quizstreak/v0" -func "Answer" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx