New Task 2: Letter Chess
OK, Thank you!
Last updated
OK, Thank you!
Last updated
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
In the beginning, the chessboard looks like this:
Note: A8 is inputted by the user
The following tables summarize how different chess pieces move: (Yellow = movable tiles)
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
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.
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:
After the player successfully chooses which piece to move, that piece and its movable tiles are highlighted as shown below:
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.
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.
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.