subject

This assignment is an extra credit assignment, optional. You can use the Standard Library Template's functions and data types for implementing the Stacks.
You will need to implement 3 stacks: A, B, C
Each disc is represented by a number and a string of x's
1. Smallest disc is represented by the number 1 and one x centered in a field of 7 (3 blanks, 1 x, 3 blanks)
2. Middle disc is represented by the number 3 and three x's centered in a field of 7 (2 blanks, 3 x's, 2 blanks)
3. Largest disc is represented by the numbe4 5 and 5 x's centered in a field of 7 (1 blank, 5 x's and 1 blank)
Give instructions. Ask player to enter letter of source and destination stack. Remove the top from source stack and place it on the destination stack, display the 3 stacks on console. Repeat until all disks are on stack C. Don't move if player breaks rule 3 -- display "Can't Cheat!". Detect when player wins, display "Won in" # "moves". If player won in minimal # of moves, display "Can't do better than that!"Starting the game the puzzle starts with printing this.
Display the towers A, B, C with their content at the end of each move: B
1 х
3 XXX
5
A B C
What is your move? (give first the source stack (A, B, or ) and the Destination Stack, separated by 1 Space):
The answer is given in color graphically on the challenge problem page.
If player enters:
A C
You display the following
3 XXX
5 1 x с
A B B
OR, you can print the following
3 XXX
5
A B C
For the next step, if the player asks to move A to B
A B
you sill print:
5 A
3 XXX B
1 x C

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:00
Businesses allocate resources for their best and most productive uses. the more a resource, the more costly it will be. a manufacturer that requires scarce and costly resources is likely to charge for its products.
Answers: 2
question
Computers and Technology, 22.06.2019 17:00
Aisha has finished working on a word processing document that contains 15 pages. she has added some special elements in the first three pages, page 9 and 10, and page 15 from the document. she wants to print only these pages to see how they look. which option is the correct way to represent (in the print dialog box) the pages that aisha wants to print
Answers: 3
question
Computers and Technology, 23.06.2019 06:30
Which option correctly describes a dbms application? a. software used to manage databases b. software used to organize files and folders c. software used to develop specialized images d. software used to create effective presentations
Answers: 1
question
Computers and Technology, 23.06.2019 23:30
Perform an online search about the booting process of a computer and list all the steps
Answers: 2
You know the right answer?
This assignment is an extra credit assignment, optional. You can use the Standard Library Template...
Questions
question
English, 04.05.2021 19:40
question
Spanish, 04.05.2021 19:40
question
Mathematics, 04.05.2021 19:40
question
Mathematics, 04.05.2021 19:40
Questions on the website: 13722360