CodeLab Academy 📞 9936 6696
← List Scratch · Level 10: Algorithms Quiz · 50 points ← #902 #904 →

#903. The smallest

When the green flag is clicked, this script runs. What number will the cat say?
when green flag clicked
delete all of [numbers v]
add [17] to [numbers v]
add [98] to [numbers v]
add [24] to [numbers v]
add [50] to [numbers v]
set [smallest v] to (item (1) of [numbers v])
set [i v] to (1)
repeat (length of [numbers v])
if <(item (i) of [numbers v]) < (smallest)> then
set [smallest v] to (item (i) of [numbers v])
end
change [i v] by (1)
end
say (smallest)

💡 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!