Documentation
¶
Index ¶
- func BoardToString(board *[8][8]Tile) string
- func ClearLegalMoves(board *[8][8]Tile, legalMoves []Move)
- func EndOfTurn(board *[8][8]Tile, legalMoves []Move, currentPlayer Tile) ([]Move, Tile, bool)
- func GetStartingBoard() *[8][8]Tile
- func PlaceTile(move Move, board *[8][8]Tile, currentPlayer Tile)
- func PlayerString(player Tile) string
- func PropagateLegalMoves(board *[8][8]Tile, legalMoves []Move)
- type Move
- type Tile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BoardToString ¶
func ClearLegalMoves ¶
func GetStartingBoard ¶
func GetStartingBoard() *[8][8]Tile
func PlaceTile ¶
PlaceTile changes state of Tile of board at move to currentPlayer, and calls flipWalk to "flip" all opposite Tiles to the state of currentPlayer, in accordance with the game rules (https://wikipedia.org/wiki/Reversi#Rules).
func PlayerString ¶
func PropagateLegalMoves ¶
Types ¶
type Move ¶
type Move struct {
// contains filtered or unexported fields
}
func CalcLegalMoves ¶
Need to document
type Tile ¶
type Tile int
func CalcWinner ¶
CalcWinner counts the tiles of each colour on the board and determines who has the most pieces. Returns Empty if scores are the same, otherwise returns the color of the winner.
func OppositePlayer ¶
Click to show internal directories.
Click to hide internal directories.