Author |
Message |
Jekate
|
Posted: Mon Mar 08, 2004 8:20 pm Post subject: (No subject) |
|
|
I got eh first part of the arrat stuff but the second part is confusing.
for i : 1..200
names(i) = " "
end for
is where i got lost.
pls help. |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Paul
|
Posted: Mon Mar 08, 2004 8:21 pm Post subject: (No subject) |
|
|
it gives all 200 of the variables in the names array the value of " " |
|
|
|
|
|
Jekate
|
Posted: Tue Mar 09, 2004 8:19 pm Post subject: (No subject) |
|
|
ok so if i got
for i : 1..200
names(i) = " "
end for
Then I got 200 variables and the value of each variable is whatever I put inbetween the " " correct?
so what if I need to change the variables in the program for example
i need each "i" variable to add 1 each time in a loop like this
i(1) = i(1) + 1
will that work? |
|
|
|
|
|
AsianSensation
|
Posted: Tue Mar 09, 2004 8:25 pm Post subject: (No subject) |
|
|
i(1) = i(1) + 1 increases whatever value i(1) used to have by 1. So if that's what you want, then yes. But notice, if you ran that in a loop, only i(1) will be increased. If you want every element in the array to increase, then you have to do this
for rep: 1..100
i(rep) := i(rep) + 1
end for |
|
|
|
|
|
Jekate
|
Posted: Tue Mar 09, 2004 8:32 pm Post subject: (No subject) |
|
|
ok. I got another problem:
for count : 1..58
name(count) = "0"
end for
it says "name has not been declared"
"count has not been declared" |
|
|
|
|
|
AsianSensation
|
Posted: Tue Mar 09, 2004 8:36 pm Post subject: (No subject) |
|
|
Turing editor is really helpful, cuz it tells you what problem you have and you can see it instantly.
"name not declared" simply means you didnot declare a variable of and array of strings called name. Also, to assign stuff in turing, it's ":=" instead of "=" |
|
|
|
|
|
Jekate
|
Posted: Tue Mar 09, 2004 8:40 pm Post subject: (No subject) |
|
|
I think that's what I got. At the top of the program, the title of it says:
OOT Editor - Object Oriented Turing (3.1.1A (32-bit)) |
|
|
|
|
|
SuperGenius
|
Posted: Wed Mar 10, 2004 10:36 pm Post subject: (No subject) |
|
|
you know dodge, if you're a patient man you could land a job teaching my comp sci class easy. Sure, the pay might not be the best but you get to own the leafs... and the raptors... but no one cares about them. |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Tony
|
Posted: Wed Mar 10, 2004 10:39 pm Post subject: (No subject) |
|
|
you could teach a compsci class just by printing out tutorials from compsci.ca and handing them out |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
recneps
|
Posted: Thu Mar 11, 2004 4:04 pm Post subject: (No subject) |
|
|
Sadly, some of the tutorials here teach me more than my teacher did, just one of em. Whats with teachers these days? :/ |
|
|
|
|
|
Cervantes
|
Posted: Thu Mar 11, 2004 4:27 pm Post subject: (No subject) |
|
|
my teacher taught me relatively little but he's still a great teacher. Compsci is not about learning the syntax of various commands, learning how to use the commands, and learning how to combine various commands and techniques to make a program. Compsci is about doing all that as much as you can by yourself, and about solving your own problems. Compsci teachers should are not like math teachers who stand by the chalkboard and teach concepts and run through various questions. Compsci teachers are more of a guide for students. |
|
|
|
|
|
bevoyleick
|
Posted: Wed Mar 17, 2004 10:12 am Post subject: (No subject) |
|
|
i don't really understand the upper and under part; were those the lines that tells the comp which # are in the upper range/lower range, or is it a predefined command? |
|
|
|
|
|
AsianSensation
|
Posted: Wed Mar 17, 2004 2:21 pm Post subject: (No subject) |
|
|
upper returns the higher bound of array. so code: | var name : array 4 .. 17 of string
put upper (name) | will output 17 to the screen. This is usually used to keep track of the number or positions of elements in an array.
Similarly, lower returns the lower bound of the array, so in the above example, it will return 4. |
|
|
|
|
|
Viper
|
Posted: Fri Nov 26, 2004 12:29 pm Post subject: (No subject) |
|
|
wow after reading this i jus got more confused |
|
|
|
|
|
|