Beispiel #1
0
func main() {
	State := TicTacToe{[9]int{0, 0, 0, 0, 0, 0, 0, 0, 0}}
	Depth := uint32(9)
	Turn := true
	for State.EndState(Turn) == 3 {
		t := time.Now()
		Best, Score := vulpes.SolveGame(State, Depth, Turn, -100, 100)
		State = Best.(TicTacToe)
		fmt.Println("Board:")
		fmt.Print(State.ToString())
		fmt.Println("Score:", Score)
		fmt.Println("Time Taken:", time.Now().Sub(t))
		Turn = !Turn
	}
}
Beispiel #2
0
func main() {
	init_counts()
	var Board [6][7]int
	for i := 0; i < 6; i++ {
		for j := 0; j < 7; j++ {
			Board[i][j] = 0
		}
	}
	State := Connect4{Board}
	Turn := true
	for State.EndState(Turn) == 3 {
		t := time.Now()
		Best, Score := vulpes.SolveGame(State, DEPTH, Turn, -0x100000, 0x100000)
		State = Best.(Connect4)
		fmt.Println("Board:")
		fmt.Print(State.ToString())
		fmt.Println("Score:", Score)
		fmt.Println("Time Taken:", time.Now().Sub(t))
		Turn = !Turn
	}
	fmt.Println(State.EndState(Turn))
}