Skip to content

dr-divago/Chess

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Install lib local repo

mvn install:install-file -Dfile={project.root}/libs/userinput.jar -DgroupId=com.whitegaming -DartifactId=userinput -Dversion=1.0 -Dpackaging=jar

Build Application

./mnv clean install

Run Application

Run the application

java -jar target/chess-fatjar.jar $path-file/{file-with-moves.txt}

Test Application

./mvn clean test

Architecture choice

The chess game is modeled with sealed class and switch implemented in JDK 21. Choice was made considering the number of piece in the board are fixed and cannot be extended. This allow static dispatch implemented in ChessPiece base class and PieceLogic where all the logic of piece movement and validation is centralized and specialized piece logic is dispatched. Project is implemented using vavr library to use a more functional style programming taking in consideration immutability and referential transparency of the functions. The entry point is class ChessConsole that will execute the moves contains in the file txt passed as input. Missing some tests and more validation for edge cases.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages