subject

SOLVE IN C: "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
please use comments to explain each step!! I would like to understand the process :)

#include
#include

int main(void) {
char simonPattern[50];
char userPattern[50];
int userScore;
int i;

userScore = 0;

scanf("%s", simonPattern);
scanf("%s", userPattern);

**YOUR ANSWER GOES HERE**

printf("userScore: %d\n", userScore);

return 0;
}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 20:40
Peripherals are part of the main computer. true false
Answers: 3
question
Computers and Technology, 23.06.2019 04:00
Laire writes a letter to her grandmother, in which she describes an amusement park she visited last week. she adds pictures of that place in her letter. which feature of a word processing program will claire to remove unwanted parts of the pictures?
Answers: 3
question
Computers and Technology, 23.06.2019 04:31
Type the correct answer in the box. spell all words correctly. the managing director of a company sends a christmas greeting to all his employees through the company email. which type of network does he use? he uses an
Answers: 1
question
Computers and Technology, 23.06.2019 12:40
According to the video what are some tasks petroleum engineers perform check all that apply
Answers: 2
You know the right answer?
SOLVE IN C: "Simon Says" is a memory game where "Simon" outputs a sequence of 10 characters (R, G, B...
Questions
question
Mathematics, 19.05.2021 20:00
question
Mathematics, 19.05.2021 20:00
question
History, 19.05.2021 20:00
question
Mathematics, 19.05.2021 20:00
question
Mathematics, 19.05.2021 20:00
question
Health, 19.05.2021 20:00
Questions on the website: 13722363