NetLogo banner

 Home
 Download
 Help
 Resources
 Extensions
 FAQ
 References
 Contact Us
 Donate

 Models:
 Library
 Community
 Modeling Commons

 User Manuals:
 Web
 Printable
 Chinese
 Czech
 Japanese

  Donate

NetLogo User Community Models

(back to the NetLogo User Community Models)

Checkers

by Jiří Lukáš (Submitted: 04/30/2014)

[screen shot]

Download Checkers
If clicking does not initiate a download, try right clicking or control clicking and choosing "Save" or "Download".(The run link is disabled because this model uses extensions.)

## WHAT IS IT?

This is checkers model where two AI's play against each other. Each player can choose from 3 different game strategies (no strategy, offensive strategy or defensive strategy). There is also preset an experiment in tool called BehaviorSpace.
Note: This project was my bachelor thesis so I had some goals to satisfy and I'm planning to extend this model in the future (more in Extending the model)

## HOW IT WORKS

There is implemented a basic algorithm for searching the best move. This algorithm uses the evaluation function that evaluate every single move.
Checkers rules:
1) Size of chessboard is 8x8 squares.
2) Each player has 12 pieces.
3) White starts the game.
4) Moves are allowed only on the dark squares, so pieces always move diagonally. Single pieces are always limited to forward moves (toward the opponent).
5) A piece making a non-capturing move (not involving a jump) may move only one square.
6) A piece making a capturing move (a jump) leaps over one of the opponent's pieces, landing in a straight diagonal line on the other side. Only one piece may be captured in a single jump; however, multiple jumps are allowed on a single turn (max 3 jumps).
7) When a piece is captured, it is removed from the board and the player gets one point to his score
8) If a player is able to make a capture, there is no option -- the jump must be made. If more than one capture is available, the player is free to choose whichever he or she prefers.
9) When a piece reaches the furthest row from the player who controls that piece,it is removed and the player gets 3 points to his score (yeah, there is no King or Queen!!!)
10) The game is over when one player can't make a move. In most cases, this is because all of the opponent's pieces have been captured, but it could also be because all of his pieces are blocked in. The winner is the player with the highest score.
## HOW TO USE IT

The Setup button with hotkey S will prepare the model to run. The Run button with hotkey R runs the model.
StrategyWhite and strategyBlack is chooser to select player's game strategy.
The switch user-messages? is used to switch on or off user messages ("Black wins the game" etc.)
The another switch, show-jumps? is used to switch on or off colloring patches (squares) when the player jumps.It's just for a better overview.
The slider delay is used to set up the waiting time during the jumping. It's also just for a better overview.

## THINGS TO TRY

As I said before, there is preset an experiment in BehaviorSpace. You can run this experiment, export results into CSV file as table format or spreadsheet format. YThis is a plain-text data format that is readable by any text editor as well as by most popular spreadsheet and database programs.Use for example Excel and see what strategy is better then others.

## EXTENDING THE MODEL

1) King - Adding the king would certainly enrich the game.
2) AI - Improve the artifical intelligence. Try to implement minimax algorithm with alfa-beta pruning extension. You can also add some searching heuristic. (my plan to future)
3) 1vsAI - Create a new version where a human player could play against the computer. But for this you need to complete point 2. (my plan to future)
4) 1vs1 - Use HubNet and try to create a version where two human players could play against each other.

## NETLOGO FEATURES

Model uses breeds, globals, locals, turtles and patches variables.There is also included an axtension Matrix - for more information see http://ccl.northwestern.edu/netlogo/5.0/docs/matrix.html.

## CREDITS AND REFERENCES

To cite this model:
author: Jiri Lukas
year: 2014
place: the faculty of applied informatics, university of Hradec Kralove, Czech Republic
name of model: Checkers model to simulate different game strategies

(back to the NetLogo User Community Models)