# Khan/khan-exercises

Switch branches/tags
Nothing to show
Fetching contributors…
Cannot retrieve contributors at this time
117 lines (106 sloc) 5.68 KB
 Telling time 2
randRange(1, 12) randFromArray([15, 20]) randRange(0, (60 / MINUTE_INCREMENT) - 1) * MINUTE_INCREMENT
MINUTE === 0 MINUTE > 5 ? MINUTE : "0" + MINUTE HOUR + ":" + NICE_MINUTE

Set the clock to TIME.

init({ range: [[-4.5, 4.5], [-4.5, 4.5]], scale: 30 }); clock = addInteractiveAnalogClock({ radius: 3.75, minuteTicks: 60, minuteIncrement: MINUTE_INCREMENT });
Drag the two hands so the clock reads HOUR:NICE_MINUTE.
clock.getHandPositions()
return clock.validate(guess, MINUTE, HOUR);
clock.minutePoint.moveTo(guess[0][0], guess[0][1], true); clock.hourPoint.moveTo(guess[1][0], guess[1][1], true);

The hour hand is the short blue bar and the minute hand is the long red bar.

The number after the \Large{:} symbol represents the number of minutes past the hour. So TIME represents \red{MINUTE} minutes past hour \blue{HOUR}.

Since it's MINUTE minutes past the hour, the minute hand should be at the mark numbered \red{12}.

Since it's MINUTE minutes past the hour, and there are 5 minutes per tick mark, the minute hand should be at the mark numbered \red{fraction(MINUTE, 5) = MINUTE/5}

Since it's 0 minutes past the hour, the hour hand should be right on the \blue{HOUR} hour mark.

Since it's MINUTE minutes past the hour, the hour hand will have traveled \blue{fraction(MINUTE, 60) = fraction(MINUTE, 60, false, true)} of the way to the HOUR + 1 === 13 ? 1 : HOUR + 1 hour mark.

So the hour hand needs to be placed just before the second small tick mark past the \blue{HOUR} hour mark.

So the hour hand needs to be placed just past the third small tick mark past the \blue{HOUR} hour mark.

So the hour hand needs to be placed just past the first small tick mark past the \blue{HOUR} hour mark.

So the hour hand needs to be placed between the second and third small tick mark past the \blue{HOUR} hour mark.

So the hour hand needs to be placed just before the fourth small tick mark past the \blue{HOUR} hour mark.

clock.showCorrectTime(MINUTE, HOUR);