The_Official_Raspberry_Pi_-_Beginner’s_Book_Vol1,_2018 (1)

(singke) #1
Chapter 4 Programming with Scratch^75

THE OFFICIAL RASPBERRY PI BEGINNER’S GUIDE


when clicked

say Hello! British ESA Astronaut Tim Peake here. Are you ready? for^2 secs
wait^1 secs
say Hit Space!
reset timer
wait until key space pressed?

say join Your reaction time was join timer seconds.

set time to timer

set distance to time *^7

wait^4 secs

say join In that time the ISS travels around join kilometres.

Finally, drag a round Operators block into the middle blank space, then drag a distance
reporting block into the new blank space it creates. The round block rounds numbers up or
down to their nearest whole number, so instead of a hyper-accurate but hard-to-read number
of kilometres you’ll get an easy-to-read whole number.


when clicked
say Hello! British ESA Astronaut Tim Peake here. Are you ready? for^2 secs
wait 1 secs
say Hit Space!
reset timer
waituntil key space pressed?

say join Your reaction time was join timer seconds.

set time to timer
set distance to time * 7
wait 4 secs

say join In that time the ISS travels around join round distance kilometres.
Free download pdf