Author |
Message |
endusto
|
Posted: Sun Feb 13, 2005 5:48 pm Post subject: loop question |
|
|
i've checked the manual and stuff but im still not sure how to do this, i know a few other languages, like C++, java ect, and they all have "while loops" so it loops until something equals something else, how do you do that in turing? and, how do you make it so a new variable is created every time? like i have to make something that asks how many courses you have this semester, then it will ask you what you got in each one and find the average, but i dont know how to make a new variable for each mark, if you are asked how many courses you have |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Drakain Zeil
|
Posted: Sun Feb 13, 2005 6:05 pm Post subject: (No subject) |
|
|
Eh? I think you want to use a for..end for, and an array.
code: |
var courses:int
get courses
var grade:array of int 1..courses
for i:1..courses
get grade(i)
end for
|
Is that what you wanted? (note: I haven't used turing in a while, my code code be off by a bit) |
|
|
|
|
|
ssr
|
Posted: Sun Feb 13, 2005 6:09 pm Post subject: (No subject) |
|
|
Do you want
code: | var ha :int
loop
get ha
exit when ha = 5
end loop
|
8) 8) |
|
|
|
|
|
endusto
|
Posted: Sun Feb 13, 2005 7:36 pm Post subject: (No subject) |
|
|
well i want that, but i want it so like, ha1 will be your first mark, ha2 will be your second... ect. |
|
|
|
|
|
ssr
|
|
|
|
|
1337_brad
|
Posted: Sun Feb 13, 2005 8:27 pm Post subject: Uhh... |
|
|
Turing has while loops o.o; *I think* been a while since I turcoded but I am uite sure it does o.o; |
|
|
|
|
|
cycro1234
|
Posted: Mon Feb 14, 2005 8:30 am Post subject: (No subject) |
|
|
Turing does not have while loops |
|
|
|
|
|
ssr
|
Posted: Mon Feb 14, 2005 2:55 pm Post subject: (No subject) |
|
|
I'm just wondering, is there anyway to create arrays or chnage it
like depends on how many numbers the user entered, teh number of arrays are created.
using loops
and blah blah
8) 8) |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Tony
|
Posted: Mon Feb 14, 2005 3:13 pm Post subject: (No subject) |
|
|
cycro1234 wrote: Turing does not have while loops
sure it does
Turing: |
loop
...
exit when not(condition)
end loop
|
ssr wrote: something about arrays
yes - Flexible Arrays
|
|
|
|
|
|
ssr
|
Posted: Mon Feb 14, 2005 8:32 pm Post subject: (No subject) |
|
|
WOWOWOWOW
thanx Tony,so thats what its for
I was just wondering what a flexible array is. |
|
|
|
|
|
StarGateSG-1
|
Posted: Tue Feb 15, 2005 12:20 pm Post subject: (No subject) |
|
|
Not to be rude but if you already know some java and C++ why are you leanring turing
Turing is only good if you don't know any other language at teh time
If it is a school course talk to your teacher about advancing your skills not back tracking 8) |
|
|
|
|
|
ssr
|
Posted: Tue Feb 15, 2005 4:23 pm Post subject: (No subject) |
|
|
I only know a little java and still learning, and I dont know any C++?
ummm |
|
|
|
|
|
Bacchus
|
Posted: Tue Feb 15, 2005 11:20 pm Post subject: (No subject) |
|
|
i think he wa stalking about endusto |
|
|
|
|
|
ssr
|
Posted: Wed Feb 16, 2005 12:13 pm Post subject: (No subject) |
|
|
Blah
use Quote: lalala
anyway I like Turing.. |
|
|
|
|
|
cycro1234
|
Posted: Wed Feb 16, 2005 7:10 pm Post subject: (No subject) |
|
|
Turing is great if u've never done ne programming in the past, like me |
|
|
|
|
|
|