promptdojo_

while, break, and the infinite loop AI ships — step 9 of 9

Checkpoint

One last thing before we move on. Same surface as a write step — but the lesson doesn't complete until this passes.

Last one. Cursor wrote a "find the first match" loop that walks through a list of usernames and stops as soon as it finds one starting with "a".

Two things are broken: the loop variable never advances (so it'll loop forever on the first name), and the break is missing — even if the loop did advance, it would scan past the first match.

Fix both bugs so the script prints found: alex.

full-screen editor opens — close anytime to keep reading.