Categorygithub.com/quibbble/go-connect4
modulepackage
1.0.4
Repository: https://github.com/quibbble/go-connect4.git
Documentation: pkg.go.dev

# README

Go-connect4

Go-connect4 is a Go implementation of the board game Connect4.

Check out connect4.quibbble.com to play a live version of this game. This website utilizes connect4 frontend code, go-connect4 game logic, and go-quibbble server logic.

Quibbble Connect4

Usage

To play a game create a new Connect4 instance:

builder := Builder{}
game, err := builder.Create(&bg.BoardGameOptions{
    Teams: []string{"TeamA", "TeamB"}, // must contain at least 2 and at most 3 teams
})

To place a disk do the following action:

err := game.Do(&bg.BoardGameAction{
    Team: "TeamA",
    ActionType: "PlaceDisk",
    MoreDetails: PlaceDiskActionDetails{
        Column: 0, // columns 0 to 6 are valid
    },
})

To get the current state of the game call the following:

snapshot, err := game.GetSnapshot("TeamA")

# Functions

No description provided by the author

# Constants

ActionPlaceDisk allows players place a disk in a column.

# Structs

No description provided by the author
No description provided by the author
Connect4SnapshotData is the game data unique to Connect4.
PlaceDiskActionDetails is the action details for placing a disk in the desired column of the board.