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

Username:   Password: 
 RegisterRegister   
 Delay without Delay
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
D4rkM4g3




PostPosted: Tue May 02, 2006 5:09 pm   Post subject: Delay without Delay

Okay, I have to figure out a way to make turing delay without using the actual delay procedure... I have no idea why, it's just a stupid class assignment. Any help would be greatly appreciated.
Sponsor
Sponsor
Sponsor
sponsor
Cervantes




PostPosted: Tue May 02, 2006 5:19 pm   Post subject: (No subject)

How about something like this?

code:

loop
    exit when Time.Elapsed > 1000
end loop
D4rkM4g3




PostPosted: Tue May 02, 2006 5:23 pm   Post subject: (No subject)

Yeah, I thought of that, but we're only supposed to use things we've learned in class (bleh). So far we've only done up to conditional loops (there are some slow people in my class)
HellblazerX




PostPosted: Tue May 02, 2006 5:23 pm   Post subject: (No subject)

Well, one way to do this is to have a loop that keeps running until the certain time is reached. Basically, have a flag keep track of when the delay started by using Time.Elapsed. Basically, you would constantly call Time.Elapsed, and when the time is up, then you exit the loop. This is a pretty stupid assignment.
D4rkM4g3




PostPosted: Tue May 02, 2006 5:32 pm   Post subject: (No subject)

Yeah, stupid, I know. Especially because the only thing we're allowed to use is stuff we've covered in class, not stuff we've learned on our own, which is basically just the basic put, get, variable etc, procedures, and loops. We haven't even done ifs yet.
TokenHerbz




PostPosted: Tue May 02, 2006 5:42 pm   Post subject: (No subject)

You should know for loops, so thats how it goes..

code:

put "delay started"
for i : 1 .. 1000
    for j : 1 .. 1000
    end for
end for
put "DELAY"


[mod:f2262d8193="Delos"]
Oh no TokenHerbz, please don't get mad...Laughing. Edit button was removed a long time ago for good reasons...move along, move along.
[/mod:f2262d8193]
TokenHerbz




PostPosted: Tue May 02, 2006 5:43 pm   Post subject: (No subject)

OMG: Mods: Can you fix that error, i mist "]", and when you do, delete this post i made here...

/me gets mad cause theres no edit button
D4rkM4g3




PostPosted: Tue May 02, 2006 5:46 pm   Post subject: (No subject)

That's exactly what I needed! Thanks.
Sponsor
Sponsor
Sponsor
sponsor
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 1 of 1  [ 8 Posts ]
Jump to:   


Style:  
Search: