#748. Wrap around
When the green flag is clicked, this script runs. What is the value of the **x** variable?
when green flag clicked set [x v] to (0) repeat (4) change [x v] by (12) if <(x) > (80)> then set [x v] to (0) end end
# When the green flag is clicked
x = 0
for _ in range(4):
x += 12
if x > 80:
x = 0
let x = 0;
// When the green flag is clicked
x = 0;
for (let i = 0; i < 4; i++) {
x += 12;
if (x > 80) {
x = 0;
}
}
💡 Not sure? Build it in Scratch and try it out.