Computer Science Canada

Time Delay - strings

Author:  Artermis [ Thu Sep 09, 2004 3:09 pm ]
Post subject:  Time Delay - strings

Hi! I am a beginner at comp sci in my first year and I am ever so loving Turing. I'm interested in how to incorporate a time delay in things... let me explain. I found this neat code in the help:

code:
for i : 1 .. 10
            put i
            delay (1000)    % Pause for 1 second
        end for


that goes
1
2
3
with one second in between them.

How would I be able to make it go
a
b
c
with one second in between? I have tried fiddling with it and editing it, but like I said I know very little but the bare basics.

Eventually I'd also like to input strings:
one
two
three
with one second, or 2 seconds in between.

If you anyone could help, thanks a lot!

Author:  Andy [ Thu Sep 09, 2004 3:12 pm ]
Post subject: 

what u need to do i is have a string/array to hold the words for your abc example, just have this

code:

var letters:="abcdefghijklmnopqrstuvwxyz"
for i : 1 .. 26
    put letters(i)
    delay (1000)
end for


as for ur one two three example, u'd have to use an array to hold the words

Author:  Artermis [ Thu Sep 09, 2004 3:32 pm ]
Post subject: 

thanks a lot dodge! is an array difficult to generate?

Author:  Delos [ Thu Sep 09, 2004 3:45 pm ]
Post subject: 

Here's a useful list for you!

Arrays by Dodge
Arrays by Tony
Records by Dodge
Procs, Fcns, Processes by Tony
Iffs by Tony


Many many more available in the Tutorial's section.

Author:  Andy [ Thu Sep 09, 2004 6:01 pm ]
Post subject: 

dammit... i need to get powers in turing section so i can delete tony's array tutorial... mine is soooo much better :p


: