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

# README

Go-stratego

Go-stratego is a Go implementation of the board game Stratego.

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

Quibbble Stratego

Usage

To play a game create a new Stratego instance:

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

To reoganize your board and switch units before the game starts do the following action:

err := game.Do(&bg.BoardGameAction{
    Team: "TeamA",
    ActionType: "SwitchUnits",
    MoreDetails: SwitchUnitsActionDetails{
        UnitRow: 0,
        UnitColumn: 0,
        SwitchUnitRow: 1,
        SwitchUnitColumn: 0,
    },
})

To move a unit do the following action:

err := game.Do(&bg.BoardGameAction{
    Team: "TeamA",
    ActionType: "MoveUnit",
    MoreDetails: MoveUnitActionDetails{
        UnitRow: 0,
        UnitColumn: 0,
        MoveRow: 1,
        MoveColumn: 0,
    },
})

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

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

# Functions

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Constants

Action types.
Action types.
Action types.
No description provided by the author
No description provided by the author
normal Stratego.
8x8 quick play Stratego.

# Variables

UnitTyes ordered in ascending order by battle winner.

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
StategoSnapshotData is the game data unique to Statego.
No description provided by the author
No description provided by the author
StrategoMoreOptions are the additional options for creating a game of Stratego.
No description provided by the author
No description provided by the author