Question: Functionality Your program is required to implement the following core functionality: Section A . Gameplay - Upon system reset, or at the start of a
Functionality
Your program is required to implement the following core functionality:
Section A Gameplay
Upon system reset, or at the start of a new game, the sequence length is set to one. The sequence length corresponds to the user's score.
Upon system reset, and on each turn of gameplay, "Simon" begins a level by producing a tone on the buzzer and illuminating two segments of the segment display see Table Simon will play a tone and illuminate two segments for all steps in the sequence determined in Section B Each step is active for of the duration of the playback delay see Section C after which the buzzer is silent and the segment display is blank, for the remainder of the playback delay. Following this, the next step in the sequence will be active.
Once the sequence length is reached, the user must press the pushbuttons corresponding to the steps in the same sequence. As each pushbutton is pressed, the corresponding segments of the segment display are illuminated, and the corresponding tone is sounded. This occurs for either: of the duration of the playback delay, or the duration of the button press, whichever is longer.
If the user's sequence matches Simon's, the SUCCESS pattern is displayed for the playback delay. Finally, the sequence length, which is equal to the user's score, is increased by one.
The next turn replicates the steps from the previous sequence, while appending an additional step at the end.
The game repeats until the user fails to match Simon's sequence, or when the maximum sequence length is reached.
The game ends as soon as an incorrect input is provided by the user. This causes the FAIL pattern to be displayed for the playback delay, followed by the user's score, which is also displayed for the playback delay. Following this, the segment display will remain blank for the playback delay. After this, the sequence length is reset back to one and a new game will begin.
The user's score is displayed as a decimal number between and on the segment display. In the unlikely event that a score exceeds the two least significant digits will be displayed. Leading zeroes will be shown only if the score exceeds For example, if the user's score is prime will be shown, however, if the user's score is will be shown.
The SUCCESS pattern requires all segments on both displays to be illuminated.
The FAIL pattern requires the mathbfG segment on both displays to be illuminated.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
