wearCells
untyped bigintValue
(128 <untyped> bigint)
maxData
untyped bigintmaxData bounds a version's data: a hole at every limit of the format is about 21 KB.
Value
(32768 <untyped> bigint)
Publish
func(slot string, hexData string, note string) stringPublish puts a course hole's data into its slot as its next version and returns the new id ("garden/7/v2"). Only the owner can. hexData is the hole as course.Encode wrote it, in hex. slot must be the data's own world and order ("garden/7", order 1 to 999), so a mis-edited file cannot replace the wrong hole; the course holds at most 9999 slots (maxCourse). Data identical to the current version's is refused. The version it replaces is archived: its records stay, its bests leave the course standings. note (at most 140 characters, cleaned) says why.
- OID
- 08cda7…5c9f:3
Publish details
PublishMine
func(slug string, hexData string, note string) stringPublishMine publishes a community hole of the caller's own and returns its id: "\<caller>/\<slug>/v1", then v2 and on. Anyone can while publishing is open (SetPublishing); only the same address adds versions. slug is 1 to 32 of a-z, 0-9 and "-". The data is checked as Publish checks it, its world and order aside; its name and note carry no web address. It is playable and recorded, in no cup and not in the course ranking; a new version of a hidden hole stays hidden. The publisher pays the storage deposit (about half a GNOT a version), and nothing published can be deleted.
- OID
- 08cda7…5c9f:5
PublishMine details
newestRow
func(a string) stringnewestRow is the height of an author's newest row in byAuthor ("\<address> \<height> \<slug>"), "" if they have none.
- OID
- 08cda7…5c9f:6
newestRow details
moveAuthor
func(a string, was string, now string)moveAuthor moves an author's own row in byAuthor (recentKey(height, address)) from the height was to now, "" for none: it stays at their newest row's, and goes with their last.
- OID
- 08cda7…5c9f:7
moveAuthor details
linkish
func(s string) boollinkish spots a web address in a community hole's name or note: "www.", a dot between a letter or digit and two letters ("claim.xyz", "t.me"; not "e.g."), or an IP address, look-alike dots (.。․﹒) read as dots, letters in any case. Basic (the owner can Hide what gets past) and strict on purpose ("St.Andrews" is refused). It reads s a byte at a time: every mark is ASCII, so a non-ASCII character is decoded only to tell İ and the Kelvin sign (which lower-case to ASCII), the look-alike dots and spaces apart.
- OID
- 08cda7…5c9f:8
linkish details
isLower
func(c uint8) bool- OID
- 08cda7…5c9f:9
isLower details
isDigit
func(c uint8) bool- OID
- 08cda7…5c9f:10
isDigit details
decodeData
func(hexData string) (*course.Simple, string, string)decodeData checks a version's data as it arrives: hex, GG1 within the format's limits, stored lengths bit-exact (DecodeChecked: every later Decode trusts them), and in the one form Encode gives.
- OID
- 08cda7…5c9f:11
decodeData details
nothingNew
func(old *golf.entry) stringnothingNew refuses data identical to the alias's current version: it would reset the hole's ranking for nothing.
- OID
- 08cda7…5c9f:12
nothingNew details
dataEntry
func(alias string, n int, h *course.Simple, by .uverse.address, sum string, note string) *golf.entry- OID
- 08cda7…5c9f:13
dataEntry details
worlds
[]struct{...}worlds is the course's worlds in play order, with their names on the page.
- OID
- 08cda7…5c9f:15
worlds details
worldRank
func(w string) intworldRank is a world's place among worlds; any other comes after.
- OID
- 08cda7…5c9f:21
worldRank details
slotKey
func(world string, order int) stringslotKey is a slot's key: its world's rank, the world, and the order in three digits, so the slots tree is in course order.
- OID
- 08cda7…5c9f:22
slotKey details
slotKeyOf
func(slot string) (string, bool)slotKeyOf reads a slot, "world/order" (as "garden/7"), into its key.
- OID
- 08cda7…5c9f:23
slotKeyOf details
validSlug
func(s string) bool- OID
- 08cda7…5c9f:24
validSlug details
HoleData
func(hole string) stringHoleData is a version's GG1, in hex, as it was published (an alias gives its current version's): what a golf/v2 or an auditor reads back.
- OID
- 08cda7…5c9f:25
HoleData details
Current
func(alias string) stringCurrent is the id of the version an alias ("garden/7", "\<address>/\<slug>") plays now, "" if the alias has none.
- OID
- 08cda7…5c9f:26
Current details
Versions
func(alias string) stringVersions is every version of an alias, oldest first (the newest pageMax if there are more): its id, number, the height it was published at, by whom, its data's sha256, its note, and the version that took its place. slot is the alias, "" (and no versions) for one that has none.
- OID
- 08cda7…5c9f:27
Versions details
firstVersion
func(now *golf.entry) intfirstVersion is the oldest of now's versions a list shows: the newest pageMax are (now is its alias's current version).
- OID
- 08cda7…5c9f:28
firstVersion details
BestOf
func(hole string, mode string, player .uverse.address) intBestOf is a player's best finished round on a hole in a mode, 0 if none.
- OID
- 08cda7…5c9f:29
BestOf details
maxPower
untyped bigdecValue
(10.0 <untyped> bigdec)
maxShots
untyped bigintValue
(12 <untyped> bigint)
errShot
untyped stringThe refusals said in more than one place.
Value
"golf: a shot is an angle and a power between 0 and 10"
errStrokeLimit
untyped stringThe refusals said in more than one place.
Value
"golf: this round is over its stroke limit, Reset to play again"
errShotTooHeavy
untyped stringThe refusals said in more than one place.
Value
"golf: one shot on this hole could cost more than a transaction can replay"
errTooStormy
untyped stringThe refusals said in more than one place.
Value
"golf: in its dearest weather, a commit on this hole would leave too little room for a shot"
errUnknownHole
untyped stringThe refusals said in more than one place.
Value
"golf: unknown hole: "
entry
typeValue
golf.entry
record
typerecord is the hole's record in one mode: who holds it, in how many strokes, 0 if never completed.
Value
golf.record
bestOf
func(r *golf.round) stringbestOf is how a best is kept: "\<strokes> \<height> \<period> \<shots>". The height ranks it before a later tie (boardKey); the period and shots let Ghost replay it in its own weather. The mode is in the key.
- OID
- 08cda7…5c9f:30
bestOf details
errBest
untyped stringerrBest is a best not as bestOf writes it: never written, refused if read.
Value
"golf: a best not as bestOf writes it: "
bestStrokes
func(v interface{...}) intbestStrokes is a kept best's strokes, 0 for none (a tree's nil).
- OID
- 08cda7…5c9f:32
bestStrokes details
bestFields
func(v interface{...}) (int64, int64, string)bestFields is a kept best's height, period and shots.
- OID
- 08cda7…5c9f:33
bestFields details
view
typeview is the rows of a shared index under prefix p, read and written without it. p ends with a space, which no id holds, so its rows are exactly the keys from p to p with the space made a "!".
Value
golf.view
before
func(t *v0.BPTree, k string) intbefore is how many keys of t sort before k: a binary search by index.
- OID
- 08cda7…5c9f:34
before details
seeded
func() *v0.BPTreeseeded is a shared index whose first leaf the deployer pays at init, not its first player. Its key "" sorts before every view's rows: no view sees it.
- OID
- 08cda7…5c9f:35
seeded details
newEntry
func(id string, name string, par int, world string, order float64) *golf.entry- OID
- 08cda7…5c9f:36
newEntry details
draining
typedraining is an archived hole's drain, per mode: the next player to take out, whether all are out, and the players whose first finish came after it was archived: never counted, so never taken out.
Value
golf.draining
round
typeValue
golf.round
assisted
untyped bigintA round is played in one of two modes, each with its own records and rankings: assisted (the full aim preview) or pro (the preview cut short). The chain cannot see a screen: the mode is the player's word.
Value
(0 <untyped> bigint)
pro
untyped bigintA round is played in one of two modes, each with its own records and rankings: assisted (the full aim preview) or pro (the preview cut short). The chain cannot see a screen: the mode is the player's word.
Value
(1 <untyped> bigint)
modes
untyped bigintA round is played in one of two modes, each with its own records and rankings: assisted (the full aim preview) or pro (the preview cut short). The chain cannot see a screen: the mode is the player's word.
Value
(2 <untyped> bigint)
modeOf
func(name string) intmodeOf reads a mode's name: "assisted" (or "") or "pro"; anything else panics rather than answer for another mode.
- OID
- 08cda7…5c9f:37
modeOf details
modeNames
[2]string- OID
- 08cda7…5c9f:39
modeNames details
modeTitles
[2]stringmodeTitles is how the pages head a mode's board.
- OID
- 08cda7…5c9f:41
modeTitles details
courseHoles
*v0.BPTreeThe indexes are B+ trees (32 entries a leaf: far cheaper an entry than an AVL node). What players add goes to five of them, shared by every version and mode and seeded at init (views): a first player pays for their own rows only. A B+ tree must not change while it is iterated: no callback below writes to the tree it walks (drain walks a hole's bests and writes the standings).
- OID
- 08cda7…5c9f:43
courseHoles details
community
*v0.BPTreeThe indexes are B+ trees (32 entries a leaf: far cheaper an entry than an AVL node). What players add goes to five of them, shared by every version and mode and seeded at init (views): a first player pays for their own rows only. A B+ tree must not change while it is iterated: no callback below writes to the tree it walks (drain walks a hole's bests and writes the standings).
- OID
- 08cda7…5c9f:46
community details
holeData
*v0.BPTreeThe indexes are B+ trees (32 entries a leaf: far cheaper an entry than an AVL node). What players add goes to five of them, shared by every version and mode and seeded at init (views): a first player pays for their own rows only. A B+ tree must not change while it is iterated: no callback below writes to the tree it walks (drain walks a hole's bests and writes the standings).
- OID
- 08cda7…5c9f:49
holeData details
slots
*v0.BPTreeThe indexes are B+ trees (32 entries a leaf: far cheaper an entry than an AVL node). What players add goes to five of them, shared by every version and mode and seeded at init (views): a first player pays for their own rows only. A B+ tree must not change while it is iterated: no callback below writes to the tree it walks (drain walks a hole's bests and writes the standings).
- OID
- 08cda7…5c9f:52
slots details
aliases
*v0.BPTreeThe indexes are B+ trees (32 entries a leaf: far cheaper an entry than an AVL node). What players add goes to five of them, shared by every version and mode and seeded at init (views): a first player pays for their own rows only. A B+ tree must not change while it is iterated: no callback below writes to the tree it walks (drain walks a hole's bests and writes the standings).
- OID
- 08cda7…5c9f:55
aliases details
byAuthor
*v0.BPTreeThe indexes are B+ trees (32 entries a leaf: far cheaper an entry than an AVL node). What players add goes to five of them, shared by every version and mode and seeded at init (views): a first player pays for their own rows only. A B+ tree must not change while it is iterated: no callback below writes to the tree it walks (drain walks a hole's bests and writes the standings).
- OID
- 08cda7…5c9f:58
byAuthor details
archived
*v0.BPTreeThe indexes are B+ trees (32 entries a leaf: far cheaper an entry than an AVL node). What players add goes to five of them, shared by every version and mode and seeded at init (views): a first player pays for their own rows only. A B+ tree must not change while it is iterated: no callback below writes to the tree it walks (drain walks a hole's bests and writes the standings).
- OID
- 08cda7…5c9f:64
archived details
rounds
*v0.BPTreeThe indexes are B+ trees (32 entries a leaf: far cheaper an entry than an AVL node). What players add goes to five of them, shared by every version and mode and seeded at init (views): a first player pays for their own rows only. A B+ tree must not change while it is iterated: no callback below writes to the tree it walks (drain walks a hole's bests and writes the standings).
- OID
- 08cda7…5c9f:67
rounds details
bests
*v0.BPTreebests is the version's results in mode m: player address -> their best finished round there, kept across replays, as bestOf writes it.
- OID
- 08cda7…5c9f:75
bests details
boards
*v0.BPTreeThe indexes are B+ trees (32 entries a leaf: far cheaper an entry than an AVL node). What players add goes to five of them, shared by every version and mode and seeded at init (views): a first player pays for their own rows only. A B+ tree must not change while it is iterated: no callback below writes to the tree it walks (drain walks a hole's bests and writes the standings).
- OID
- 08cda7…5c9f:83
boards details
allTotals
*v0.BPTreeThe indexes are B+ trees (32 entries a leaf: far cheaper an entry than an AVL node). What players add goes to five of them, shared by every version and mode and seeded at init (views): a first player pays for their own rows only. A B+ tree must not change while it is iterated: no callback below writes to the tree it walks (drain walks a hole's bests and writes the standings).
- OID
- 08cda7…5c9f:91
allTotals details
totals
[2]golf.viewThe indexes are B+ trees (32 entries a leaf: far cheaper an entry than an AVL node). What players add goes to five of them, shared by every version and mode and seeded at init (views): a first player pays for their own rows only. A B+ tree must not change while it is iterated: no callback below writes to the tree it walks (drain walks a hole's bests and writes the standings).
- OID
- 08cda7…5c9f:99
totals details
allRanks
*v0.BPTreeThe indexes are B+ trees (32 entries a leaf: far cheaper an entry than an AVL node). What players add goes to five of them, shared by every version and mode and seeded at init (views): a first player pays for their own rows only. A B+ tree must not change while it is iterated: no callback below writes to the tree it walks (drain walks a hole's bests and writes the standings).
- OID
- 08cda7…5c9f:103
allRanks details
ranks
[2]golf.viewThe indexes are B+ trees (32 entries a leaf: far cheaper an entry than an AVL node). What players add goes to five of them, shared by every version and mode and seeded at init (views): a first player pays for their own rows only. A B+ tree must not change while it is iterated: no callback below writes to the tree it walks (drain walks a hole's bests and writes the standings).
- OID
- 08cda7…5c9f:111
ranks details
idle
[2]golf.viewThe indexes are B+ trees (32 entries a leaf: far cheaper an entry than an AVL node). What players add goes to five of them, shared by every version and mode and seeded at init (views): a first player pays for their own rows only. A B+ tree must not change while it is iterated: no callback below writes to the tree it walks (drain walks a hole's bests and writes the standings).
- OID
- 08cda7…5c9f:115
idle details
archiving
[]stringThe indexes are B+ trees (32 entries a leaf: far cheaper an entry than an AVL node). What players add goes to five of them, shared by every version and mode and seeded at init (views): a first player pays for their own rows only. A B+ tree must not change while it is iterated: no callback below writes to the tree it walks (drain walks a hole's bests and writes the standings).
Value
<zero>
row
typerow is one player's standing across the course: their best on each hole counted, summed, and those holes' pars, summed. Its score against par, strokes - par, is what ranks it after its holes.
Value
golf.row
topSize
untyped bigintValue
(10 <untyped> bigint)
named
func(player string) boolnamed reports whether a player has a gno.land name (r/sys/users). Only named players rank: a name takes a registration, so a script cannot fill the boards with free addresses. Every finish is still kept.
- OID
- 08cda7…5c9f:119
named details
nameOf
func(player string) stringnameOf is a named player's name, "" for anyone else.
- OID
- 08cda7…5c9f:120
nameOf details
nameish
func(n string) boolnameish is a name as r/sys/users registers it (a-z, then a-z, 0-9, "\_" and "-", at most 64), checked again because the pages print names in links.
- OID
- 08cda7…5c9f:121
nameish details
find
func(id string) *golf.entryfind is the hole with this exact id, nil if none.
- OID
- 08cda7…5c9f:122
find details
current
func(alias string) stringcurrent is the id an alias points at now: a course slot's or a community hole's current version; "" if it is neither.
- OID
- 08cda7…5c9f:123
current details
mustHole
func(id string) *golf.entrymustHole is the hole a write names: its exact id. An alias is refused: a new version may have taken its place since the round's shots were chosen.
- OID
- 08cda7…5c9f:124
mustHole details
readHole
func(id string) *golf.entryreadHole is the hole a read names: an exact id, or an alias for its current version.
- OID
- 08cda7…5c9f:125
readHole details
recentKey
func(height int64, what string) stringrecentKey orders by height, then by what is at that height.
- OID
- 08cda7…5c9f:126
recentKey details
pad
func(n int, width int) stringpad writes n in width digits, zeros first: keys that sort as numbers.
- OID
- 08cda7…5c9f:127
pad details
rankKey
func(r *golf.row) stringrankKey orders the course ranking: most holes first, then the best score against par (a hole at par counts the same whatever its par), then the first there, then the address. The score is signed: vsParBias puts it in seven digits. The holes take five: a standing can count more than the course's slots while a republished hole drains (its old best still counts, its new one adds a hole), so they get room well past maxCourse.
- OID
- 08cda7…5c9f:128
rankKey details
maxCourse
untyped bigintmaxCourse bounds the course's slots (Publish); a standing's holes are at most those plus the archived versions drain has not taken it out of yet. vsParBias is more than a standing can be under or over par: a hole is -18 to +59 (1 to 60 strokes, par 1 to 19), so a full course at most 9999 \* 59 = 589,941 over, 179,982 under, and the seven digits hold 55,555 holes.
Value
(9999 <untyped> bigint)
vsParBias
untyped bigintmaxCourse bounds the course's slots (Publish); a standing's holes are at most those plus the archived versions drain has not taken it out of yet. vsParBias is more than a standing can be under or over par: a hole is -18 to +59 (1 to 60 strokes, par 1 to 19), so a full course at most 9999 \* 59 = 589,941 over, 179,982 under, and the seven digits hold 55,555 holes.
Value
(1000000 <untyped> bigint)
boardKey
func(v interface{...}, player string) stringboardKey orders a hole's board by each player's best v: fewest strokes, then the first to make them (a best's shots are public: whoever replays them ties it and ranks after), then the address.
- OID
- 08cda7…5c9f:129
boardKey details
boardStrokes
func(k string) intboardStrokes is the strokes of a board's key: always its three digits.
- OID
- 08cda7…5c9f:130
boardStrokes details
setRow
func(m int, r *golf.row, holes int, strokes int, par int, at int64)setRow moves a player's standing, as of height at, and keeps the ranking in step. A standing with no hole left is not freed, nor its key, which moves to idle: its deposit is the player's, and freeing it would refund whoever drained it. It moves back at the player's next hole.
- OID
- 08cda7…5c9f:131
setRow details
improve
func(m int, player string, par int, was int, best int)improve moves a player's standing by a new best on an official hole of par par (was: their old best there, 0 if none): only those count, or anyone's own hole would be a way to the top. The standing is kept, not recomputed, so a finish costs the same however many play.
- OID
- 08cda7…5c9f:132
improve details
retire
func(old *golf.entry, next string)retire archives an official hole replaced by next. Its bests stay there as its records but leave the course standings, in batches (drain): the Publish takes retireBatch, each course finish finishBatch, a Drain up to drainMax.
- OID
- 08cda7…5c9f:133
retire details
retireBatch
untyped bigintHow many archived players a Publish, a course finish and a Drain take out of the standings: sized so none costs more however many played.
Value
(150 <untyped> bigint)
finishBatch
untyped bigintHow many archived players a Publish, a course finish and a Drain take out of the standings: sized so none costs more however many played.
Value
(4 <untyped> bigint)
drainMax
untyped bigintHow many archived players a Publish, a course finish and a Drain take out of the standings: sized so none costs more however many played.
Value
(400 <untyped> bigint)
drain
func(n int)drain takes up to n archived players out of the standings, oldest archived hole first.
- OID
- 08cda7…5c9f:134
drain details
Drain
func(n int) intDrain takes up to n players (1 to 400) of archived holes out of the course standings, sooner than the finishes would, and returns how many archived holes still have players in them. Anyone can call it. A standing it empties is kept at 0 holes (setRow): nothing is refunded to the caller.
- OID
- 08cda7…5c9f:135
Drain details
counts
func(e *golf.entry, m int, player string, was int) boolcounts reports whether a best on e by player (was: their previous best, 0 if none) moves their standing: e is a current official hole, or an archived one whose drain has not reached them yet and where they already counted. A first finish on an archived hole never counts.
- OID
- 08cda7…5c9f:136
counts details
Launch
func(hole string, angle float64, power float64) stringLaunch plays one shot of the caller's round on hole (an exact id): angle in degrees (0 = right, 90 = down), power in (0, 10]. It is how gnoweb plays, with no aim preview, so its rounds are pro rounds. It answers with where the ball stopped, or the score if holed; PlayRoundAt commits many shots.
- OID
- 08cda7…5c9f:137
Launch details
aim
func(from physics.Vec2, cup physics.Vec2) (float64, float64)aim is the angle, in the shot's degrees, and the straight-line distance from a ball to the cup: walls and slopes are the player's to allow for.
- OID
- 08cda7…5c9f:138
aim details
PlayRound
func(hole string, shots string) stringPlayRound is PlayRoundAt in the current period, for a caller with none to give (a form, a script); a round under way keeps its own. Prefer PlayRoundAt: a commit included after the weather turned is then played in the weather its shots were chosen in.
- OID
- 08cda7…5c9f:139
PlayRound details
PlayRoundAt
func(hole string, shots string, period int64) stringPlayRoundAt replays shots into the caller's assisted round on hole (an exact id), continuing it, in the weather of period: the current one or the one before, and a round under way keeps its own. The client sends decisions, never outcomes: the chain replays them. shots is "angle,power\[,tick];…" (MsgCall carries no slice), at most 12, fewer on a heavy hole: a commit past the work budget is refused with the number of shots that fit, and the rest goes in the next commit.
- OID
- 08cda7…5c9f:140
PlayRoundAt details
PlayRoundPro
func(hole string, shots string, period int64) stringPlayRoundPro is PlayRoundAt for a round played in pro mode: the aim preview cut short. It counts on the pro records and rankings only.
- OID
- 08cda7…5c9f:141
PlayRoundPro details
playRound
func(e *golf.entry, player .uverse.address, shots string, period int64, mode int) string- OID
- 08cda7…5c9f:142
playRound details
otherMode
func(r *golf.round) stringotherMode refuses to go on with a round in a mode it was not started in.
- OID
- 08cda7…5c9f:143
otherMode details
shotList
func(shots string) []stringshotList is a commit's shots: the non-empty entries of "a,p;a,p;…", at least one and at most maxShots.
- OID
- 08cda7…5c9f:144
shotList details
work
typework is a commit's estimated gas so far. A shot counts the larger of its path's estimate and its Shot.Work's, plus its pulses' set-up, on top of what the commit spent before its shots (fixed: decoding, forecast). A shot that could pass workBudget is refused before anything is kept, and each is played under a work cap (physics.Field.Cap), so no commit can pass it; the client mirrors the model. An estimate, not a gas meter: see docs/golf.md, "The work budget".
Value
golf.work
workBudget
untyped bigintThe budget: of the 2e9 gas a wallet lets a transaction simulate, 1.4e9 for a commit, decoding and forecast included; the rest for package loads and bookkeeping.
Value
(1400000000 <untyped> bigint)
workPerShot
untyped bigintThe budget: of the 2e9 gas a wallet lets a transaction simulate, 1.4e9 for a commit, decoding and forecast included; the rest for package loads and bookkeeping.
Value
(10000000 <untyped> bigint)
workPerWall
untyped bigintThe budget: of the 2e9 gas a wallet lets a transaction simulate, 1.4e9 for a commit, decoding and forecast included; the rest for package loads and bookkeeping.
Value
(150000 <untyped> bigint)
workPerPoint
untyped bigintThe budget: of the 2e9 gas a wallet lets a transaction simulate, 1.4e9 for a commit, decoding and forecast included; the rest for package loads and bookkeeping.
Value
(1200000 <untyped> bigint)
workPerPiece
untyped bigintThe budget: of the 2e9 gas a wallet lets a transaction simulate, 1.4e9 for a commit, decoding and forecast included; the rest for package loads and bookkeeping.
Value
(15000 <untyped> bigint)
workPerUnit
untyped bigintThe budget: of the 2e9 gas a wallet lets a transaction simulate, 1.4e9 for a commit, decoding and forecast included; the rest for package loads and bookkeeping.
Value
(1000 <untyped> bigint)
workPerPulseWall
untyped bigintThe budget: of the 2e9 gas a wallet lets a transaction simulate, 1.4e9 for a commit, decoding and forecast included; the rest for package loads and bookkeeping.
Value
(700000 <untyped> bigint)
workPerPulsePost
untyped bigintThe budget: of the 2e9 gas a wallet lets a transaction simulate, 1.4e9 for a commit, decoding and forecast included; the rest for package loads and bookkeeping.
Value
(200000 <untyped> bigint)
decodeBase
untyped bigintDecoding a hole's data costs at most decodeBase and decodePerByte a byte.
Value
(6000000 <untyped> bigint)
decodePerByte
untyped bigintDecoding a hole's data costs at most decodeBase and decodePerByte a byte.
Value
(4000 <untyped> bigint)
fixedGas
func(e *golf.entry, fc course.Forecast) int64fixedGas is what a commit on e spends before its shots, in the forecast fc: decoding the hole, and drawing the forecast.
- OID
- 08cda7…5c9f:145
fixedGas details
decodeGas
func(size int) int64decodeGas bounds decoding size bytes of a hole's data.
- OID
- 08cda7…5c9f:146
decodeGas details
maxShotGas
untyped bigintmaxShotGas bounds a hole's heaviest shot (shotBound and its pulses' set-up): a hole past it is refused at publish.
Value
(1300000000 <untyped> bigint)
minShotWork
untyped bigintminShotWork is the work, in the physics' units, a commit's first shot may always do whatever the weather: four fifths of MaxWork. A shot is capped at what is left of the budget (work.next), so a hole whose dearest weather would leave less is refused at publish (worstGas): on a published hole, every shot of less than minShotWork plays out in any weather (as a commit's first, if need be), and an author whose board is too heavy is told at publish, not by a hole that misbehaves in the rain. A shot past it may be cut short; none is known: the course's heaviest real shot does 441,737 over the full grid of tee shots (mountain/16, full power, in a storm), and the heaviest found in an adversarial search 0.74 of MaxWork (docs/golf.md); the course's tightest room in its dearest weather is 839,278 (mountain/7), 39,278 over the floor.
Value
(800000 <untyped> bigint)
worstGas
func(h *course.Simple, size int) int64worstGas is what a commit on h (size bytes of data) spends up to a first shot of minShotWork in its dearest weather: decoding, the forecast at its most (course.WorstForecastWork), and the shot, its walls and its pulses' set-up, as work.next caps it.
- OID
- 08cda7…5c9f:147
worstGas details
newWork
func(h *course.Simple, weather []physics.Zone) *golf.worknewWork is a commit's work on a hole, before any shot: its walls and pieces, a pulse's as if always there, and the weather's.
- OID
- 08cda7…5c9f:148
newWork details
shotBound
func(walls int64) int64shotBound is the most one shot on a board of walls walls can cost: the physics ends a stroke at MaxWork, passing it by MaxWorkStep at most.
- OID
- 08cda7…5c9f:149
shotBound details
pieces
func(ws []physics.Wall, ps []physics.Post, zs []physics.Zone) int64pieces counts what a ball is tested against: each wall, post and zone, and each edge of a zone's polygon.
- OID
- 08cda7…5c9f:150
pieces details
Reset
func(hole string)Reset abandons the caller's round under way on hole (an exact id), freeing its storage: the next stroke starts a new one from the tee. A finished round is not kept (its best is), so a new one needs no Reset. With no round under way it does nothing, and says nothing.
- OID
- 08cda7…5c9f:151
Reset details
validShot
func(angle float64, power float64) (float64, float64)validShot refuses what would poison a round and returns the shot as recorded. NaN and infinities pass every comparison, so they are refused by name. The power is quantized before it is checked (0.00001 would round to 0). The angle is brought into (-360, 360), so a huge one cannot overflow to NaN in the physics, and again after rounding (-359.99996 is -0, not -360).
- OID
- 08cda7…5c9f:152
validShot details
resolve
func(shot physics.Shot, holed bool) (physics.Shot, bool)resolve checks what the physics returned for a stroke: a path a read may print, and a ball that is a number. A hole is anyone's data.
- OID
- 08cda7…5c9f:153
resolve details
back
func(h *course.Simple, from physics.Vec2, shot physics.Shot, holed bool) physics.Shotback brings a ball that came to rest off the board (a leak in a hole's walls) back to from, where the shot started; the stroke counts, with no penalty. Every stroke golf plays or replays goes through it.
- OID
- 08cda7…5c9f:154
back details
stroke
func(e *golf.entry, h *course.Simple, r *golf.round, player .uverse.address, angle float64, power float64, tick int, weather []physics.Zone) (physics.Shot, bool)stroke resolves one shot into the round and reports whether it was holed.
- OID
- 08cda7…5c9f:155
stroke details
seat
func(e *golf.entry, m int, p string, best interface{...})seat puts a named player where their best puts them: on the hole's board, in its record if it tops it, and in the course ranking if they stand in it. Every finish does it, improved or not, so a player named since ranks.
- OID
- 08cda7…5c9f:156
seat details
Claim
func() intClaim ranks the caller's bests kept while they had no name: on the boards of the course's current holes, in both modes, and in the course ranking. It returns how many bests it seated, and refuses a caller with no gno.land name. It reads the course's holes only, so it costs the same for everyone.
- OID
- 08cda7…5c9f:157
Claim details
maxRoundStrokes
untyped bigintmaxRoundStrokes bounds a round's history (Round shows it); maxPath the path a hole may return for a stroke (an honest one: a few hundred points).
Value
(60 <untyped> bigint)
maxPath
untyped bigintmaxRoundStrokes bounds a round's history (Round shows it); maxPath the path a hole may return for a stroke (an honest one: a few hundred points).
Value
(512 <untyped> bigint)
q4
func(x float64) float64q4 rounds to the precision a shot is recorded at.
- OID
- 08cda7…5c9f:158
q4 details
maxTick
untyped bigintmaxTick bounds the third field of a shot: any timed piece turns in fewer.
Value
(1023 <untyped> bigint)
parseShot
func(s string) (float64, float64, int)parseShot reads "angle,power" or "angle,power,tick". The tick is where the timed pieces were when the player let go (0 if absent), clamped to 0..maxTick.
- OID
- 08cda7…5c9f:159
parseShot details
clampTick
func(t string, shot string) intclampTick reads a tick: an optional sign and digits, clamped to 0..maxTick, even past what an int holds.
- OID
- 08cda7…5c9f:160
clampTick details
roundOf
func(e *golf.entry, h *course.Simple, player .uverse.address) *golf.roundroundOf is the player's round under way on e, or a new one from the tee, not stored: its commit stores it if it does not finish it.
- OID
- 08cda7…5c9f:161
roundOf details
maxName
untyped bigintmaxName and maxNote bound a hole's name and a version's note.
Value
(40 <untyped> bigint)
maxNote
untyped bigintmaxName and maxNote bound a hole's name and a version's note.
Value
(140 <untyped> bigint)
cleanName
func(n string) stringcleanName keeps a hole's name to one short line of plain text (cleanText), with at least a letter or a digit in it.
- OID
- 08cda7…5c9f:162
cleanName details
cleanText
func(n string, max int) stringcleanText keeps an author's text to one line of plain text, at most max characters: no control, format (Cf: bidi, zero-width, tags) or nonspacing (Mn: stacked accents, variation selectors) characters, no blank-looking ones, nothing that ends a markdown table cell or opens a link, a tag, an HTML entity, a strikethrough, a mention or an email link.
- OID
- 08cda7…5c9f:163
cleanText details
maxSkin
untyped bigintmaxSkin bounds a skin's length.
Value
(24 <untyped> bigint)
cleanSkin
func(s string) stringcleanSkin keeps a skin to what it is meant to be: a short lower-case id.
- OID
- 08cda7…5c9f:164
cleanSkin details
owner
.uverse.addressValue
<gnolang.StringValue>
pending
.uverse.addressValue
<zero>
self
stringself is golf's own pkgpath, hub its gnoweb path: every link follows from them, so the same code serves under any namespace.
Value
"gno.land/r/nym-alexiscolin000/gnogolf/golf"
hub
stringself is golf's own pkgpath, hub its gnoweb path: every link follows from them, so the same code serves under any namespace.
Value
"/r/nym-alexiscolin000/gnogolf/golf"
officialPrefix
string// the namespace's realms, as "…/"
Value
"gno.land/r/nym-alexiscolin000/gnogolf/"
playURL
stringplayURL is the 3D client every page links to (SetPlayURL moves it).
Value
"https://gnogolf.xyz/"
successor
stringsuccessor is the realm that took this course over, "" until the owner names it, once (SetSuccessor).
Value
""
init.143
func()- OID
- 08cda7…5c9f:172
init.143 details
setUp
func(deployer .uverse.address, chainID string)setUp is init: the deployer owns the course, and community publishing starts closed. Only \`gno test\` (chain "dev") runs it with no signer: the owner stays "", which holds no power, and publishing starts open, since nobody there could open it.
- OID
- 08cda7…5c9f:174
setUp details
Owner
func() .uverse.address- OID
- 08cda7…5c9f:175
Owner details
Pending
func() .uverse.address- OID
- 08cda7…5c9f:176
Pending details
Successor
func() stringSuccessor is the realm that took this course over, "" if none.
- OID
- 08cda7…5c9f:177
Successor details
isOwner
func(caller .uverse.address) boolisOwner is the one owner check: a live role, held by the caller.
- OID
- 08cda7…5c9f:178
isOwner details
Transfer
func(to .uverse.address)Transfer offers the role to another address, which takes it with Accept. Offering it to the owner themselves cancels an offer.
- OID
- 08cda7…5c9f:179
Transfer details
Accept
func()Accept takes the role a Transfer offered the caller.
- OID
- 08cda7…5c9f:180
Accept details
Renounce
func()Renounce gives the role up for good: no owner, no offer, and none possible.
- OID
- 08cda7…5c9f:181
Renounce details
maxURL
untyped bigintmaxURL bounds the play link, maxPkgPath a successor's pkgpath.
Value
(100 <untyped> bigint)
maxPkgPath
untyped bigintmaxURL bounds the play link, maxPkgPath a successor's pkgpath.
Value
(100 <untyped> bigint)
SetPlayURL
func(url string)SetPlayURL moves the link every page gives to the 3D client. Only the owner can. url is https://, at most 100 of letters, digits and "-.\_~/:%", with no query or fragment: a hole's link adds "?cup=…&hole=…" to it.
- OID
- 08cda7…5c9f:182
SetPlayURL details
validURL
func(u string) bool- OID
- 08cda7…5c9f:183
validURL details
SetSuccessor
func(pkgpath string)SetSuccessor names the realm that takes this course over, once and for good: a pkgpath under gno.land/r/, not golf itself, with no "", "." or ".." segment. Only the owner can. It moves and blocks nothing: the pages and Holes say where the course went, and play goes on here. golf does not check the realm exists: check the path before sending.
- OID
- 08cda7…5c9f:184
SetSuccessor details
Hide
func(slot string, hide bool)Hide takes a community hole ("\<address>/\<slug>", every version) off the lists (the hub, Holes, the 3D game), for a scam or abuse in its name or note; hide=false puts it back. Only the owner can. Its data, rounds and page stay, Community still has it, and a new version stays hidden. A hole already as asked is left alone, with no event.
- OID
- 08cda7…5c9f:185
Hide details
publishing
boolpublishing is whether anyone can publish a community hole (PublishMine): closed at deploy (setUp), opened later without a redeploy.
Value
false
Publishing
func() boolPublishing is whether PublishMine is open.
- OID
- 08cda7…5c9f:187
Publishing details
SetPublishing
func(open bool)SetPublishing opens community publishing (PublishMine) or closes it again. Only the owner can. Closing stops new holes and versions only: every hole published stays playable and listed. Setting it as it is does nothing.
- OID
- 08cda7…5c9f:188
SetPublishing details
validPkgPath
func(p string) bool- OID
- 08cda7…5c9f:189
validPkgPath details
EventHolePublished
untyped string// hole, slot, sha, by, official ("true"/"false")
Value
"HolePublished"
EventHoleRetired
untyped string// hole, next
Value
"HoleRetired"
EventShot
untyped string// hole, player, strokes, mode, shot ("angle,power,tick" as recorded)
Value
"Shot"
EventHoled
untyped string// hole, player, strokes, mode, shots (the round's)
Value
"Holed"
EventRoundReset
untyped string// hole, player
Value
"RoundReset"
EventOwnershipOffered
untyped string// owner, to
Value
"OwnershipOffered"
EventOwnershipOfferCancelled
untyped string// owner
Value
"OwnershipOfferCancelled"
EventOwnershipTransfer
untyped string// from, to
Value
"OwnershipTransfer"
EventOwnershipRenounced
untyped string// from
Value
"OwnershipRenounced"
EventPlayURLSet
untyped string// url
Value
"PlayURLSet"
EventSuccessorSet
untyped string// successor
Value
"SuccessorSet"
EventPublishingSet
untyped string// open ("true"/"false")
Value
"PublishingSet"
wearRunes
untyped string// pristine grass blank: a shot's dots stand out on it
Value
" :;x%"
wearLight
untyped bigintwearRunes draw a cell's wear: none, then up to wearLight, wearWorn and wearGroove balls come to rest there, and past.
Value
(2 <untyped> bigint)
wearWorn
untyped bigintwearRunes draw a cell's wear: none, then up to wearLight, wearWorn and wearGroove balls come to rest there, and past.
Value
(6 <untyped> bigint)
wearGroove
untyped bigintwearRunes draw a cell's wear: none, then up to wearLight, wearWorn and wearGroove balls come to rest there, and past.
Value
(14 <untyped> bigint)
maxTunnels
untyped bigintmaxTunnels is how many tunnels the board numbers, 1 to 9.
Value
(9 <untyped> bigint)
markWall
runeValue
35
markPost
runeValue
48
markCup
rune// not O: in gnoweb's font O and the post's 0 look alike
Value
85
markTee
runeValue
42
Render
func(path string) stringRender is the game as text: gnoweb draws the board and submits the shot. Paths: "" the hub; "\<world>" a cup's holes; "\<address>" the holes an address published; "\<hole>" a hole's page, "\<hole>/\<address>" the same with that player's ball, "\<hole>/data" a version's provenance and data. \<hole> is a version's id or an alias. A query string ("?…") is ignored.
- OID
- 08cda7…5c9f:190
Render details
noSuch
func(path string) stringnoSuch is the page for a path that is no hole, cup or address.
- OID
- 08cda7…5c9f:192
noSuch details
lookup
func(id string) *golf.entrylookup is readHole that answers nil for no hole.
- OID
- 08cda7…5c9f:193
lookup details
playLink
func(e *golf.entry) stringplayLink is the 3D client's link to this hole: a current course hole by cup and order, any other by its id, which no newer version can take.
- OID
- 08cda7…5c9f:194
playLink details
cupName
func(w string) stringcupName is how a world is called on the page.
- OID
- 08cda7…5c9f:195
cupName details
who
func(addr string) stringwho is a player as a link to their gno.land profile.
- OID
- 08cda7…5c9f:196
who details
renderHub
func() string- OID
- 08cda7…5c9f:197
renderHub details
moved
func() stringmoved is the banner a course taken over shows on every page.
- OID
- 08cda7…5c9f:198
moved details
renderCup
func(world string) stringrenderCup is a cup's page: its current holes, in order.
- OID
- 08cda7…5c9f:199
renderCup details
renderAuthor
func(a .uverse.address) stringrenderAuthor is the holes an address published, as their current versions.
- OID
- 08cda7…5c9f:200
renderAuthor details
bestCell
func(e *golf.entry, names map[string]string) stringbestCell is a hole's records, assisted then pro, for a table cell. names caches holders: r/sys/users is read once a player, not once a record.
- OID
- 08cda7…5c9f:201
bestCell details
weatherNote
func(f course.Forecast) stringweatherNote is the hole's weather now (f, the forecast of this period) and how long it lasts, on a hole's own page.
- OID
- 08cda7…5c9f:202
weatherNote details
noAdmin
func() stringnoAdmin states who can change what, the owner's own powers included.
- OID
- 08cda7…5c9f:203
noAdmin details
source
func(e *golf.entry) stringsource links a hole's data page: read it before trusting it with a round.
- OID
- 08cda7…5c9f:204
source details
md
func(label string, href string) string- OID
- 08cda7…5c9f:205
md details
vsPar
func(d int) stringvsPar is a score against par: "even", "+3", "-2" (ufmt has no %+d).
- OID
- 08cda7…5c9f:206
vsPar details
flatRolls
untyped stringflatRolls is how far a shot rolls on flat grass (a tee shot's Kick, the usual friction).
Value
"On flat grass a power of 10 rolls about 40, a 5 about 15."
renderHole
func(e *golf.entry, h *course.Simple, focus .uverse.address) string- OID
- 08cda7…5c9f:207
renderHole details
roundSummary
func(e *golf.entry, p .uverse.address, r *golf.round) stringroundSummary is how a player stands on the hole: their round under way, if any, and their best in each mode, with where it puts them on the hole's board, or why nowhere. A holed round is not kept: its best is.
- OID
- 08cda7…5c9f:208
roundSummary details
shotsOf
func(shots string) stringshotsOf is a round's shots for a page: golf's own "%.4f,%.4f,%d", digits and punctuation only.
- OID
- 08cda7…5c9f:209
shotsOf details
renderData
func(e *golf.entry) stringrenderData is a data version's page: where it came from, its versions, and its data, which is all the hole there is.
- OID
- 08cda7…5c9f:210
renderData details
board
func(e *golf.entry, h *course.Simple, f *physics.Field, mine *golf.round, now course.Forecast) stringboard is the version's board in mode m: boardKey(best, player) -> player, the named players' bests, fewest strokes first.
- OID
- 08cda7…5c9f:211
board details
drawZone
func(g [][]int32, z *physics.Zone, m int32)drawZone marks the cells whose centre the zone holds, as the physics sees it (physics.Zone.Contains): a polygon's row from where the centre line crosses its edges, an ellipse's as the run the physics' test finds from its middle.
- OID
- 08cda7…5c9f:212
drawZone details
boxCells
func(lo float64, hi float64, n int) (int, int)boxCells is the cells from int(lo) to int(hi), within 0..n, whose centre lies in \[lo, hi): the cells the physics' box test takes.
- OID
- 08cda7…5c9f:213
boxCells details
cellAt
func(c float64, lo int, hi int) intcellAt is the first cell in \[lo, hi), lo >= 0, whose centre is at or past c (!(x+0.5 \< c), as the physics compares), hi if none: ceil(c-0.5).
- OID
- 08cda7…5c9f:214
cellAt details
firstCell
func(lo int, hi int, ok func(...)) intfirstCell is the first x in \[lo, hi) where ok turns true, hi if it never does: ok is false up to some x, and true from there.
- OID
- 08cda7…5c9f:215
firstCell details
fillRow
func(row []int32, from int, to int, m int32)- OID
- 08cda7…5c9f:216
fillRow details
span
func(lo float64, hi float64, n int) (int, int)span is the cells from int(lo) to int(hi), within 0..n.
- OID
- 08cda7…5c9f:217
span details
maxBoardWork
untyped bigintmaxBoardWork bounds a board's drawing, in thousands of gas (boardWork): past it the page does not draw, far under the 3e9 a query may use.
Value
(600000 <untyped> bigint)
boardWork
func(f *physics.Field, h *course.Simple) intboardWork estimates board's cost in thousands of gas, with measured weights: a board cell; a cell and a polygon edge per row of a zone's box (every edge counted as crossing, as a zigzag's do); a step along a wall; a cell of a post's box.
- OID
- 08cda7…5c9f:218
boardWork details
key
func(b string, walls string) stringkey names the board's fixed marks it shows (tee and cup always), with the skins of the walls drawn \`#\`.
- OID
- 08cda7…5c9f:219
key details
legend
func(f *physics.Field) (string, string)legend names the pieces the hole gave a skin (a slope with the way it falls), and the skins of its \`#\` walls.
- OID
- 08cda7…5c9f:220
legend details
mark
func(m int32, def int32) int32mark counts a ball come to rest in wear cell i.
- OID
- 08cda7…5c9f:221
mark details
wearRune
func(wear []int, x int, y int) int32wearRune takes wear-cell coordinates.
- OID
- 08cda7…5c9f:222
wearRune details
trace
func(g [][]int32, s physics.Segment, c int32)trace draws a wall as points every half unit, put inlined: a board has thousands.
- OID
- 08cda7…5c9f:223
trace details
fill
func(g [][]int32, c physics.Circle, r int32)fill draws a post: the cells whose centre is within its radius. LenCmp skips Len's software square root.
- OID
- 08cda7…5c9f:224
fill details
put
func(g [][]int32, p physics.Vec2, c int32)- OID
- 08cda7…5c9f:225
put details
short
func(addr string) string- OID
- 08cda7…5c9f:226
short details
blankUnreachable
func(g [][]int32, wall [][]int32, f *physics.Field, seeds []physics.Vec2)blankUnreachable clears the cells no ball can reach: a flood fill from the tee, the cup and where tunnels and hazards put the ball, stopped by walls.
- OID
- 08cda7…5c9f:227
blankUnreachable details
race
func(e *golf.entry, p string, label string) stringrace is the 3D game's dare link (by=): this hole against p's best's ghost.
- OID
- 08cda7…5c9f:228
race details
byName
func(addr string) stringbyName is a player by their gno.land name when they have one.
- OID
- 08cda7…5c9f:229
byName details
count
func(n int, what string) stringcount is n things, said right for one.
- OID
- 08cda7…5c9f:230
count details
HoleState
func(hole string) stringHoleState is the hole as JSON for a client: geometry, skins (names the client looks up), weather and wear, all it needs to draw the hole and aim. hole is a version's id or an alias; "hole" in the answer is always the version's id, the one to write with, with its "slot" and "v", and an archived one's "next". A shot's path (Round, Simulate\*) is the flight the chain computed: replay it, never re-simulate. Points far apart are a tunnel: do not interpolate.
- OID
- 08cda7…5c9f:231
HoleState details
roundJSON
func(e *golf.entry, h *course.Simple, player string, r *golf.round) stringroundJSON is one player's round: ball rounded, rest exact (for SimulateFrom) and the last stroke replayed: rounds store shots, not paths.
- OID
- 08cda7…5c9f:233
roundJSON details
lastShot
func(h *course.Simple, r *golf.round, fc course.Forecast) physics.ShotlastShot replays a round's last stroke, read-only, with its stroke number, tick and weather (fc, its period's forecast): the same flight, less the wear. Empty before a first one.
- OID
- 08cda7…5c9f:234
lastShot details
pathJSON
func(ps []physics.Vec2) stringpathJSON is a shot's path points, comma separated.
- OID
- 08cda7…5c9f:235
pathJSON details
airOf
func(s physics.Shot) stringairOf is a shot's air flags, one character per path point: "0001100…".
- OID
- 08cda7…5c9f:236
airOf details
Round
func(hole string, player .uverse.address) stringRound is one player's round under way on a hole with its last stroke's path, or null if they have none: never started, holed (its best is kept: Ghost) or Reset. It costs one stroke of gas.
- OID
- 08cda7…5c9f:237
Round details
sep
func(i int) string- OID
- 08cda7…5c9f:238
sep details
jnum
func(v float64) stringjnum is a number with 3 decimals, the bytes of ufmt's "%.3f" at a fraction of its gas. NaN and Inf, not JSON, print 0. Below 1e12, v\*1000 is within 1.2e-4 of the exact decimal, so its integer part decides the rounding unless the fraction is within 1e-3 of a half: those, and huge numbers, go to strconv, which is exact.
- OID
- 08cda7…5c9f:239
jnum details
jexact
func(v physics.Vec2) stringjexact is a point exactly, as the shortest decimals that read back as the same float64: what a client hands back to SimulateFrom.
- OID
- 08cda7…5c9f:240
jexact details
versionJSON
untyped stringversionJSON opens every object a read returns.
Value
"\"version\":1"
jvec
func(v physics.Vec2) string- OID
- 08cda7…5c9f:241
jvec details
jstr
func(s string) stringjstr quotes an author's string so it cannot break out of its JSON. Every byte below 0x20 is escaped: one in one hole's name would make Holes() invalid JSON for every client.
- OID
- 08cda7…5c9f:242
jstr details
Holes
func() stringHoles lists at most maxListed holes for a client's menu, as listed orders them: the course's current holes, its latest archived versions, then community holes, newest first, perAuthor an address, none hidden (the rest are in Community). official marks the course's holes, the only ones in a cup and the course ranking; next is the version that replaced a hole, slot its alias, play the 3D client's link, successor the realm that took the course over ("" if none). It decodes nothing.
- OID
- 08cda7…5c9f:243
Holes details
holeRow
func(e *golf.entry) stringholeRow is one hole as Holes and Community list it.
- OID
- 08cda7…5c9f:244
holeRow details
Community
func(after string, limit int) stringCommunity is a page of every community hole, every version of each, by id: all that Holes leaves out. It is paged like Records.
- OID
- 08cda7…5c9f:245
Community details
perAuthor
untyped bigintperAuthor is the most published holes of one address Holes and the hub list: one address publishing a hundred cannot push everyone else's out.
Value
(3 <untyped> bigint)
listed
func() []*golf.entrylisted is the holes in list order, at most maxListed: every current course hole in course order; then, if minCommunity places stay free, up to maxArchived archived course versions, latest archived first; then, in the room left, the newest shown community holes (current, not hidden) among each author's perAuthor newest, by block height then alias, last first. An author fills perAuthor rows at most, however many holes they publish. It reads about what it lists: authors latest first, perAuthor keys each, until an author's latest is older than every row kept (room+1 authors at most). Hidden holes have no byAuthor row: nothing hidden is walked.
- OID
- 08cda7…5c9f:246
listed details
authorRows
untyped stringauthorRows is past the last of byAuthor's author rows ("\<height> \<address>") and before its first hole ("g1…"): no key is ":".
Value
":"
maxArchived
untyped bigintmaxArchived bounds the archived course versions Holes and the hub list, and minCommunity is the room they leave for community holes.
Value
(20 <untyped> bigint)
minCommunity
untyped bigintmaxArchived bounds the archived course versions Holes and the hub list, and minCommunity is the room they leave for community holes.
Value
(20 <untyped> bigint)
SimulateFrom
func(hole string, ballX float64, ballY float64, shot string, stroke int, period int64) stringSimulateFrom previews one shot, read-only: from an exact ball (a "rest" answered before), shot "angle,power,tick", its stroke number (0 is the first; timed and pulse holes change with it) and any period not ahead. It is what PlayRoundAt would play, for one shot's gas. As a vm/qeval query it needs no transaction or wallet: a client animates a shot the instant it is released.
- OID
- 08cda7…5c9f:247
SimulateFrom details
validStroke
func(stroke int)- OID
- 08cda7…5c9f:248
validStroke details
onBoard
func(h *course.Simple, x float64, y float64) physics.Vec2onBoard refuses a ball off the board (or NaN): no round leaves one there.
- OID
- 08cda7…5c9f:249
onBoard details
shotJSON
func(shot physics.Shot) stringshotJSON is a shot's path, air, cause, work (Shot.Work, which a client adds up as a commit does) and exact resting point.
- OID
- 08cda7…5c9f:250
shotJSON details
SimulateRound
func(hole string, shots string) stringSimulateRound replays a shot list from the tee, read-only, and returns its last shot and stroke count: what PlayRound would record, refusals included. Continue from an exact "rest" (SimulateFrom): rounded points are for drawing.
- OID
- 08cda7…5c9f:251
SimulateRound details
SimulateRoundAt
func(hole string, shots string, period int64) stringSimulateRoundAt is SimulateRound in a period's weather, the current one or the one before, as a round's first stroke: it agrees with PlayRoundAt.
- OID
- 08cda7…5c9f:252
SimulateRoundAt details
SimulateRoundIn
func(hole string, shots string, period int64) stringSimulateRoundIn is SimulateRound in any period gone by, to check a recorded round as the chain played it. Weather still to come is refused.
- OID
- 08cda7…5c9f:253
SimulateRoundIn details
SimulateCommit
func(hole string, ballX float64, ballY float64, stroke int, shots string, period int64) stringSimulateCommit previews the next PlayRoundAt (or PlayRoundPro) commit, read-only: shots from the exact ball ("rest") at stroke number stroke (0 is the first) in period's weather. It refuses what that commit would (too much work, too many strokes, a weather over), so a client checks every commit before it signs any. JSON as SimulateRound; strokes counts after the commit.
- OID
- 08cda7…5c9f:254
SimulateCommit details
simulateRound
func(hole string, from *physics.Vec2, strokes int, shots string, period int64) stringsimulateRound is the SimulateRound\* and SimulateCommit replay: from nil is the tee, and the first shot is stroke number strokes.
- OID
- 08cda7…5c9f:255
simulateRound details
boardJSON
func(h *course.Simple) string- OID
- 08cda7…5c9f:256
boardJSON details
wallsJSON
func(ws []physics.Wall) string- OID
- 08cda7…5c9f:257
wallsJSON details
postsJSON
func(ps []physics.Post) string- OID
- 08cda7…5c9f:258
postsJSON details
zonesJSON
func(zs []physics.Zone, flags bool) stringzonesJSON is a hole's zones, or the weather's (forecastJSON: no flags). With flags, "air" and "capped" are printed only when true.
- OID
- 08cda7…5c9f:259
zonesJSON details
timingJSON
func(every int, on int, phase int) stringtimingJSON is a timed piece's clock (a tram, a storm's gusts); nothing for an untimed one.
- OID
- 08cda7…5c9f:260
timingJSON details
polyJSON
func(z *physics.Zone) stringpolyJSON is a polygon zone's outline, and whether it is the outside of it; nothing for the usual rectangle or ellipse.
- OID
- 08cda7…5c9f:261
polyJSON details
Extras
func(hole string, stroke int) stringExtras is what a timed hole adds at one stroke of a round (0 is the first), to draw over HoleState's field. Empty for other holes.
- OID
- 08cda7…5c9f:262
Extras details
Leaderboard
func(mode string) stringLeaderboard is a mode's course-wide top ten ("assisted" or "pro"): named players' bests on the current course holes, summed; most holes, then the best score against par (strokes - par), then the first there. Its cost does not grow with players.
- OID
- 08cda7…5c9f:263
Leaderboard details
eachRanked
func(m int, fn func(...))eachRanked walks a mode's top ten: the first named players of its ranking, with their names. A name deleted since is skipped, not shown.
- OID
- 08cda7…5c9f:264
eachRanked details
maxWalked
untyped bigintmaxWalked is the most rows a top ten walks, skipped names included.
Value
(40 <untyped> bigint)
strokesRow
func(p string, name string, strokes int) stringstrokesRow and standingRow are a player's best or standing row; name is "" on the reads that resolve no names. A standing's par is its holes' pars summed: strokes - par is its score against par.
- OID
- 08cda7…5c9f:265
strokesRow details
standingRow
func(p string, name string, r *golf.row) string- OID
- 08cda7…5c9f:266
standingRow details
standingFields
func(r *golf.row) stringstandingFields is a standing's numbers: holes, strokes and par.
- OID
- 08cda7…5c9f:267
standingFields details
nameField
func(name string) string- OID
- 08cda7…5c9f:268
nameField details
Rank
func(mode string, player .uverse.address) stringRank is a player's place in a mode's course ranking, with their standing: "rank" 1 is the top, out of "of"; 0 if unnamed or no current course hole finished. A name deleted since keeps its place until its next change, so a rank may be that many too low.
- OID
- 08cda7…5c9f:269
Rank details
CourseLeaderboard
func(mode string, offset int, limit int) stringCourseLeaderboard is a page of a mode's course ranking, paged like HoleLeaderboard. holes is the course's current holes, players how many the ranking holds.
- OID
- 08cda7…5c9f:270
CourseLeaderboard details
Ghost
func(hole string, mode string, player .uverse.address) stringGhost is a player's best round on a hole in a mode, named or not, with its height (the first to a score ranks first), period and shots, or null: what a duel races. It replays in its own weather (SimulateRoundIn for the first stroke, then SimulateFrom from each rest).
- OID
- 08cda7…5c9f:271
Ghost details
HoleRank
func(hole string, mode string, player .uverse.address) stringHoleRank is a player's place on a hole's board in a mode, with their best, as Rank: 0 if unnamed or no finish there.
- OID
- 08cda7…5c9f:272
HoleRank details
maxListed
untyped bigintmaxListed bounds Holes() and the hub: anyone can add a hole.
Value
(120 <untyped> bigint)
HoleLeaderboard
func(hole string, mode string, offset int, limit int) stringHoleLeaderboard is a page of a hole's board in a mode: named players' bests, fewest strokes then first there, from rank offset+1 (clamped to 0..players), at most limit rows (1..100). players is the named players, finished anyone who finished; next is the next offset, 0 at the end. A name deleted since is skipped, so a page may hold fewer rows. A page reads its own rows only.
- OID
- 08cda7…5c9f:273
HoleLeaderboard details
pageMax
untyped bigintpageMax is the most rows one page of a read returns.
Value
(100 <untyped> bigint)
clampLimit
func(n int) intclampLimit keeps a page's size to 1..pageMax.
- OID
- 08cda7…5c9f:274
clampLimit details
maxFriends
untyped bigintmaxFriends bounds the addresses one Bests or Standings read takes.
Value
(50 <untyped> bigint)
friends
func(list string) []stringfriends splits a comma-separated list of addresses: each valid one once, at most maxFriends. Junk and repeats are skipped and use up nothing.
- OID
- 08cda7…5c9f:275
friends details
Bests
func(hole string, mode string, players string) stringBests is the best finished round on one hole, in a mode, of each of the given players (comma-separated addresses, named or not): a board of friends, where no stranger and no bot can push anyone off.
- OID
- 08cda7…5c9f:276
Bests details
Standings
func(mode string, players string) stringStandings is each given player's course-wide standing in a mode: how many of the course's current holes they finished, in how many strokes, and those holes' pars summed.
- OID
- 08cda7…5c9f:277
Standings details
Records
func(hole string, mode string, after string, limit int) stringRecords is a page of every player's best on a hole in a mode, named or not, with the height that ranks it before a later tie: all a successor needs to carry the boards over in their order. The paged reads (Records, Players, Community) walk everything by key: after is the last key of the page before ("" for the first), limit is clamped to 1..100, next is the after of the next page ("" at the end).
- OID
- 08cda7…5c9f:278
Records details
Players
func(mode string, after string, limit int) stringPlayers is a page of every course standing in a mode, named or not: its holes, strokes and par (all the ranking's key reads) and the height of the finish that last improved it (the tie-break), paged like Records.
- OID
- 08cda7…5c9f:279
Players details
walk
typewalk is a tree's Iterate: what page reads.
Value
golf.walk
bpWalk
func(t *v0.BPTree) golf.walk- OID
- 08cda7…5c9f:280
bpWalk details
page
func(t golf.walk, after string, limit int, fn func(...)) stringpage walks up to limit entries of t after the key after, and returns the key to continue from, "" at the end.
- OID
- 08cda7…5c9f:281
page details
PeriodSeconds
untyped bigintPeriodSeconds is how long one weather lasts.
Value
(300 <untyped> bigint)
Period
func() int64Period is the weather period of the chain's current block time.
- OID
- 08cda7…5c9f:282
Period details
weatherOf
func(e *golf.entry, h *course.Simple, period int64) course.ForecastweatherOf is the hole's weather in a period: seeded by its id, so each version of a slot has weather of its own.
- OID
- 08cda7…5c9f:284
weatherOf details
forecastJSON
func(head string, f course.Forecast) stringforecastJSON is a forecast as an object, head its first fields if any (as \`"version":1,\`). Zones' air and capped are not printed: only the wind has them, always.
- OID
- 08cda7…5c9f:285
forecastJSON details
Weather
func(hole string, period int64) stringWeather is a hole's weather in a period, as JSON: the zones a client draws and the chain plays under. Its "gas" is what a commit there spends before its first shot (decoding and forecast), counted against the commit's budget: a client adds it to its shots' estimate. A future period panics.
- OID
- 08cda7…5c9f:286
Weather details
notAhead
func(period int64)notAhead refuses a period still to come. It is no secret (ForecastFor is pure): this only keeps reads to the weather a round can be played in.
- OID
- 08cda7…5c9f:287
notAhead details
notOver
func(period int64)notOver refuses a round's weather two periods or more behind: a round left for later cannot be finished days on in the weather it picked.
- OID
- 08cda7…5c9f:288
notOver details
playablePeriod
func(period int64)playablePeriod checks the period a round starts under: the current one, or the one just gone, for a round that ran over the turn of the period.
- OID
- 08cda7…5c9f:289