This is my attempt to build a simple two-player console chess game named ChessCLI to deepen my understanding of Kotlin syntax, it's core features and to exercise my ability to develop clean usable code. My goals for this project were to:
- Exercise both 'val' and 'var' variables, expressions, conditionals, and loops
- Design and instantiate classes, including a 'Piece' hierarchy for the major and minor chess pieces.
- Use functions and data classes to model the board coordinates and moves
- Make use of Kotlin's 'when' expression to branch piece types.
- Manage the state of the board with Kotlin collections.
In the process of meeting these goals, I implemented turn-taking, basic move validation such as pawn captures and same color capture prevention. I also implemented an ASCII console UI. In building this project, I received hands-on experience with object-oriented design, unit testing, and using the unique strengths of Kotlin to write clean concise code.
- JDK: OpenJDK 24
- IDE: IntilliJ IDEA Community Edition
- Kotlin: Included via IntelliJ
- Testing: JUnit 5 manually added as a project library to run unit testing.
- Kotlin Programming Language(Wikipedia)
- Official Kotlin Documentation
- GeeksforGeeks: Kotlin Introduction/Control Flow(Dropdown at the bottom of the page)
- Dev.to: Console UI Inspiration
- Kotlin to Java Comparison
- Programiz: Kotlin Data Classes
- Full Rule Enforcement: Add check, checkmate, and stalemate detection functionality.
- Special Moves: Add functionality for castling, pawn promotion, and en passant.
- Save/Load: Add save and load functionality.
- Player Networking: Add the ability to play over TCP or websockets.