cols
untyped bigintValue
(7 <untyped> bigint)
rows
untyped bigintValue
(6 <untyped> bigint)
empty
untyped bigintcell values
Value
(0 <untyped> bigint)
red
untyped bigint// π΄ game creator (caller of NewGame)
Value
(1 <untyped> bigint)
yel
untyped bigint// π‘ opponent
Value
(2 <untyped> bigint)
Game
typeGame holds the full state of one Connect Four match. board is indexed board\[row]\[col]; row 0 is the BOTTOM row. It carries no ID field: the id belongs to the store, which hands it back on lookup and iteration.
Value
v1.Game
games
*v0.Storegames assigns the game ids. v1 kept its own nextID plus an idKey() that zero-padded to width 12, which stopped ordering the Render list past 10^12.
- OID
- 0596a2β¦747c:4
games details
NewGame
func(opponent .uverse.address) int64NewGame creates a match between the caller (π΄) and opponent (π‘). Returns the new game id.
- OID
- 0596a2β¦747c:7
NewGame details
getGame
func(id int64) (*v1.Game, .uverse.error)- OID
- 0596a2β¦747c:9
getGame details
Drop
func(gameID int64, column int)Drop places the caller's disc into the given column (0-6). Enforces turn order by caller, rejects full columns, and detects a 4-in-a-row win or a draw.
- OID
- 0596a2β¦747c:10
Drop details
full
func(b *[6][7]int) bool- OID
- 0596a2β¦747c:11
full details
wins
func(b *[6][7]int, r int, c int, p int) boolwins checks whether the disc just placed at (r,c) for player p completes a run of 4 in any of the four directions.
- OID
- 0596a2β¦747c:12
wins details
run
func(b *[6][7]int, r int, c int, dr int, dc int, p int) int- OID
- 0596a2β¦747c:13
run details
glyph
func(v int) string- OID
- 0596a2β¦747c:14
glyph details
Render
func(path string) stringRender draws the board with π΄π‘Β· and shows whose turn / the winner. path "" lists all games; path "\<id>" shows a single board.
- OID
- 0596a2β¦747c:15
Render details
renderList
func() string- OID
- 0596a2β¦747c:16
renderList details
renderGame
func(id v0.ID, g *v1.Game) string- OID
- 0596a2β¦747c:17