Computer Programming in Upper School with Mr Freeman
Autumn term with Python IDLE
IDLE is Python’s Integrated Development and Learning Environment.
Below is an able Y6 pupil’s text based adventure game with some bugs
(grammatical and computational) still to correct.
import random
def start_scene():
options = ["Welcome to my text based game","Greetings!","Read below to start your adventure"]
print (random.choice(options) +
"\nYou are in a abandoned mansion.You can see two doorways,one on the top of a flight of stairs,one
straight in front of you. \n\
You have two choices, labelled 1 and 2.")
choice = input ("Choose 1 for up the stairs or 2 for the front door: ")
if choice == "1" :
scene1()
elif choice == "2":
scene2()
else:
options = ["That's not one of the choices! \n", "Please choose from the options given!\n", "Sorry I
didn't understand that option!\n"]
print(random.choice(options))
start_scene()
def scene1():
print ("You are now in what is presumably a bedroom.The bedsheets are torn and the curtains are
ripped.You can see two doors, either side of you. \n\
You have two choices, labelled 3 and 5.")
choice = input ("Choose 3 for the left door or 5 for the right door: ")
if choice == "3" :
scene3()
elif choice == "5":
scene5()
else:
options = ["That's not one of the choices!", "Please choose from the options given!", "Sorry I didn't
understand that option!"]
print(random.choice(options))
scene1()
def scene2():
print ("Now you find yourself in the main kitchen.You see a knife and a bag of flour.You can hear a soft
cackling noise to the right.There are two doors either side. \n\
You have two choices, labelled 4 and 6.")
choice = input ("Choose 4 for grab the knife and go to the laughing or 6 for grab the flour and run: ")
if choice == "4" :
scene4()
elif choice == "6":
scene6()
else:
options = ["That's not one of the choices!", "Please choose from the options given!", "Sorry I didn't
understand that option!"]
print(random.choice(options))
scene2()
def scene3():
print ("You are now in a bathroom.You can see a small bath and shower.But you can also see
something else - blood\n\
there are two doorways, one in front of you and one to the left.You have two choices,labelled 7 and 9.")
choice = input ("Choose 7 fot the left door or 9 for one in front of you:")
if choice == "7" :
scene7 ()
elif choice == "9" :
scene9 ()
def scene4():
print ("You go into the room with the knife, but no-one is there.\n\
You can either double back on yourself or go in the door in front of you.You have two choices,labelled 8
and 10.")
choice = input ("Choose 8 for double backing on yourselfn or 10 for running ahead")
if choice == "8" :
scene8 ()
elif choice == "10" :
scene10 ()
def scene5():
options = ["This is a dead end!", "It's game over for you!", "Sorry, that's all we've got time for!"]
print (random.choice(options) +
"\nThe game ends here.")
options = ["This is a dead end!", "It's game over for you!", "Sorry, that's all we've got time for!"]
print (random.choice(options) + \
"\nThe game ends here.")
start_scene()
Spring term with Scratch
Scratch is a free to download visual programming language that uses blocks of
code that can be snapped together to form a computer program.
Scratch maths with Y5 and Y6
“Mathematics and programming in schools have a longstanding and intertwined
history. Programming in schools has been shown to have the potential to
develop higher levels of mathematical thinking in relation to aspects of
number and mathematical abstraction as well as problem solving abilities. More
recently, attention has been paid to defining ‘computational thinking’ (CT)
which could be considered as a specific aspect of mathematics thinking. This
relationship helps to explain why programming and computer-based mathematical
instruction have been found to have a positive effect on both student
attitudes, and on attainment in mathematics, particularly for lower ability
students.” http://www.scratchmaths.org/the-project/
Below is an example from a Y6 pupil:
Scratch code
Pattern produced (may not be to
scale)
Summer term with Scratch
FMSLogo
“FMSLogo is a free implementation of a computing environment called Logo,
which is an interactive programming language that is simple, powerful, and
best of all fun. You can download FMSLogo from the project portal on
SourceForge.” http://fmslogo.sourceforge.net/
Below is an example from a Y6 pupil:
FMSLogo code
to 1a
repeat 3[fd 100 rt 120]
end
to 1b
repeat 3[1a rt 120]
end
to 1c
repeat 5[1a rt 72]
end
to 1d
repeat 17 [1a rt 360/17]
end
to 2a
fd 100
1a
bk 100
end
to 2b
repeat 3[2a rt 120]
end
to 2c
repeat 5[2a rt 72]
end
Pattern produced (may not be to scale)
to 2d
repeat 17[2a rt 360/17]
end
to 3a
repeat 4[1a fd 100 lt 90]
end
to 3b
repeat 7[1a fd 100 lt 360/7]
end
to 4a :size
repeat 3[fd 20*:size rt 120]
end
4a 1
4a 5
4a 10
to 5a :size
fd 20*:size
repeat 3[fd 20*:size rt 120]
bk 20*:size
end
5a 1
5a 5
5a 11
© Copyright 2026 Paperzz