New Task 2: Letter Chess

OK, Thank you!

Author

Dicaprio Cheung (dhcheungaa@connect.ust.hk)

Task

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:

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 teamsmall 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

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

  1. The CAPITAL team always starts first.

  2. K is the King. If the king is dead, the other team wins.

  3. We only accept CAPITAL letters for tile names. e.g. A8, H7, ...

  4. The player can only choose his/her piece that has a valid move. If not, ask the player to choose again like the following:

  1. After the player successfully chooses which piece to move, that piece and its movable tiles are highlighted as shown below:

  1. After each move, if any side wins, print the winner with the given prompt in the skeleton code and end the program immediately.

  2. 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.

Last updated