Skip to content

aoshiro10/chess-ai-framework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chess Framework

Chess framework built using Java and Swing.

Allows plugins to extend the game by implementing different AI's to play chess.

Prerequisites

Gradle

Getting Started

Use 'gradle run' to initiliaze the game. By default the game will run with no plugins (human vs human).

To create a new plugin, create a new class under the package plugin and implement the Player interface under the package core.

The Player interface has only two required methods:

  1. Side getSide();
  2. Move chooseMove(Board board);

getSide():

Return: side (white or black) of the player the plugin is controlling : Side

chooseMove():

Parameter: board represting the current state of the game : Board

Return: from the list of available moves from the current chess state, return a move : Move

Observation: 'Board' has a method 'getValidMoves(final Side side)' that takes a 'Side' and returns a list of valid moves for the current side.

Installing new plugin

Make sure you implement the Player.

After creating the plugin class, under 'Program'(https://github.com/aoshiro10/chess-framework/blob/master/src/main/java/framework/Program.java) initialize the plugin for a specific player (i.e. 'whitePlayer').

Running the tests

Use 'gradle build' to test framework test

Use 'gradle run' to play chess with the plugin.