game

package
v0.0.0-...-5fb3847 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	N     = 8
	Empty = "☐"
)

Variables

This section is empty.

Functions

func IsLower

func IsLower(c string) bool

func IsUpper

func IsUpper(c string) bool

Types

type Board

type Board struct {
	Matrix [8][8]string
	// contains filtered or unexported fields
}

func (*Board) AreDifferentColor

func (b *Board) AreDifferentColor(firstX, firstY, secondX, secondY int) bool

func (*Board) Clone

func (b *Board) Clone() Board

func (*Board) DoesOpponentDiagonalBeatField

func (b *Board) DoesOpponentDiagonalBeatField(row, column int) bool

func (*Board) DoesOpponentHorseBeatField

func (b *Board) DoesOpponentHorseBeatField(row, column int) bool

func (*Board) DoesOpponentKingBeatField

func (b *Board) DoesOpponentKingBeatField(row, column int) bool

func (*Board) DoesOpponentLineBeatField

func (b *Board) DoesOpponentLineBeatField(row, column int) bool

func (*Board) DoesOpponentPawnBeatField

func (b *Board) DoesOpponentPawnBeatField(row, column int) bool

func (*Board) FillEmptyMatrix

func (b *Board) FillEmptyMatrix()

func (*Board) GetAllHorseFields

func (b *Board) GetAllHorseFields(row, column int) *list.List

func (*Board) GetAllKingFields

func (b *Board) GetAllKingFields(row, column int) *list.List

func (*Board) GetAllPossibleMoves

func (b *Board) GetAllPossibleMoves() *list.List

func (*Board) GetBishopPossibleMoves

func (b *Board) GetBishopPossibleMoves(row int, column int) *list.List

func (*Board) GetBlackIndexes

func (b *Board) GetBlackIndexes() *list.List

func (*Board) GetBlackPawnPossibleMoves

func (b *Board) GetBlackPawnPossibleMoves(row int, column int) *list.List

func (*Board) GetChildBoards

func (b *Board) GetChildBoards() *list.List

func (*Board) GetCurrentPossibleMoves

func (b *Board) GetCurrentPossibleMoves(x int, y int) *list.List

func (*Board) GetDiagonalDownLeftPossibleMoves

func (b *Board) GetDiagonalDownLeftPossibleMoves(row, column int) *list.List

func (*Board) GetDiagonalDownRightPossibleMoves

func (b *Board) GetDiagonalDownRightPossibleMoves(row, column int) *list.List

func (*Board) GetDiagonalUpLeftPossibleMoves

func (b *Board) GetDiagonalUpLeftPossibleMoves(row, column int) *list.List

func (*Board) GetDiagonalUpRightPossibleMoves

func (b *Board) GetDiagonalUpRightPossibleMoves(row, column int) *list.List

func (*Board) GetDownPossibleMoves

func (b *Board) GetDownPossibleMoves(row, column int) *list.List

func (*Board) GetFillValue

func (b *Board) GetFillValue(c string, isWhite bool) string

func (*Board) GetHorsePossibleMoves

func (b *Board) GetHorsePossibleMoves(row int, column int) *list.List

func (*Board) GetKingPossibleMoves

func (b *Board) GetKingPossibleMoves(row int, column int) *list.List

func (*Board) GetLeftPossibleMoves

func (b *Board) GetLeftPossibleMoves(row, column int) *list.List

func (*Board) GetPawnPossibleMoves

func (b *Board) GetPawnPossibleMoves(row int, column int) *list.List

func (*Board) GetPieceValue

func (b *Board) GetPieceValue(c string) int

func (*Board) GetPrintValue

func (b *Board) GetPrintValue(c string) string

func (*Board) GetQueenPossibleMoves

func (b *Board) GetQueenPossibleMoves(row int, column int) *list.List

func (*Board) GetRightPossibleMoves

func (b *Board) GetRightPossibleMoves(row, column int) *list.List

func (*Board) GetRockPossibleMoves

func (b *Board) GetRockPossibleMoves(row int, column int) *list.List

func (*Board) GetUpPossibleMoves

func (b *Board) GetUpPossibleMoves(row, column int) *list.List

func (*Board) GetValue

func (b *Board) GetValue() int

func (*Board) GetWhiteIndexes

func (b *Board) GetWhiteIndexes() *list.List

func (*Board) GetWhitePawnPossibleMoves

func (b *Board) GetWhitePawnPossibleMoves(row int, column int) *list.List

func (*Board) IsFinished

func (b *Board) IsFinished() bool

func (*Board) IsInBoard

func (b *Board) IsInBoard(row, column int) bool

func (*Board) IsOpponentBeatField

func (b *Board) IsOpponentBeatField(row, column int) bool

func (*Board) New

func (b *Board) New(areWeWithWhite bool)

func (*Board) PerformMove

func (b *Board) PerformMove(move Move)

func (*Board) PrintMatrix

func (b *Board) PrintMatrix()

type Game

type Game struct {
	// contains filtered or unexported fields
}

func (*Game) FindMax

func (g *Game) FindMax(node Node, counter int) TupleBoard

func (*Game) FindMin

func (g *Game) FindMin(node Node, counter int) TupleBoard

func (*Game) GetAtIndex

func (g *Game) GetAtIndex(list *list.List, index int) TupleBoardValue

func (*Game) Max

func (g *Game) Max(list *list.List) int

func (*Game) Min

func (g *Game) Min(list *list.List) int

func (*Game) New

func (g *Game) New(currentNode Node, maxCount int)

func (*Game) PlayGameWithAI

func (g *Game) PlayGameWithAI()

func (*Game) PlayerPlay

func (g *Game) PlayerPlay()

type Move

type Move struct {
	// contains filtered or unexported fields
}

func (*Move) New

func (m *Move) New(startX int, startY int, endX int, endY int)

type Node

type Node struct {
	// contains filtered or unexported fields
}

func (*Node) New

func (n *Node) New(board Board, currentValue int)

type Tuple

type Tuple struct {
	// contains filtered or unexported fields
}

func (*Tuple) New

func (b *Tuple) New(x, y int)

type TupleBoard

type TupleBoard struct {
	// contains filtered or unexported fields
}

type TupleBoardValue

type TupleBoardValue struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL