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

#914. Counting letters

When the green flag is clicked, this script runs. What number will the cat say?
when green flag clicked
set [word v] to [scratch]
set [c v] to (0)
set [i v] to (1)
repeat (length of (word))
if <(letter (i) of (word)) = [c]> then
change [c v] by (1)
end
change [i v] by (1)
end
say (c)

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