January 2017
Beginner to intermediate
446 pages
8h 46m
English
Hexapawn is a two-player game where we start with a chessboard of size NxM. We have pawns on each side of the board and the goal is to advance a pawn all the way to the other end of the board. The standard pawn rules of chess are applicable here. This is a variant of the Hexapawn recipe given in the easyAI library. We will create two bots and pit an algorithm against itself to see what happens.
Create a new Python file and import the following packages:
from easyAI import TwoPlayersGame, AI_Player, \
Human_Player, Negamax
Define a class that contains all the methods necessary to control the game. Start by defining the number of pawns on each side and the length of the board. Create a list of ...
Read now
Unlock full access