RESOURCE-GIB: More on Pedagogy, Computational Thinking, Programs Unplugged, Scratch, Python, Micro:bit and our Bi-robot from UCL

This page is under fairly rapid development for the next week or so from 21st Nov 2016.

Resources for Teachers

As a result of feedback from the course, we will use this Resource page to add further teaching materials and items of interest. Please feel free to comment.

In addition to the 13 Workbooks provided on the USB sticks issued to the group, all Teaching Materials delivered on the Computer Science Training Course for Teachers KS2/KS3 will be sent to each participant by email. Also Rae will include a spreadsheet which details parts, costs (about £50), list of vendors delivering to Gibraltar… for the gib-robot that you built and programmed into life!

Course Summary

Day One

  • Introduction to us and UCL, Round table
  • Computing – where we are, and how we got here
  • Why it’s important
  • The new Computer Science curriculum for Primary and Secondary Schools
  • What we have planned, Discussion
sensors in the playground

sensors in the playground — click to enlarge

National Curriculum Computer Science 2014 --- KS3

National Curriculum Computer Science 2014 for KS3 — click to enlarge

  • Computing Pedagogy, Computational Thinking, ‘Robots’ sorting
  • The 5 Control Structures of Programming
  • Programming ‘Unplugged’, Walkabout on the 2-d grid
  • Programming in Scratch 2.0
Workbook 6: Plug in to Scratch 2.0

Workbook 6: Plug in to Scratch 2.0 — click to enlarge

Day Two

  • Teachers’ “Teach-back” session: Teachers talk of their experience of Computer Science in Gibraltar
  • Practical Programming in Scratch 2.0: Creating patterns with regular geometric figures
writing a series of functions to draw a 3x3 square grid and rotating it through 360 degrees

Click on picture to enlarge

Writing a series of return functions first to draw a square, then a row of squares, and on to build a 3×3 square grid and finally rotating the grid through 360 degrees to produce a pattern

  • Introduction to Python 3
  • Introduction to the BBC micro:bit and Python 3
click on picture to enlarge

click on picture to enlarge

Creating that robot from its basic components: stepper motors, micro:bit, ... and wires! Click to see a close-up

Creating that robot from its basic components: stepper motors, micro:bit, … and wires!
Click on picure to enlarge and again to see a close-up

Twinkle, Twinkle on the Micro:bit in Python

With thanks to Nathan Russell who initiated it, and the ‘composition’ team for the ‘unplugged’ session on the bells, which led to a series of your successful Python programs playing the tune on the micro:bit.
I have added another Python program below (there’s always more than one solution!), which sets up the tune — represented as a data structure, tune --- a list of lists. Each of the internal lists representing a line of the tune — composed of the notes in the line. And the program plays the tune by tracing through tune with a for loop nested in a for loop:

from microbit import *
import music
# Twinkle Star: A python program with the tune stored as a nested list ---
# notes within lines within tune.

tune =
["c4:4","c4:4","g4:4","g4:4","a4:4","a4:4", "g4:8"],
["f4:4","f4:4","e4:4","e4:4","d4:4","d4:4", "c4:8"],
["g4:4","g4:4","f4:4","f4:4","e4:4","e4:4", "d4:8"],
["g4:4","g4:4","f4:4","f4:4","e4:4","e4:4", "d4:8"]

# note the indentations in the code below.
while True:
    for line in tune:
        for note in line:

Music in Scratch: Twinkle, Twinkle

This program’s structure and execution sequence speaks for itself:

Twinkle Twinkle in Scratch 2.0

Twinkle Twinkle in Scratch 2.0

Conversion Table: Musical Notes to Scratch Numeric Values

Scratch conversion table

Scratch conversion table

(Add or subtract 12 to go up or down an octave, respectively).

Solutions in ISPY, Scratch and Python to the 3×3 Grid Drawing

We have achieved a number of human solutions to drawing a 3×3 grid by computational thinking while ‘walking the talk’, or by drawing the grid on paper. In ISPY we have a software facility which enables us to think computationally to devise a solution and produce a program solution by pressing buttons. Solution 4 from involves building the grid by putting together rectangles. We use our used-defined function rectangle (re) and by calling it with an argument 3. (re3), which draws a 3×1 rectangle.

ISPY: The button press program solution

We use the button press ‘newline’ to break up the program into drawing components onto separate lines in the code.

click on picture to enlarge

click on picture to enlarge

Scratch 2.0: We declare our user-function tools using Scratch ‘custom blocks’

Note 1.
We have defined the function ‘startright’ to ensure that the Scratch cat sprite starts and restarts from the original position and direction each time we re-run the program.

Note 2.
We have defined user functions:
sq, (square),
re, (rectangle)
fe (return line) with a parameter p standing for a pace(= 50 pixels/steps in Scratch) in order to write a Scratch program to build the 3×3 square grid in:

Note 3.
Write and run the Scratch versions of the other solutions in Or write one of your own using any or a combination of user-defined functions sq, re, fe: square, rectange and fetch respectively, and the Scratch equivalents for 3 basic instructions fd, lt, rt. in the program

Solution 4. ispython/tao.pdf
This uses a rectangles solution.
repeat 3[re3 lt fd1 rt]
fd1 rt
fd3 rt fd1 lt lt
The equivalent program, true to the original, is written here in Scratch. You can remove the wait instructions.

Click to expand picture

Click on picture to enlarge

Python 3: We declare our user-function tool 'rectangle' (re) at the beginning
click on picture to enlarge

click on picture to enlarge

Leave a Reply