Deep Learning, Reinforcement Learning
A checkers game with a simple computer player. The computer player works by assigning a weight for each move. When a move weight is calculated, it is based off information such as move safety (e.g. if the move results in the checker being taken by the other player, it is less likely to make that move). It checks a number of other factors and assigns a final weight. The move with the highest weight is chosen as the move. To ensure computer players are less predictable, if multiple moves have the same weight then one is randomly chosen.
src/
javac ui/*.java model/*.java logic/*.java network/*.java
java ui.Main
The checkers program comes complete with all graphical user interface components that scale relative to the size of the window. It is a user-friendly UI and has options to change the type of player for both player 1 and 2, and restart the game. In addition, it provides a checker board UI to show the current game state.
Multiple different types of players are supported and can be selected by the user:
All player classes extend the abstract Player
class and either implement the logic to update the game or allow the user to input their moves.
Each instance of a checkers window/program is network capable. It is able to make connections across the network to other checkers clients. To set up a network player, simply do the following:
In addition to peer-to-peer connections, a checkers window can act as a router and forward the game state between two clients if both of the players are network players.
A small amount of security has been put in place for peer-to-peer connections. When a remote client makes a new connection, it receives a session ID (which is randomly generated) that must be used in all following messages between the clients. This ensures that another checkers client cannot pretend to be an already connected client and change the game state unexpectedly.