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

Username:   Password: 
 RegisterRegister   
 if statement (i got no answers from tutuorial section...
Index -> Programming, Turing -> Turing Help
Goto page Previous  1, 2
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
battleroyale




PostPosted: Thu Apr 14, 2005 1:07 pm   Post subject: (No subject)

so what shuld i learn now?
Sponsor
Sponsor
Sponsor
sponsor
Martin




PostPosted: Thu Apr 14, 2005 1:11 pm   Post subject: (No subject)

How to use procedures and functions. After that, learn about classes, and finally learn about pointers.
battleroyale




PostPosted: Thu Apr 14, 2005 5:37 pm   Post subject: (No subject)

alright...procedures dont...i actually got the basics of GUI. Very Happy .

now im trying to make a lottery game and first problem i got is how to make it so that the numbers you can choose are only between 1-10

i tried putting var number : int:=(1,69) but that didnt work...what should i do?

Surprised

ALso how do you make it so that if statements can contain more then one =

like if blah="a" or "b" or "c"
cuz that doesnt work...but it makes sence though....
Martin




PostPosted: Thu Apr 14, 2005 6:20 pm   Post subject: (No subject)

Look up Rand.Int
battleroyale




PostPosted: Thu Apr 14, 2005 9:06 pm   Post subject: (No subject)

i understand random number already...i just don tknow how to put constraints on the numbers you can choose
jamonathin




PostPosted: Fri Apr 15, 2005 7:46 am   Post subject: (No subject)

You cant put:
code:
If whatever = "this" or "that" then

You need to put whatever again.
code:
If whatever = "this" or whatever = "that" then
Martin




PostPosted: Fri Apr 15, 2005 8:12 am   Post subject: (No subject)

This is because if statements function as follows

if [statement 1] = true or [statement 2] = true or ... then

So what your if statement 'if blah="a" or "b" or "c" ' translates to is:

if (blah = "a") = true or ('b' = true) or ('c' = true) then ..

as you see, although your statement makes sense in english, it doesn't make much sense in Turing.
battleroyale




PostPosted: Fri Apr 15, 2005 2:02 pm   Post subject: (No subject)

ok thanks.....i got it....

NOW lol...how do you make a counter? i cant find the thread...someone give me the link
Sponsor
Sponsor
Sponsor
sponsor
[Gandalf]




PostPosted: Fri Apr 15, 2005 5:26 pm   Post subject: (No subject)

Quote:
If whatever = "this" or whatever = "that" then

hehehe, I didn't know that, I just used case statements - thanks! Very Happy

What do you mean by counter?
code:

var count : int := 1
loop
put count
delay(5)
count += 1
cls
end loop

or
code:

for i : 1 .. 100
cls
put i
delay (10)
end for

both of those can be considered counters?

*edit* grr, thats two of those kinds of posts I've had to do in the same topic Doh!
acidburn90




PostPosted: Wed Apr 20, 2005 9:47 pm   Post subject: (No subject)

yeh thats true... ive been working on turing for a long time (7 months) and i still sometimes have troubles with the GUI...
also one more thing...
someone in this forums did some pretty bad programming...
its bad programming to put
[code]
if answer:= "quit" then
exit
[/code]
its exit when answer:= "quit"
just making u didnt get i9t mixed for anything major[/quote]
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 2 of 2  [ 25 Posts ]
Goto page Previous  1, 2
Jump to:   


Style:  
Search: