Explorers – Doubling

Introduction

For our first day back in 2019 we decided to do a simple Paper folding program.

It doesn’t really fold paper though, it just shows you how thick the paper gets when you keep folding it in half! It will get very thick quite quickly!

So we Googled, how thick is a sheet of Paper and we got the number 0.1mm, so quite thin really!

We then Googled a list of items and their heights, so we could write out a message when we reached that height, this was the list we came up with [and a guess of how many folds it would take]:

  • Paper: 0.1mm
  • Baby: 530mm
  • Human: 2 Meters [50]
  • Dublin Spire: 121m
  • Croagh Patrick: 764m
  • Burj Khaleefa: 828m [10,000]
  • Carauntoohill: 1038m [1 billion]
  • Mount Everest: 8848m
  • Galway to America: 6603km [25]
  • Space: 100km
  • Moon:300,000km
  • Mars: 56,000,000 km
  • Sun: 150,000,000 km
  • Pluto: 7,500,000,000 KM

The Program

In order to keep track of how many folds we have done and what height the paper has reached we needed a few variables:

We store the number of folds, and the height in mm, meters and kilometers.

  • folds – to store how many times we have folded the paper
  • mm – to store the height in milimetres
  • metre – to store the height in metres
  • km – to store the height in kilometres

variables

We then made sure that they were all set to the correct value when the Green Flag was clicked.

greenflag

The only one that is not zero is the height in mm which we set the thickness of paper 0.1

Now we can get coding.

We used the Up and Down arrows to fold/unfold the Paper, this would increase/decrease the number of folds and the mm height and then Broadcast to the code that checked everything else.

upanddownarrows

The code that does the checking needs a few IF’s to work out what to do. First of all though it needs to calculate the height in Metres and Kilometres as well.

We used the number of folds to work out if we should be checking the mm, metre or km variable. All we did when we got to a particular height was to Say something on the Screen, but you could do anything you want at these points in the code, maybe show a different sprite or make a sound or something.

This is the code that checked the mm and metre variables

mmandmetre

 

and this is the code that checked the metre and km variables

metreandkm

And if anyone wants the full project, it is availabe on the scratch.mit.edu web site:

User: cdexplorers1819
Password: exploreres1819
Project: Doubling

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s