Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Need Help coding a Clock program = Gmail Invite.
Index -> Programming, Turing -> Turing Help
Goto page Previous  1, 2, 3
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Dan




PostPosted: Thu Jun 24, 2004 6:58 pm   Post subject: (No subject)

I tested them and i got the same for values for both, i even tryed diffrent lengths for the dealys and got the same.
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
Sponsor
Sponsor
Sponsor
sponsor
the_short1




PostPosted: Thu Jun 24, 2004 7:06 pm   Post subject: (No subject)

i guess it only effects the really slow comps like mine.,..




dam...


i take back some of my argument..
cbc




PostPosted: Wed Jul 07, 2004 8:09 pm   Post subject: (No subject)

shudnt Time.Delay and delay be the same thing?

its just like locate and Text.Locate

colour and Font.Colour
etc...
Delos




PostPosted: Wed Jul 07, 2004 8:16 pm   Post subject: (No subject)

Theoretically yes. But in practise, one finds that delay() is less reliable for cross-platform compatibility than Time.Delay() is.

In other words...a
delay (500)
is less likely to give you that desired half second pause than a
Time.Delay (500)
on a variety of computers.

This is due to the fact that Turing works its processor around the CPU speed...yeah...that thing...
Thus being...delay()s can really screw up, especially in programmes in which graphics/audio must sync...
Mazer




PostPosted: Wed Jul 07, 2004 8:52 pm   Post subject: (No subject)

Ya sure about that? AFAIK, delay() is the same function as Time.Delay() that HoltSoft has available for those that don't want to type as much. Just like drawfillbox() vs Draw.FillBox().
Delos




PostPosted: Wed Jul 07, 2004 9:16 pm   Post subject: (No subject)

I'm not entirely positive about it...I do know that the whole Draw./Time. thing came into play after Holt moved to OOT...the older commands being intrinsic in Classic Turing...so, to allow for some backward compatibility, the left them in.

I think (note the uncertainty) that I tried this out once, using delay() vs. Time.Delay() w/ the above described combination of graphics and sound...it would seem that the latter form of the command must have caught my attention...otherwise, I mightn't have said what I did...but I could be wrong.
It was a while ago...if ever... Confused .
Clarification anyone?
the_short1




PostPosted: Wed Jul 07, 2004 9:56 pm   Post subject: (No subject)

u sound right delos..


cuz i based my argument on a full program .. meaning.. basically my pacman game with sounds and graphics.... and it played a HUGE role which one i used...

i used Time.Delay for acuracy..
delay () when i was being lazy and it did not matter..
this_guy




PostPosted: Thu Jul 08, 2004 5:54 pm   Post subject: (No subject)

hmmm....interesting

i've always thought they were the same thing, just a different way of calling the same procedure, but i've always prefered writing the non-lazy way
Sponsor
Sponsor
Sponsor
sponsor
the_short1




PostPosted: Thu Jul 08, 2004 7:03 pm   Post subject: (No subject)

the non-lazy way of life.... why? thats so much extra work Razz Wink

all that shift holding... and extra letters...




lol..

Laughing
TheZsterBunny




PostPosted: Sat Aug 07, 2004 8:32 am   Post subject: (No subject)

Yeah, i know this is an old post, but I couldn't resist.

code:

var tod, tup, tap : string
var sc, mn, hr : int
var counter : int := 0
var asec, amin, ahr : real
var fonta : int := Font.New ("Arial:8")
setscreen ("offscreenonly,nobuttonbar,title: Clock Display")
time (tup)
tap := tup

loop
    time (tod)
    if tap not= tod then
        time (tup)
        tap := tup
        hr := strint (tup (1 .. index (tup, ":") - 1))
        tup := tup (index (tup, ":") + 1 .. *)
        mn := strint (tup (1 .. index (tup, ":") - 1))
        tup := tup (index (tup, ":") + 1 .. *)
        sc := strint (tup)
        asec := (sc / 60) * (Math.PI * 2)
        amin := (mn / 60) * (Math.PI * 2)
        ahr := (hr / 12) * (Math.PI * 2)
        cls
        drawoval (maxx div 2, maxy div 2, 42, 42, blue)
        drawoval (maxx div 2, maxy div 2, 58, 58, blue)
        drawoval (maxx div 2, maxy div 2, 62, 62, green)
        drawoval (maxx div 2, maxy div 2, 78, 78, green)
        drawoval (maxx div 2, maxy div 2, 82, 82, red)
        drawoval (maxx div 2, maxy div 2, 98, 98, red)
        Draw.ThickLine (round (sin (ahr) * 55) + maxx div 2, round (cos (ahr) * 55) + maxy div 2, round (sin (ahr) * 45) + maxx div 2, round (cos (ahr) * 45) + maxy div 2, 1, blue)
        Draw.ThickLine (round (sin (amin) * 65) + maxx div 2, round (cos (amin) * 65) + maxy div 2, round (sin (amin) * 75) + maxx div 2, round (cos (amin) * 75) + maxy div 2, 1, green)
        Draw.ThickLine (round (sin (asec) * 95) + maxx div 2, round (cos (asec) * 95) + maxy div 2, round (sin (asec) * 85) + maxx div 2, round (cos (asec) * 85) + maxy div 2, 1, red)
        drawline (maxx div 2 - 1, maxy div 2 + 100, maxx div 2 - 1, maxy div 2 + 110, black)
        drawline (maxx div 2 + 1, maxy div 2 + 100, maxx div 2 + 1, maxy div 2 + 110, black)
        drawline (maxx div 2 + 100, maxy div 2, maxx div 2 + 110, maxy div 2, black)
        drawline (maxx div 2 - 100, maxy div 2, maxx div 2 - 110, maxy div 2, black)
        drawline (maxx div 2, maxy div 2 - 100, maxx div 2, maxy div 2 - 110, black)
        drawoval (maxx div 2, maxy div 2, 112, 112, black)
        Font.Draw (tap, maxx div 2 - (Font.Width (tap, fonta) div 2), maxy div 2 - 4, fonta, black)
        % counter += 1
        % locate (1, 1)
        % put counter
        View.Update
    end if
end loop


okay, the outermost circle (black) is the cardinal points on the clock
the next circle inwards (red) is the seconds
next (green) minutes
next (blue) hours
and finally, in the centre we have the time for all those who are too lazy to figure it out.

-Z
DanShadow




PostPosted: Sat Aug 07, 2004 2:28 pm   Post subject: (No subject)

But...did you read the first part of the post? It was a guy asking us to give him code for a project (or something like that). So you technically just broke our non-cheating rule, even if it is an old post. Please refrain from providing people with complete answers, especially if thats what they are asking for. Like, if somebody asks a question, its better to answer a question, then to provide them with every bit of information they need...it eliminates the learning experience. Anyway...just thought Id add that in. Razz
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 3 of 3  [ 41 Posts ]
Goto page Previous  1, 2, 3
Jump to:   


Style:  
Search: