Your task is to build a new type of chess called the Letter Chess. The name comes from its chess pieces because they are English Letters. Like normal chess, there are 2 players and they are called:
CAPITAL letter
small letter
Chessboard
In the beginning, the chessboard looks like this:
Initial game board, with all spaces shown
Note: A8 is inputted by the user
Chess pieces and movements
The following tables summarize how different chess pieces move: (Yellow = movable tiles)
CAPITAL letter team
small letter team
I am using these images to prevent people to use ChatGPT. If these doesn't work, please tell me how you used ChatGPT to read these images and complete this task.
The arrows represent how the piece moves along the path. The piece can move infinitely along the arrow until something blocks it. If something is blocking it, it can't go through that piece and reach the other side.
Take X as an example:
X is just like a normal bishop
bishop in a normal chess
If a pawn is blocking the bishop, the bishop can't jump over the pawn and eat the castle. The same logic applies to all other arrows.
Implementation Details
The CAPITAL team always starts first.
K is the King. If the king is dead, the other team wins.
We only accept CAPITAL letters for tile names. e.g. A8, H7, ...
The player can only choose his/her piece that has a valid move. If not, ask the player to choose again like the following:
Demonstration of user keep choosing the wrong tiles
After the player successfully chooses which piece to move, that piece and its movable tiles are highlighted as shown below:
Game board of CAPITAL player moving C8 to B7, with all spaces shown
After each move, if any side wins, print the winner with the given prompt in the skeleton code and end the program immediately.
If any side has no valid move, print the given prompt in the skeleton code and end the program immediately.
Submission
Name your file as main.c. Directly zip it as a zip file and submit it to ZINC. you can name the zip file whatever you want.
do NOT put your main.c in a folder.
do NOT add extra spaces or \n in your code.
FAQ
If any part of this assignment is unclear, please ask our seniors in Discord. The Q&A will be updated here if your questions are meaningful to all tutees.