
KS3 Computer Science – FOR Loops, WHILE Loops & Randomness in Small Basic (2026 Updated) | FREE Online Compiler | Dyslexia-Friendly
A fully resourced, dyslexia-friendly KS3 Computer Science lesson introducing FOR loops, WHILE loops, iteration and randomness in Small Basic.
Includes a complete PowerPoint, structured worksheet, model answers and guided coding tasks using the FREE online Small Basic compiler — no installation required. Designed with dyslexia-friendly formatting: pastel backgrounds, accessible fonts, high-contrast code examples and clear step-by-step scaffolding.
Students learn:
- How FOR loops work and how to count up or down
- How the STEP value controls patterns (e.g. +1, -2)
- How WHILE loops work and how they differ from FOR loops
- How Math.GetRandomNumber() creates unpredictable behaviour
- How logical operators such as <> (NOT EQUAL TO) work in conditions
Hands-on programming activities:
- Run a starter program using Math.GetRandomNumber(6) and identify object, operation and parameter
- Explore loop structure and identify the iteration variable
- Debug, modify and experiment with STEP values such as -2
- Implement WHILE loops that run until a condition becomes false
- Write code to count down from 10 to 1 and display “BLAST OFF!”
- Build a countdown game where the program counts down from a user’s chosen number
Challenge extension:
- Convert the countdown game into a WHILE loop that repeats until the user types EXIT
- Extend programs using additional logical conditions and user input
- Encourage deeper reasoning and independence in coding
Assessment and evidence:
- Screenshot prompts for each coding task
- Written explanation boxes to check understanding of loops and logic
- Practical debugging challenges to demonstrate mastery
Lesson objectives:
- Understand how FOR and WHILE loops work
- Use iteration to repeat instructions efficiently
- Explain how random numbers and logic affect program flow
- Write increasingly complex programs using loops and conditions
Perfect for:
- KS3 Computing
- Coding clubs and enrichment
- Cover lessons
- Preparation for Python FOR loops, WHILE loops and the random module
This engaging, structured lesson makes iteration visual, practical and confidence-building — helping students develop real programming fluency.
Something went wrong, please try again later.
This resource hasn't been reviewed yet
To ensure quality for our reviews, only customers who have purchased this resource can review it
Report this resourceto let us know if it violates our terms and conditions.
Our customer service team will review your report and will be in touch.