chessCAMO is a newly proposed chess engine with a built-in variant that stands for Calculations Always Make Opportunities and was inspired by the very popular chess variant Crazyhouse.
The "CAMO" portion comes from the idea that in this variant, at any turn, a player can sacrifice making a move to replace one of their pieces with a piece from the "piece reservoir". This has the affect of camouflaging each piece that is currently on the board.
- Can be used without any pre-requests besides the files found in this repository ๐
git clone https://github.com/lbragile/chessCAMO.git
cd chessCAMO/GUI/
chessCAMO
- A GCC/G++ compiler is required!
git clone https://github.com/lbragile/chessCAMO.git
cd chessCAMO
mingw32-make all_main
main
For any board representation, the user can press one of the following keys on their keyboard for a respective action to occur.
- Esc - Resign (forfeit the game)
- D - Offer a draw
- U - Undo a move
- S - Start a new game
If you would like to have a specific promotion piece type, you must indicate so prior to making the move with the following keys. Otherwise, the default type (Queen) will be applied.
- Q - Queen
- R - Rook
- B - Bishop
- N - Knight
The "Cyan" highlighted squares indicate the legal moves you can make for any board position. Similarly, the "Green" highlighted squares indicate the side whose turn it currently is for a more visual feel. Side movement is also displayed at the bottom, in the status field.
- 1 - Toggle on/off side highlighting
- Numpad 1 - Toggle on/off move highlighting
The above keys are NOT case sensitive, thus pressing U (shift + u) is the same as simply pressing u.
The console provides instructions after each move and is thus more transparent to the user. This means that the user must enter the required information at each step.
Unlike the GUI, where you can drag and drop a piece from the reservoir to the board, the Console requires you to input a special type of source square character, followed by the regular destination square. Follow the instructions in the console window to do this correctly. Remember that there is a fixed quantity of pieces in the reservoir (as indicated by the quantity numbers) and thus a move can fail if you do not have any more of that piece in the reservoir.
For example, Enter a source AND destination square in [A1, H8]: Q E2
, will place a Queen from the piece reservoir on E2
and replace the existing piece, assuming it is that side's turn, and at the same time decrease the side's piece reservoir quantity count to Queen x0
. Note that the destination square can also be e2
or 52
for the same affect to occur.
- The piece reservoir is limited in size and cannot be re-stocked with pieces.
- Once a player decides to use a piece from the reservoir to replace one of his existing pieces on the board, their turn is over.
- An obvious rule is that player cannot use the reservoir while in check as they must make a move to avoid check.
- Additionally, just like in the Crazyhouse variant, a player cannot directly promote a pawn from the reservoir. That is a pawn from the reservoir must be placed on the board first and is only allowed to be promoted on the next move.
- A game is drawn under the same conditions as in regular chess, regardless of the quantity of pieces in the reservoir. Thus, the piece reservoir cannot be used to avoid a draw and prolong the game.
Check out the very detailed documentation file to clear up any questions you might have.
- Board representation undo
(use queue?)- used serialization. - Input as PGN rather than two integers (using template).
- GUI -
nice to be able to move pieces with mouse rather than inputting coordinates.in progress (more details for user in the interface will be added). - Three move repetition (draw) & 50 move rule.
- Make piece reservoir
(stack)usedvector<pair<int, char>>
whereint
is the quantity andchar
is the piece type. - Allow players to replace existing pieces with reservoir pieces.
- Display reservoir piece quantity and ensure a player cannot use more pieces than there are in the reservoir.
- Prevent reservoir piece from replacing identical piece type or king.
- Implement abovementioned
checkcheck/double check and pawn promotion rules. Note that pawns cannot move 2 squares regardless of where they are placed, and they cannot be placed in the first rank for the respective players.
-
mingw32-make all_unit
-
unit --gtest_color=yes
โก๏ธ colored output (Pass (GREEN)/Fail (RED)) -
mingw32-make all_unit
-
unit
โก๏ธ regular output (no color)
Currently chessCAMO utilizes the GoogleTest Framework to create test fixtures that cover as much of the implementation file as possible.
You can contribute to this project by making test cases that can challenge the chessCAMO engine in unique ways to ensure that it follows proper chess rules. To do so, please refer to the appropriate section in the documentation file.
Please refer to the CONTRIBUTING.md document.
Make the maintainer happy by hitting the star icon for this repository!
Consider adding this repository to your watch list to stay updated on what new feature is implements.
I decided to create this project due to my growing interest in software development. Coming from an Engineering background with Deep Learning research experience (Recent Master of Applied Science graduate), I realized that writing and developing code (both front and back end) were highly appealing to me. Thus, I spent a lot of time building upon my existing coding knowledge through online material and knew that it is time to test my knowledge on a challenging project. Additionally, I played chess (not very seriously) consistently since the age of about 4-5, so one can say that it is a very big part of my life. As a result, this project allowed me to gain valuable experience and knowledge while working on a topic that I am passionate about and have expertise in.
Be on the look out for a detailed YouTube video series explaining the various sections of this project. I feel like others could benefit from the logic involved in creating a project on this scale, which is relatively large and requires a substantial time commitment. Often times, when starting from scratch, an inexperienced software developer will quickly get overwhelmed by the complexity and decide to end the project before anything major is finished. I was in the same boat before and understand the frustration of wanting to work on an interesting project, but simply not being able to. It is often best to work on small pieces and build your way to the final product. This gives you a sense of accomplishment at each step and prevents you from experiencing the overwhelmed feeling. Let me know if you are interested in me making the videos and what you would like to see.
Reach out to me at any of the following:
-
Cโoโpโyโriโghโtโ ยฉ๏ธ 2020 Lior Bragilevsky