Menu

(Solved) : Challenge Activity 4101 Simon Says Simon Says Memory Game Simon Outputs Sequence 10 Charac Q34522510 . . .

CHALLENGE ACTIVITY 4.10.1: Simon says Simon Says is a memory game where Simon outputs a sequence of 10 characters (R, G, B, Y) and the user must repeat the sequence. Create a for loop that compares the two strings starting from index 0. For each match, add one point to userScore Upon a mismatch, exit the loop using a break statement. Assume simonPattern and userPattern are always the same length. Ex: The following patterns yield a userScore of 4 simonPattern: RRGBRYYBGY userPattern: RRGBBRYBGY #include <string> 3 using namespace std; 4 5 int mainO 6 string simonPattern; string userPattern; 8 int userScore; 9 int i; 10 11 userScore -0; 12 13 us 14 15/Your solution goes here */ 16 17 cout < userScore: << userScore << endl; 18 19 simonPattern -RRGBRYYBGY erPatternRRGBBRYBGY; return 0;

CHALLENGE ACTIVITY 4.10.1: Simon says Simon Says is a memory game where Simon” outputs a sequence of 10 characters (R, G, B, Y) and the user must repeat the sequence. Create a for loop that compares the two strings starting from index 0. For each match, add one point to userScore Upon a mismatch, exit the loop using a break statement. Assume simonPattern and userPattern are always the same length. Ex: The following patterns yield a userScore of 4 simonPattern: RRGBRYYBGY userPattern: RRGBBRYBGY #include <string> 3 using namespace std; 4 5 int mainO 6 string simonPattern; string userPattern; 8 int userScore; 9 int i; 10 11 userScore -0; 12 13 us 14 15/Your solution goes here */ 16 17 cout < “userScore: “<< userScore << endl; 18 19 simonPattern -“RRGBRYYBGY” erPattern”RRGBBRYBGY”; return 0; Show transcribed image text

Expert Answer


 

user_score = 0
simon_pattern = input()
user_pattern = input()

for i in range(len(simon_pattern)): . . . . .

OR