<blockquote>
  <p>Please note that I already have a loop encompassing the entire program if the colours are detected in the correct order.</p>
</blockquote>

<p>How about creating another loop for the failure case?</p>

<pre><code>Start loop 1 (correct order)
Start loop 2 (wrong order)
Initialization
Check for colours
  If correct order
    Do something
    End loop 1 (correct order)
  Else
    Do some other thing (or not)
    End loop 2 (wrong order)
</code></pre>

CC BY-SA 4.0
2020-01-14T09:10:33.187Z
2020-01-14T09:10:33.187Z
zovits
<p>I have a program that uses the colour sensor to progress that program. The colours are in a certain order. If the wrong colour is detected, the program stops.</p>

<p>I want to restart the program from the beginning automatically if at any point the wrong colour is detected. Please note that I already have a loop encompassing the entire program if the colours are detected in the correct order.</p>

<ev3><mindstorms>
How to restart/reset a program automatically after stop block
CyberSword
# How to restart/reset a program automatically after stop block

(Asked by: username_0 on 2020-01-14)

I have a program that uses the colour sensor to progress that program. The colours are in a certain order. If the wrong colour is detected, the program stops.

I want to restart the program from the beginning automatically if at any point the wrong colour is detected. Please note that I already have a loop encompassing the entire program if the colours are detected in the correct order.

**Tags:** ev3, mindstorms


---

## 1 answers

### Answer by username_1 on 2020-01-14. Score: 2

Please note that I already have a loop encompassing the entire program if the colours are detected in the correct order.

How about creating another loop for the failure case?
Start loop 1 (correct order)
Start loop 2 (wrong order)
Initialization
Check for colours
  If correct order
    Do something
    End loop 1 (correct order)
  Else
    Do some other thing (or not)
    End loop 2 (wrong order)


---

