connect4

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AI

type AI struct {
	State connect4
	Turn  bool
}

AI uses vulpes to play Connect Four

func NewAI

func NewAI(board [6][7]int) *AI

NewAI returns a Connect4 AI from a given board

func NewEmptyAI

func NewEmptyAI() *AI

NewEmptyAI returns a Connect4 AI from an empty board

func (*AI) MakeMove

func (C *AI) MakeMove(depth uint) float64

MakeMove takes the best move (searching to the given depth) and plays it, updating State. If the game is over, it returns the ending state, and makes no changes to State.

func (*AI) String

func (C *AI) String() string

String returns a string representation of the game board

Jump to

Keyboard shortcuts

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