/p/g1magld5ptgzaktqcexxq0pgq5lmdf0kz6re8hlv/x/daily/rps/v0
gno.land/p/moul/x/daily/rps/v0
The rock-paper-scissors move: Parse, Move.String, Beats. Stateless, so
every realm that plays the game agrees on what "r" means and who wins.
1import "gno.land/p/moul/x/daily/rps/v0"
2
3m, ok := rps.Parse(" Paper ") // rps.Paper, true; "p" works too
4m.String() // "paper"
5rps.Beats(rps.Paper, rps.Rock) // 1: the first move wins (0 tie, 2 the second wins)
Move is ordered rock, paper, scissors so that (a - b) mod 3 is the verdict.
Consumers: rps,
rpsmatch,
rpsoracle,
rpsduel, each of
which carried its own copy of this logic before.
Part of moul/gno-contracts — moul's versioned gno.land contracts. See the repository for the full catalog, build/test tooling, and usage.
🧪 Highly experimental — potentially vibe-coded. Not audited; may break, change, or be removed at any time. Do not use with anything of value. Full disclaimer: DISCLAIMER.