Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need help programing this in C using loops and arrays thanks. In Milestone 2, using the initial state from Mfilestone l your task is
I need help programing this in C using loops and arrays thanks.
In Milestone 2, using the initial state from Mfilestone l your task is to simulate the new states when the first domino is tipped for 10 consecutive time steps. The rules for updating the state of a domno are as follows: . On each timestep, each tipping domino will cause its neighbor to the right to change from upright to tipping if the neighbor is upright) . Any tipping dominoes will change to horizontal .All other dominoes will remain unchanged Here is an example run (user input in bold): Position 1 (8-empty, 1-upright, 2-tipping, 3-horizontal): 1 Position 2 (8-epty, 1-upright, 2-tipping, 3-horizontal): 1 Position3 (8-epty, 1-upright, 2-tipping, 3-horizontal): 1 Position 4 (-epty, 1-upright, 2-tipping, 3-horizontal): e Position 5 (8-empty, 1-upright, 2-tipping, 3-horizontal): 2 Position 6 (8-epty, 1-upright, 2-tipping, 3-horizontal): 1 Position 7 (8-empty, 1-upright, 2-tipping, 3-horizontal): 1 Position 8 (8-epty, 1-upright, 2-tipping, 3-horizontal): 1 Position9 (-epty, 1-upright, 2-tipping, 3-horizontal): e Position 18 (8-empty, 1-uprright, 2-tipping, 3-horizontal): 1 Position 11 (8-empty, 1-uprright, 2-tipping, 3-horizontal, -1-finished): -1 Initial state Tipping over domino e Time step 1: Il Time step 2: Time step 3: Time step 4: Time step 5: Time step 6: Time step 7: Time step 8: Time step 9: Time step 18 Finished! In Milestone 2, using the initial state from Mfilestone l your task is to simulate the new states when the first domino is tipped for 10 consecutive time steps. The rules for updating the state of a domno are as follows: . On each timestep, each tipping domino will cause its neighbor to the right to change from upright to tipping if the neighbor is upright) . Any tipping dominoes will change to horizontal .All other dominoes will remain unchanged Here is an example run (user input in bold): Position 1 (8-empty, 1-upright, 2-tipping, 3-horizontal): 1 Position 2 (8-epty, 1-upright, 2-tipping, 3-horizontal): 1 Position3 (8-epty, 1-upright, 2-tipping, 3-horizontal): 1 Position 4 (-epty, 1-upright, 2-tipping, 3-horizontal): e Position 5 (8-empty, 1-upright, 2-tipping, 3-horizontal): 2 Position 6 (8-epty, 1-upright, 2-tipping, 3-horizontal): 1 Position 7 (8-empty, 1-upright, 2-tipping, 3-horizontal): 1 Position 8 (8-epty, 1-upright, 2-tipping, 3-horizontal): 1 Position9 (-epty, 1-upright, 2-tipping, 3-horizontal): e Position 18 (8-empty, 1-uprright, 2-tipping, 3-horizontal): 1 Position 11 (8-empty, 1-uprright, 2-tipping, 3-horizontal, -1-finished): -1 Initial state Tipping over domino e Time step 1: Il Time step 2: Time step 3: Time step 4: Time step 5: Time step 6: Time step 7: Time step 8: Time step 9: Time step 18 FinishedStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started