1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Nady [450]
3 years ago
10

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 mu

st 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
Engineering
1 answer:
AleksandrR [38]3 years ago
5 0

Answer:

for  i  in range(0,10):

   if SimonPattern[i] == UserPattern[i]:

       score = score + 1

       i = i + 1

   else:

       break

if i == 9:

   score = score + 1    

print("Total Score: {}".format(score))

Explanation:

This for loop was made using Python. Full code attached.

  • For loop requires a range of numbers to define the end points. For this Simon Says game, we are talking about 10 characters, so that must be the range for the for loop: from 0 to 10.
  • Conditional if  tests if Simon pattern matches User's one characheter by one and add point for each match.
  • Break statement is ready to escape the for loop at first mismatch.
  • As we are starting from index 0, if the users matched all the characters correctly, then we need to add 1, otherwise the maximun score would be 9 and it should be 10.
Download txt
You might be interested in
Input signal to a controller is​
alexgriva [62]

Answer:

were the cord plugs in

Explanation:

4 0
3 years ago
. En la facultad de Ingeniería Industrial se realizó una encuesta a 200 personas para saber que lenguaje de programación preferí
GarryVolchara [31]

Answer:

lalalalapumpe

Explanation:

4 0
3 years ago
If your accelerator pedal gets stuck, what is the first thing you should do?
Anna35 [415]

If your accelerator gets stuck down, do the following: Shift to neutral. Apply the brakes. Keep your eyes on the road and look for a way out.If your accelerator gets stuck down, do the following:

Shift to neutral.

Apply the brakes.

Keep your eyes on the road and look for a way out.

Warn other drivers by blinking and flashing your hazard lights.

Try to drive the car safely off the road.

Turn off the ignition when you no longer need to change direction.

8 0
3 years ago
To do the right thing or to have moral principles is called _____ . a code
crimeas [40]

Answer:

Ethics

Explanation:

To do the right thing or to have moral principles is called ethics. Ethics affect how people make decisions and lead their lives. Some words people associate with ethics includes:

- Honesty

- Integrity

- Promise keeping and Trustworthiness

- Loyalty

- Fairness

- Concern for others

- Respect for others

- Law abiding

etc.

7 0
3 years ago
This test should be performed on all cord sets, receptacles that aren't part of a building or structure's permanent wiring, and
vova2212 [387]

Answer:

A continuity test

Explanation:

A continuity test is used to verified that current will flow in an electrical circuit, it performed by placing a small voltage across the chosen path. continuity test ensure that the equipment grounding conductor is electrically continuous and this test is perform on all the cord sets, receptacles that aren't part of a building or structure's permanent wiring, and cord-and-plug connected equipment required to be grounded. example of equipment used in testing current flow in continuity test are Analog multi-meter, voltage/continuity tester etc.

Continuity test and terminal connection test are the two test required by OSHA on all electrical equipment

8 0
3 years ago
Other questions:
  • Is air conditioner a refrigerator?
    10·1 answer
  • It is said that Archimedes discovered his principle during a bath while thinking about how he could determine if KingHiero‘s cro
    15·1 answer
  • 10. When an adhesion bond is made by melting a filler metal and allowing it to spread into the pores of the
    7·1 answer
  • A vernier caliper will measure in what ( URGENT)
    10·1 answer
  • Which actions would the maintenance and operations crews carry out as a building is completed and preparing to open to the publi
    8·2 answers
  • Technician A says when you push the horn button, electromagnetism moves an iron bar inside the horn, which opens and closes cont
    5·2 answers
  • Write the 5 important of profession education in a point​
    10·1 answer
  • ¿Cuál es el objetivo de la participación del gobierno en la economía?
    6·1 answer
  • Who wanna rp?????????????????????????!
    15·1 answer
  • A complete mix of an activated sludge system without primary clarification is used for treatment of municipal wastewater with a
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!