One of my teachers wanted some software to do simulations and I said I'm sure I couild knock up something using Scratch
So i've come up with the idea of simulating an analogue (or digital for that matter) clock with second, minute and hour hand/digits.
As I was playing with it, I found myself trying out various ideas and then getting lost as to which one would be best to try to teach
Do you fancy having a go yourselves and see what you come up with.
The idea is to be able to have less able pupils acheive something and the gifted something really good with the rest inbetween (as always is the case!).
Have a play and publish your efforts.
Target age is 8-9 and something must be acheived in 1 hour lesson so the less blocks used the better
Any other ideas for using Scratch to simulate things would be welcome.
regards
Simon
PS
This is open to anyone so if there are any younger Scratchers who'd liek to help out I'd be very grateful
Offline
A clock simulation is actually quite complex, requiring use of the timer, rotational angles and finite number system (ie, counting back to zero when you get to 60).
Whilst thinking about something simpler, I put together this:
http://scratch.mit.edu/projects/Mayhem/110364
See what you think.
Offline
here, i made a fairly simple representation of a clock, but it cant sense the current time(scratch cant do that) so it starts at exactly noon.
look at it on my profile.
Offline
1st off - Please don't look at others code before posting your attempt otherwise I think it will spoil your own original thinking!
Having said that, FPFFelix's project outcome is exactly the sort of thing I was thinking about so it would be a good idea to have a look at it before startinf your own coding running (but don't look at the code if you don't want to corrupt your own original thinking )
@Mayhem
I don't think it needs to be complex - if you think about the way toy clocks worked (or Timex watches for that matter ) when I was little (just a set of simple gears IIRC)
What I'm looking for is code that could be simply explained and taught to a range of 8 year olds (who are possibly familiar with scratch and have done some simple work with it before - (using If Green Flag,next costume and wait to produce simple stop go animations)
regards
Simon
Last edited by SimpleScratch (2008-03-01 16:38:09)
Offline
Here's a slightly different approach. I wanted the hands to move fairly continuously between the clock markings so all the hands move once per second.
http://scratch.mit.edu/projects/Paddle2SeeFixIt/110896
The code is very straightforward. It does use a message to carry the timing pulse to all the hands but it doesn't use the sensor block or use any variables or counting. There are also some scripts to allow setting of the hands but they could be omitted.
More advanced students could turn it into a chiming clock or an alarm clock. Really advanced students could add in phases of the moon or add in a tide level hand.
Last edited by Paddle2See (2008-03-01 20:36:23)
Offline
One of the first clock simulations in scratch was by Graham:
http://scratch.mit.edu/projects/Graham/7266
Nine months ago now.
Offline
@Paddle2See
Very nice - I used the a similar approach myself but not quite as elegant (or as simple in fact )
More advanced students could turn it into a chiming clock or an alarm clock.
Brilliant idea!!!
regards
Simon
Offline
Clever in its simplicity - in my head I wanted it much more complicated but that works beautifully.
Another thing advanced students could do - try to "tie" the hour and minute hand together so that you can only set the clock to a "real" time. (at the moment you can have the hour hand exactly on an hour but the minute hand anywhere)
Offline
kevin_karplus wrote:
One of the first clock simulations in scratch was by Graham:
http://scratch.mit.edu/projects/Graham/7266
Nine months ago now.
This version is very simple...it uses the timer instead of a timing pulse.
There is an error in the constant being used to set the hour hand, however. The constant inthe program is currently 0.0016667 when it should be 0.008333. I know because I made the same mistake when I did my clock. You think the rate for the hour hand should be 1/60 the rate of the minute hand (60 minutes per hour) but really it's 1/12 the rate of the minute hand (12 rotations of minute hand = 1 rotation of hour hand).
Offline
You think the rate for the hour hand should be 1/60 the rate of the minute hand (60 minutes per hour) but really it's 1/12 the rate of the minute hand (12 rotations of minute hand = 1 rotation of hour hand).
Could you run that past us again :confused:
regards
Simon
Offline
BTW - here is my original effort.
http://scratch.mit.edu/projects/SimpleScratch/111185
regards
Simon
Offline
SimpleScratch wrote:
You think the rate for the hour hand should be 1/60 the rate of the minute hand (60 minutes per hour) but really it's 1/12 the rate of the minute hand (12 rotations of minute hand = 1 rotation of hour hand).
Could you run that past us again :confused:
regards
Simon
Simple - its easy to get caught out, thinking that the hour hand should move 1/60th the distance that the minute hand moves, as 1 hour = 60 minutes. Doing that would mean the hour hand moved 1/60th of the distance of the minute hand.
But there are 12 hours on the clock face so when the minute hand makes a full rotation, the hour hand should move 1/12 of a rotation, not 1/60th.
Offline
I'm just going to write this down as I'm thinking
We all seem to be agreed that for every rotation of the secondhand - the minute had should move 1/60th of...
Right - I've worked out at this point where we are deviating from each other.
I agree, In a discrete moving clock, where the minute hand moves on every discrete minute, the hour hand has to move on 1/12th of a rotation every time the minute hand completes a full rotation.
But the same is not true in a pure analogue clock (well the second hand isn't pure in our simulations - but ignorning that discrepancy , all hands are moving every single second so the hour hand does move at a rate of 1/60th of the minute hand.
Does this seem like a workable grand unified theory to you?
regards
Simon
Offline
SimpleScratch wrote:
BTW - here is my original effort.
http://scratch.mit.edu/projects/SimpleScratch/111185
regards
Simon
Thanks, Mayhem, for expanding on my overly terse explanation. To see a derivation of the rotation rates, see the project notes on my original project
http://scratch.mit.edu/projects/Paddle2SeeFixIt/110896
SimpleScratch, you have the same error in your project as Graham does (and I used to have) only, you can actually see it with your project since you have it cranked up so fast.
Offline
SimpleScratch wrote:
I
But the same is not true in a pure analogue clock (well the second hand isn't pure in our simulations - but ignorning that discrepancy , all hands are moving every single second so the hour hand does move at a rate of 1/60th of the minute hand.
The hour hand needs to cover 1 hour in the time it takes for the minute hand to cover 60 minutes. Hence your figure of 1/60.
BUT!
The difficulty lies in the fact that not only do the hands move at different speeds, but the distance travelled means different things depending on the hand.
1 rotation of minute hand = 60 mins
1 rotation of hour hand = 12 hours (not 60!)
One full rotation of the clockface of the minute hand is one hour.
1/60th of a rotation of the clock face by the hour hand is NOT an hour, it is 12 minutes. To cover an hour on the clock face, the hour hand must move 5/60ths of a rotation, (1/12th of a rotation).
Hence Paddle's point that the angle moved by the hour hand needs to be 1/12 of the angle moved by the minute hand, NOT 1/60th
Offline
Doh!
Not much hope for the kids if I can't add up properly in the 1st place
V0.2 has the correction!
http://scratch.mit.edu/projects/SimpleScratch/111436
regards
Simon
Last edited by SimpleScratch (2008-03-02 15:12:26)
Offline
ok, i just made a digital version that is pretty simple if you want to check it out
the only real time it took was importing all the #s
Offline
@FPSFelix - nice work
@everyone
Could you have a look at this project
http://scratch.mit.edu/projects/SimpleScratch/121077
that was written by one of my pupils (ignore any algorithmic errors )
I can't understand why Sprite1 (the hour hand) doesn't seem to respond to its script commands
Is it a bug or am I missing something?
regards
Simon
Offline
Heh - because it is set to "only face left and right" instead of "can rotate"
Offline
Ta
regards
Simon
Offline
The problem is that Sprite1 has the left-right arrow clicked, so it is not allowed to rotate.
Offline
Hello everyone.
Here is my 1st attempt.
http://scratch.mit.edu/projects/MrSleeman/128923
I went for the 3 variables (H, M and S) method.
The second hand moves every pulse, the minute and hour hands only every minute
On my computer you can drag the hands around to set the time (full screen mode) but this does not work when I run it online. Does anyone know why?
Last edited by MrSleeman (2008-03-27 17:29:35)
Offline
MrSleeman wrote:
Hello everyone.
Here is my 1st attempt.
http://scratch.mit.edu/projects/MrSleeman/128923
I went for the 3 variables (H, M and S) method.
The second hand moves every pulse, the minute and hour hands only every minute
On my computer you can drag the hands around to set the time (full screen mode) but this does not work when I run it online. Does anyone know why?
Yes, the problem is that the "On Clicked" event acts differently between the Scratch and the the Online environments. In Scratch, "On Clicked" triggers on Mouse Down but online, "On Clicked" is triggered on Mouse Up. If you switch to a Forever If loop, it should work in both places.
Offline