CodeLab Academy 📞 9936 6696
← List Scratch · Level 8: Loops + conditions Quiz · 40 points ← #738 #740 →

#739. Add, subtract, add...

When the green flag is clicked, this script runs. What is the value of the **s** variable?
when green flag clicked
set [i v] to (0)
set [s v] to (0)
repeat (3)
change [i v] by (1)
if <((i) mod (2)) = (0)> then
change [s v] by (i)
else
change [s v] by ((0) - (i))
end
end

💡 Not sure? Build it in Scratch and try it out.

🔒 You can solve the first 3 problems without an account. Sign up for free to solve this one!