Question: 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
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 Create a for loop that compares the characters in two chracater vectors, simon_ pattern and user_pattern. One point is added to user_score for each match. The game ends upon the first mismatch. Restrictions: The script must use break statement. Ex: The following patterns yield a user score of 2 simon pattern - RRYBRYYBGY user-pattern = "RRGBBRYBGY User score: 2 Your Script B Save C Reset MATLAB Documentation user-score = 0; simon-pattern- user_pattern RRGBBRYBGY'; 1 2 .RRGBRYYBGY . ; 5 for i=1:10 if simon-pattern(i)--user-pattern(i) user score user_score+1; % Your code goes here 10 end 12 end 13 fprintf('user score: Xd An',user soc
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
