Glossary · Phase 0 · Tools
Minimal reproducible example
The fewest lines of code that still show a bug, with the full error: the fastest way to get help, and often to find the bug yourself.
Try it now
The basket should cost 20. Step through and watch total: it's set back to 0 at the start of every pass, because that line is inside the loop. Moving total = 0 above the loop fixes it.
Learn it properly
Finding bugs when nothing crashes · A method for wrong answers: expected against actual, reproduce, look inside, fix one thing. About 30 minutes.
Never trained an AI?
Teach a small one to write, right in your browser. It takes about 20 seconds and needs no account.