Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

using C++ to type the code RI.1 Game Board The game board has a fixed size of $ x 5 puzzle pieces, where each puzzle

using C++ to type the code

image text in transcribed
RI.1 Game Board The game board has a fixed size of $ x 5 puzzle pieces, where each puzzle piece occupies a 3 x 3-character space (more on RI.2). The game board is enclosed by a boundary with characters "[ for vertical boundary, ".' for horizontal boundary, and " for the comer, Each location in the board is identified by a row number and a column letter. An example of game board is given below, with the top-left location identified by IA: ABCDE Each puzzle piece occupies a 3 x 3-character space. It contains a letter index in the middle, and four randomly generated single-digit number at the top, bottom, left and right of the index, Some sample puzzle pieces are show below. Puzzle A: Puzzle B: Puzzle C: 3 6 5 1AS B 6 SCS There are al most 25 puzzle pieces for the game. Their indexes ranged from A to Z excluding Q which is used to indicate quitting the game. The random numbers are single- digit in the range 0 to 9 inclusively. Both number of pieces and range of random numbers can be changed in settings. R13 Rules Every time, the player can either place a puzzle piece into the game board or lake a puzzle pices out from the game board. Place Player can choose any "not-yet-placed" puzzle piece and place is at any location in the game board. However, when it is placed next to any existing piece(s) in the ganse board, their touching sides need to have the same number. An example of placing four puzzle pieces is demonstrated below, with the newly added peccerat each time highlighted in red: 1A9 LA99 882 Take out: Player can take any "placed puzzle piece out from the game board, ILLA Player's Action In each round, the player needs to input an index to select a puzzle piece. If the sclosed puzzle piece is in the game board, then that piece will be isken out from the game board and put back to the list of "not yet-placed" pieces. If the selected puzzle piece is in the list of -not-yet-placed" pieces, then the player can take further actions below: Rotate the selected piece; Player can rotate the selossed puzzle piece in clockwise or anticlockwise direction. If relation is not needed, the player can choose to skip this step. An example of rotating a puzzle in clockwise direction for three times 3 4A3 981 3A4 Place the selected piece: Player inpuls a location (e.g. IA] in the game board for placing the selected puzzle piece. The placement should follow the rules in RI.J. If placement is not needed, the player can choose to skip this step

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions

Question

Describe different factors hindering export initiation.

Answered: 1 week ago