Theo had been looking forward to Coding Club all week. Ms Rivera had promised they would make their own animated story on the classroom tablets.
Theo chose a cartoon cat and wrote the code: when the green flag is clicked, move ten steps, then turn and wave. He clicked the flag. The cat spun round and round like a washing machine and never stopped.
"It's broken!" Theo groaned, and he pushed the tablet away.
Ms Rivera sat down beside him. "It's not broken," she said. "It's got a bug. Every coder gets bugs. The trick is to be a detective." Together they read the code one block at a time. Theo had put the turn block inside a forever loop by mistake, so the cat kept turning for ever.
Theo dragged the block out of the loop and clicked the flag again. The cat walked ten steps, turned and waved. Theo cheered so loudly that the whole club looked up.
The next week, a younger girl called Ivy was close to tears because her rocket would not take off. Theo pulled up a chair. "It's not broken," he told her. "It's got a bug. Let's be detectives."
