The Imp Computer Prof Paul Curzon Queen Mary, University of London Twitter: @TeachingLDNComp With...
-
Upload
augustine-henderson -
Category
Documents
-
view
221 -
download
0
Transcript of The Imp Computer Prof Paul Curzon Queen Mary, University of London Twitter: @TeachingLDNComp With...
![Page 1: The Imp Computer Prof Paul Curzon Queen Mary, University of London Twitter: @TeachingLDNComp With support from Google,](https://reader036.fdocuments.in/reader036/viewer/2022082418/5697bf9f1a28abf838c94f0b/html5/thumbnails/1.jpg)
The Imp Computer
Prof Paul CurzonQueen Mary, University of London
www.teachinglondoncomputing.orgTwitter: @TeachingLDNCompTwitter: @TeachingLDNComp
With support from Google,
D of E and the Mayor of London
![Page 2: The Imp Computer Prof Paul Curzon Queen Mary, University of London Twitter: @TeachingLDNComp With support from Google,](https://reader036.fdocuments.in/reader036/viewer/2022082418/5697bf9f1a28abf838c94f0b/html5/thumbnails/2.jpg)
Aims• Give you deeper understanding of core topics
– Getting started programming– If statements and flow of control– Compilation, compile-time and run-time
• Give you practical ways to teach computing in a fun, thought provoking way – away from computers, focus on concepts
• Linked activity sheets and booklets can be downloaded from our website:
www.teachinglondoncomputing.org
![Page 3: The Imp Computer Prof Paul Curzon Queen Mary, University of London Twitter: @TeachingLDNComp With support from Google,](https://reader036.fdocuments.in/reader036/viewer/2022082418/5697bf9f1a28abf838c94f0b/html5/thumbnails/3.jpg)
Running programs physically
• A really good way to build a deep understanding of programming constructs is to act out the program
• Compile the program on to people!
• They follow the instructions
• Makes abstract ideas visible and tangible
![Page 4: The Imp Computer Prof Paul Curzon Queen Mary, University of London Twitter: @TeachingLDNComp With support from Google,](https://reader036.fdocuments.in/reader036/viewer/2022082418/5697bf9f1a28abf838c94f0b/html5/thumbnails/4.jpg)
An Insulting Program
We can compile this on to a toilet roll computer
answer = input (“Can I insult you?”)
if answer == “Y”: print (“You smell!”)
else: print (“You smell of roses!”)
print (“Thank you!”)
1
![Page 5: The Imp Computer Prof Paul Curzon Queen Mary, University of London Twitter: @TeachingLDNComp With support from Google,](https://reader036.fdocuments.in/reader036/viewer/2022082418/5697bf9f1a28abf838c94f0b/html5/thumbnails/5.jpg)
Compiling it on to Imps
• Each node is a student– connected by rope.
• You pass in a tube at one end– You are the operating system
• When it is handed back something should be printed on the screen – written on the board
![Page 6: The Imp Computer Prof Paul Curzon Queen Mary, University of London Twitter: @TeachingLDNComp With support from Google,](https://reader036.fdocuments.in/reader036/viewer/2022082418/5697bf9f1a28abf838c94f0b/html5/thumbnails/6.jpg)
What it compiles to …1
answer == “Y”?
Print“You smell!”
Print“Thank you”
Print“You smell of roses!”
True
Falseanswer = input “Can I insult you?”
![Page 7: The Imp Computer Prof Paul Curzon Queen Mary, University of London Twitter: @TeachingLDNComp With support from Google,](https://reader036.fdocuments.in/reader036/viewer/2022082418/5697bf9f1a28abf838c94f0b/html5/thumbnails/7.jpg)
Explaining programming concepts
1
• We’ve made an invisible program tangible• Can now explain all sorts of concepts
– If statements– Control structures – The program counter– Run-time versus compile time
• Similar approach for loops
![Page 8: The Imp Computer Prof Paul Curzon Queen Mary, University of London Twitter: @TeachingLDNComp With support from Google,](https://reader036.fdocuments.in/reader036/viewer/2022082418/5697bf9f1a28abf838c94f0b/html5/thumbnails/8.jpg)
More advanced concepts
1
• Can also explore more advanced ideas– How program changes change structure – Optimizing compilers– Bugs
![Page 9: The Imp Computer Prof Paul Curzon Queen Mary, University of London Twitter: @TeachingLDNComp With support from Google,](https://reader036.fdocuments.in/reader036/viewer/2022082418/5697bf9f1a28abf838c94f0b/html5/thumbnails/9.jpg)
A Snap Program
We can compile this on to a toilet roll computer
card1 = input (“Next card”)card2 = input (“Next card”)
if card1 == “RED” and card2 == “RED”: print (“SNAP!”)
else: if card1 == “BLACK” and card2 == “BLACK”:
print (“SNAP!”)
Print (“Bye”)
1
![Page 10: The Imp Computer Prof Paul Curzon Queen Mary, University of London Twitter: @TeachingLDNComp With support from Google,](https://reader036.fdocuments.in/reader036/viewer/2022082418/5697bf9f1a28abf838c94f0b/html5/thumbnails/10.jpg)
What it compiles to …
card1 == “BLK” & card2 == “BLK”?
Print“SNAP!”
Print“Bye”
Print“SNAP!”
1
True
False
card2 = input “Next card”
card1 = input “Next card”
False
card1 == “RED” & card2 == “RED”?
True
![Page 11: The Imp Computer Prof Paul Curzon Queen Mary, University of London Twitter: @TeachingLDNComp With support from Google,](https://reader036.fdocuments.in/reader036/viewer/2022082418/5697bf9f1a28abf838c94f0b/html5/thumbnails/11.jpg)
Exploring Different Programsif card1 == “RED”:
if card2 == “RED”:
print (“SNAP!”)
else:
if card2 == BLACK:
print (“SNAP!”)
print (“Bye”)
This will compile this in to a different toilet roll computer1
![Page 12: The Imp Computer Prof Paul Curzon Queen Mary, University of London Twitter: @TeachingLDNComp With support from Google,](https://reader036.fdocuments.in/reader036/viewer/2022082418/5697bf9f1a28abf838c94f0b/html5/thumbnails/12.jpg)
What it compiles to …
card2 == “BLK”?
Print“SNAP!”
Print“SNAP!”
1
True
False False
card1 == “RED” ?
card2 == “RED” ?
False
True
True
Print “Bye”
![Page 13: The Imp Computer Prof Paul Curzon Queen Mary, University of London Twitter: @TeachingLDNComp With support from Google,](https://reader036.fdocuments.in/reader036/viewer/2022082418/5697bf9f1a28abf838c94f0b/html5/thumbnails/13.jpg)
Compiler optimization …
• The compiler could optimize the first program – to more compact code, fewer imps needed!
card1 == “BLK” & card2 == “BLK”?
Print“SNAP!”
Print“Bye”
1
True
False
card2 = input “Next card”
card1 = input “Next card”
False
card1 == “RED” & card2 == “RED”?
True
![Page 14: The Imp Computer Prof Paul Curzon Queen Mary, University of London Twitter: @TeachingLDNComp With support from Google,](https://reader036.fdocuments.in/reader036/viewer/2022082418/5697bf9f1a28abf838c94f0b/html5/thumbnails/14.jpg)
Summary
• By compiling the program onto students – You make it visible and tangible– Open it to questions– And exploration
Programming can be introduced in fun ways away from a computer
![Page 15: The Imp Computer Prof Paul Curzon Queen Mary, University of London Twitter: @TeachingLDNComp With support from Google,](https://reader036.fdocuments.in/reader036/viewer/2022082418/5697bf9f1a28abf838c94f0b/html5/thumbnails/15.jpg)
More support
On our website to support this session:• Activity sheets • Story sheets• SlidesDetails of more worskshops/courses• free unplugged sessions• subsidised courses (e.g. GCSE programming)
www.teachinglondoncomputing.orgTwitter: @TeachingLDNCompTwitter: @TeachingLDNComp
![Page 16: The Imp Computer Prof Paul Curzon Queen Mary, University of London Twitter: @TeachingLDNComp With support from Google,](https://reader036.fdocuments.in/reader036/viewer/2022082418/5697bf9f1a28abf838c94f0b/html5/thumbnails/16.jpg)
Thank you!
Together we areTeaching London Computing
www.teachinglondoncomputing.orgTwitter: @TeachingLDNCompTwitter: @TeachingLDNComp