<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p><br>
</p>
<meta content="text/html; charset=UTF-8">
<div class="PlainText">
<div id="x_divtagdefaultwrapper" style="font-size:12pt; color:#000000; font-family:Calibri,Arial,Helvetica,sans-serif">
<p>It may help if you visualize how a clock works. For the run method:</p>
<p><br>
</p>
<p>   The minutes counts from zero to 60 (increment clock.minutes by 1)</p>
<p>   When minutes reach 60 (if clock.minutes >= 60)</p>
<p>       minutes are reset to zero (clock.minutes set value to 0)</p>
<p>       increment clock.hours by 1</p>
<p>       when hours reach 12 (if clock.hours >=12)</p>
<p>           hours are reset to zero (clock.hours set value to zero)</p>
<p><br>
</p>
<p>That's the model of a clock.  All you need to do for the view part is add a <br>
</p>
<p>       "clock.minuteHand roll left 1/60" after the <span>increment clock.minutes by 1</span></p>
<p>and a "clock.hourHand roll left 1/12" after the <span>increment clock.hours by 1</span></p>
<p><span><br>
</span></p>
<p><span>finally add a "wait (waitTime seconds)" at the bottom of the clock.run edit window</span></p>
<p><span>where the waitTime variable is set to 60 for normal speed, 1 for 60 times normal speed, and 1/60 for 3600 times normal speed</span><br>
</p>
<p><br>
</p>
<p>All three variables should be created in the clock <b>properties </b>tab.</p>
<p>otherwise seconds is reset to zero every time clock.run is invoked.</p>
<p>(How do I know this? "you learn from mistakes")</p>
<p><br>
</p>
<p>The best way to have the clock "run" continuously is to</p>
<p>"create new event" "when the world starts" in the Alice 2 event area. <br>
</p>
<p>right-click change to "while the world is running"</p>
<p>then drag the clock "run" method onto the "during" part<br>
</p>
<p><br>
</p>
<p>The other methods and functions you mentioned would interact with the hours, minutes, and
<span>waitTime </span>variables as described in the requirements</p>
<p><br>
</p>
<p>I can make suggestions about them if you need help. Just email me at</p>
<p>robert.durtschi@gcsu.edu</p>
<p><br>
</p>
<p>Best</p>
<p>Bob Durtschi<br>
</p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="LPBorder_GT_14774749433560.1761083837292855" style="margin-bottom: 20px; overflow: auto; width: 100%; text-indent: 0px;">
<table id="LPContainer_14774749433430.09623464460266529" style="width: 90%; background-color: rgb(255, 255, 255); position: relative; overflow: auto; padding-top: 20px; padding-bottom: 20px; margin-top: 20px; border-top: 1px dotted rgb(200, 200, 200); border-bottom: 1px dotted rgb(200, 200, 200);" cellspacing="0">
<tbody>
<tr style="border-spacing: 0px;" valign="top">
<td id="TextCell_14774749433460.7661053318268497" style="vertical-align: top; position: relative; padding: 0px; display: table-cell;" colspan="2">
<div id="LPRemovePreviewContainer_14774749433470.45363676889706595"></div>
<div id="LPTitle_14774749433470.9895458536279317" style="top: 0px; color: rgb(0, 120, 215); font-weight: 400; font-size: 21px; font-family: "wf_segoe-ui_light","Segoe UI Light","Segoe WP Light","Segoe UI","Segoe WP",Tahoma,Arial,sans-serif; line-height: 21px;">
<a id="LPUrlAnchor_14774749433500.5044663136321226" style="text-decoration: none;" href="https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers" target="_blank">Alice Teachers List - Carnegie Mellon University</a></div>
<div id="LPMetadata_14774749433510.7803442086776408" style="margin: 10px 0px 16px; color: rgb(102, 102, 102); font-weight: 400; font-family: "wf_segoe-ui_normal","Segoe UI","Segoe WP",Tahoma,Arial,sans-serif; font-size: 14px; line-height: 14px;">
lists.andrew.cmu.edu</div>
<div id="LPDescription_14774749433540.8740954907019721" style="display: block; color: rgb(102, 102, 102); font-weight: 400; font-family: "wf_segoe-ui_normal","Segoe UI","Segoe WP",Tahoma,Arial,sans-serif; font-size: 14px; line-height: 20px; max-height: 100px; overflow: hidden;">
Alice is an engaging, introductory programming environment for the creation of animations and games using 3D models. Alice features a drag-and-drop interface that ...</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
Message: 1<br>
Date: Mon, 24 Oct 2016 15:50:08 -0400<br>
From: "Nichols, Denise" <dnichols@yorkcatholic.org><br>
To: alice-teachers@lists.andrew.cmu.edu<br>
Subject: alice-teacher Help Needed: Alice 2.4 Clock Project<br>
<br>
I am using the *Alice in Action* textbook written by Joel Adams.  In<br>
Chapter 4 Flow Control, there is a programming project that my class and I<br>
just cannot figure out.  I have the solution file, but we are not sure how<br>
it was coded.  Does anyone have any suggestions?<br>
<br>
Here is the directions from the textbook:<br>
<br>
Programming Project 4.10<br>
>From the Alice Gallery, choose a clock class that has subparts for the<br>
minute and hour hands.<br>
<br>
a. Build a clock method named *run ( )* that moves the minute and hour<br>
hands realistically (that is, each time the minute hand compeltes a<br>
rotation, the hour hand should advance 1 hour). Define a parameter named<br>
*speedUp* that controls the duration of the hand movements, such that* run<br>
(0) *will make the clock run at normal speed, *run (60)* will make the<br>
clock run at 60 times its normal speed, run* (3600) *will make the clock<br>
run at 3600 its normal speed, and so on.<br>
<br>
b. Build a clock method *setTime(h, m)* that sets the clock's time to *h:m*<br>
(*m* minutes after hour *h*).<br>
<br>
c. Build three functions for your clock: one that returns its current time<br>
(as a *String*), one that returns its current hours value (as a *Number*),<br>
and one that returns its current minutes value (as a *Number*).<br>
<br>
d. Build a clock method *setAlarm (h, m) *that lets you set the clock's<br>
alarm to *h:m.*  Then modify your *run( ) *method so that when the clock's<br>
current time is equal to *m* minutes after hour *h*, the clock plays a<br>
sound.<br>
<br>
Any ideas or suggestions would be appreciated.  Thanks so much!<br>
<br>
Denise Nichols<br>
*Computer Teacher*<br>
*York Catholic High School*<br>
*dnichols@yorkcatholic.org <dnichols@yorkcatholic.org>*<br>
*717-846-8871*<br>
<br>
</div>
<font size="2"><span style="font-size:10pt"></span></font></div>
</body>
</html>