Code - How to Write Code 1
This is a rectangle, but could you write a program to draw one?

Code - How to Write Code 1

This quiz addresses part of the requirements of the National Curriculum KS1 for children aged 5 and 6 in years 1 and 2 in Computing. Specifically it looks at how to write a simple code to draw shapes on a computer screen. It is one of 20 quizzes to help you find out about how computers work, and how they affect all our lives.

Ella is using a computer to draw shapes. A hedgehog on the computer screen walks round the different shapes. Ella is writing code to get the hedgehog to draw the correct shape on the computer screen. In this quiz, Ella is programming the hedgehog to draw a rectangle. The rectangle must be 30cm long and 20cm deep.

Did you know...

You can play all the teacher-written quizzes on our site for just £9.95 per month. Click the button to sign up or read more.

Sign up here
  1. The hedgehog starts in the top left-hand corner of the screen. The hedgehog is ready to go. Remember, the rectangle must be 30cm long. What is Ella’s first line of code?
    The hedgehog walks 30cm right across the top of the screen
  2. The hedgehog is in the top-right corner. Ella wants to make the hedgehog turn the corner so it is ready to walk down the screen. What does Ella code?
    The hedgehog turns right, ready to go down the screen
  3. The rectangle must be 20cm deep. What does Ella code next?
    The hedgehog moves down the screen 20cm. Ella has drawn two sides of the rectangle
  4. The hedgehog is now in the bottom right of the screen. Ella needs to turn the hedgehog so it is facing left, along the bottom of the screen. What code does Ella write?
    Tricky! If the hedgehog turns left, it will go off the screen in the wrong direction!
  5. Ella now writes the code: Forward 30cm.

    What does the hedgehog do?
    The hedgehog has now drawn another side of the rectangle
  6. The hedgehog is now in the bottom left-hand corner of the screen.

    How many sides of the rectangle has the hedgehog drawn so far?
    Altogether, a rectangle has 4 sides. The hedgehog has drawn 3 of the sides so far
  7. The hedgehog is still in the bottom left-hand corner of the screen. The hedgehog is still facing to the left. Ella wants to make the hedgehog face upwards. What should Ella code?
    If the hedgehog turns right, it is soon facing in the right direction
  8. Ella makes the hedgehog finish the rectangle. The rectangle is 20cm deep. What is her last line of code?
    The hedgehog is now back where it started
  9. The hedgehog has now drawn a complete rectangle. How many sides has it drawn?
    A rectangle has 4 sides. How many sides has a triangle?
  10. Ella has drawn a rectangle 30cm by 20cm. Her teacher now asks Ella to draw a rectangle 15cm by 10cm using the hedgehog.

    Ella’s first line of code was: Forward 30cm.

    What is Ella’s new first line of code?
    How much smaller is 15cm than 30cm? - It is half as long

Author: David Bland

The Tutor in Your Computer!

Quiz yourself clever - 3 free quizzes in every section

  • Join us (£9.95/month) to play over 4,000 more quizzes
  • Reinforce your school learning in the comfort of home
  • Build your confidence in National Curriculum subjects
  • Test yourself to identify gaps in learning
  • Revise fast for tests and exams

© Copyright 2016-2017 - Education Quizzes
TJS - Web Design Lincolnshire

Valid HTML5

We use cookies to make your experience of our website better.

To comply with the new e-Privacy directive, we need to ask for your consent - I agree - No thanks - Find out more