BROOKLYN'S FINEST THE STILETTO BOOK CENY HOUSEHOLD DECORATES yraga ng 000 20 K HOME NI .. - אצלנו ENREDON BARE R Ta nam
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
BROOKLYN'S FINEST THE STILETTO BOOK CENY HOUSEHOLD DECORATES yraga ng 000 20 K HOME NI .. - אצלנו ENREDON BARE R Ta nam
are limited in size. For this game we will limit our stacks to
three elements each. For the explanation we will initially limit
ourselves to three stacks with a depth of three. You can see above
in the picture a physical example with 4 stacks of depth 3.
Back to our explanation, above these three stacks, you have a
list of five positions from 0 to 4. The first stack is aligned with
position 1; stack 2 with position 2, and stack 3 with position 3.
Positions 0 and 4 don't have a stack aligned with them.
See this figure below to have a better idea about how this
structure looks.
The structure is filled with nine beads: 3 As, 3 Bs and 3 Cs,
representing 3 colours. Initially the structure looks like this
with the 3 stacks each filled with either all As, Bs, or
Cs.
The structure always has 9 beads. The beads can move one
position at a time to an empty position. An empty position is
represented by a "." here.
For example from the initial configuration, one can pop a
bead from the first stack and switch it with the top bead in the
second stack in the follow series of moves:
The game consists of getting a random configuration card and
doing the minimum numbers of moves to change the beads of the
AbacoStack to that given configuration.
For example, you get the following card:
You need to move the beads one by one to get
The game is played by a user, not the computer. The computer
would generate a random configuration card and the user would have
to solve the game by indicating the moves to do in order to change
the configuration from the initial one to the one indicated on the
card.
The moves are indicated by the following input
pair ij where i is
a digit and j a character like the
following:
you need help me the following part
this is a python homework
Task 4: The Game
Write the python program to play the game. To start the game a
player has to choose the size of the AbacoStack by selecting the
number of stacks between 2 and 5 and selecting the depth of the
stacks between 2 and 4.
Here are all the possibilities. Notice that some can be very
difficult if not impossible to solve. This why we recommend the 3
by 3 or 4 by 3 configurations.
Once the size of the AbacoStack is selected, the program should
iteratively generate a new random configuration card and allow the
user to solve the puzzle.
The user should be given the option to either play one move, a
sequence of moves (max 5 at a time), reset the state game to retry
the same card, or quit. For example, the user could be
prompted:
Enter your move(s) [Q for quit and R to reset]:
Q would indicate quitting, R would indicate resetting and one or
more moves separated by a space would provide the move or moves to
do. If more than 5 moves are provided, only the first 5 are
considered and the others are ignored.
The moves are given as specified above. If a move is not valid,
the state of the of the game should not change. If a sequence of
moves is given, the state of the game should change to the new
state after all those moves are done if all moves are valid in that
sequence, otherwise the moves are interrupted at the first illegal
move. We would then display the state up to the last
legal move that was read.
After each move or the sequence of moves is played, the state of
the game should be displayed with the number of moves done since
the start. If a player enters a sequence of moves, all
the sequence of legal moves should be played even if the winning
position is reached before the last move in the sequence.
Therefore, testing whether the puzzel is solved should be done
after the sequence of moves.
Once the puzzle is solved, after one single move or a sequence
of moves, the program should congratulate the player, show the
AbacoStack finished with the number of moves played, and ask
whether the user would like to get another configuration card to
attempt, to which the user should reply by a Y or N for yes or
no.
BROOKLYN'S FINEST THE STILETTO BOOK CENY HOUSEHOLD DECORATES yraga ng 000 20 K HOME NI .. - אצלנו ENREDON BARE R Ta nam