Skip to content Search Apps Documentation Source Content Run Reset Eval Playground 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.

doc.gno

0.96 Kb · 29 lines
 1// Package flag is the shared vocabulary of Cellar, a capture-the-flag
 2// wargame played on gno.land.
 3//
 4// A challenge is a realm that holds a deliberate weakness. When a player
 5// exploits it, the realm records a capture in a Ledger. A hall (a
 6// scoreboard realm) learns about the challenge through the Challenge
 7// interface and asks it, on claim, whether a given player captured it.
 8//
 9// Anyone can author a challenge by importing this package:
10//
11//	package riddle
12//
13//	import (
14//		"gno.land/p/<ns>/cellar/flag"
15//		"gno.land/r/<ns>/cellar/hall"
16//	)
17//
18//	var captures = flag.NewLedger()
19//
20//	type challenge struct{}
21//
22//	func (challenge) Info() flag.Info { return info }
23//	func (challenge) Captured(p address) bool { return captures.Captured(p) }
24//
25//	func init(cur realm) { hall.Enlist(cross(cur), challenge{}) }
26//
27// The package also carries the scoring curve (Value) and the rule that
28// maps a caller to the player who gets the credit (Player).
29package flag