here is the CLOCKFACE script...coded in 3 MINUTES...17 LINES of CODE
Dennis Brown
see3d at writeme.com
Mon May 30 13:04:28 EDT 2005
Nice! I learn something every minute on this list --four heads are
better than one. I do believe that the clock is down to its essence
now. Every line does something essential, except displaying the
"Time" field to check its accuracy. I put the latest version in my
user space also (see3d).
For the next exercise: Students (Ben) should use the principles
learned here to make the clock chime (beep) the hour on the hour one
second between chimes (better add a checkmark button to turn off
chimes -- if you want to keep your sanity).
Dennis
On May 30, 2005, at 12:22 PM, Geoff Canyon wrote:
> I had just finished swapping out my clunky send...in loop code for
> something similar to yours when I checked mail and saw yours. I
> took two steps:
>
> put the long seconds into t
> send in (something based on t - trunc(t)
>
> Your method of the long seconds mod 1 is of course much better. But
> you don't have to convert to ticks. Sending in a fraction of a
> second works fine and reads better imho.
>
> So here's what I have up now. This generally hits within a
> thousandth of a second:
>
> on openCard
> setTime
> end openCard
>
> on setTime
> put word 1 of the long time into T
> put T && the long seconds into fld "time"
> set the itemDelimiter to ":"
> set the startangle of grc "hour" to 90 - (30 * item 1 of T) -
> (item 2 of T) / 2
> set the startangle of grc "minute" to 90 - (6 * item 2 of T) -
> (item 3 of T) / 10
> set the startangle of grc "second" to 90 - (6 * item 3 of T)
> send "setTime" to me in (1 - (the long seconds mod 1)) seconds
> end setTime
>
> As before, the stack is available by executing this in the message
> box:
>
> go stack url "http://www.inspiredlogic.com/rev/clock.rev"
>
>
> On May 30, 2005, at 9:01 AM, Dennis Brown wrote:
>
>
>> I love this clock example. Just so simple. You guys are great!
>> I could not resist seeing how the thinking was progressing and
>> took it to the next step. Fewer lines, more accuracy (I have
>> often noted that the simplest most elegant solutions take the most
>> time to create and the least time to understand). As Ben
>> suggested, this clock should be a standard example for new users
>> to look at. I will also add it to my revOnline user area (see3d)
>> as soon as today's connect problem is fixed.
>>
>>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
More information about the use-livecode
mailing list