Lesson 5: Coding Mondrian

Pupils learn about the use of random numbers, decompose a program and write an algorithm to create original pieces of artwork.

Before the lesson

Download classroom resources

Learning objective

  • To understand the use of random numbers

National curriculum

Pupils should be taught to:

  • Design, write and debug programs that accomplish specific goals, including controlling or simulating physical systems; solve problems by decomposing them into smaller parts
  • Use sequence, selection, and repetition in programs; work with variables and various forms of input and output

Success criteria

Cross-curricular links

Attention grabber

Main event


Pupils needing extra support: Should be encouraged to explore and modify. Draw their attention to using undo/redo for any accidental deletes.


Pupils working at greater depth: Should be challenged to apply previous knowledge in a new context; e.g. changing the 2D shape that’s repeated.

Wrapping up

Assessing pupils' progress and understanding


Created by:
Sway Grantham,  
Computing specialist
Sway Grantham (@SwayGrantham) is a Primary School Teacher, a CAS Master Teacher and Specialist Leader in Education for Primary ICT. She also has a BCS Certificate in Computer Science Teaching (Primary). She has written several curricula and conducted research into the…
Find out more