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

Username:   Password: 
 RegisterRegister   
 A series of Questions about Turing
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Killa Hilla




PostPosted: Sun Mar 02, 2003 4:13 am   Post subject: A series of Questions about Turing

Ok, I am a beginner at Turing (obvious). Ok I was wondering first if Turing can actually make 3-d Objects. Secondly for If statements... How would I exit the program If the certain Word was typed. For example..So if the certain word like "Good " was entered then the Program would automatically exit.

var answer : string
put " How are you doing today? "
if answer = " Good" then
(this is were i want the exit code entered)
else
put " ok"
end if

Last of all if I was to put a Picture of a guy on the screen how would i make him move with the "Left,Right,Up,Down" arrows?

Thank You
If you know anything of how to do this please Post here.
Sponsor
Sponsor
Sponsor
sponsor
Dan




PostPosted: Sun Mar 02, 2003 4:35 am   Post subject: stuff

1st turing has no real 3d sport but a few poleop are treying to make it have it.

2nd the comand exit will exit out of a loop and the comand return shode stop the progame. but the uses of return dose not demistrate good progmaing ushely so if is for school i whode find a difren way. also the comand exit when wroks like an if and whode exit when the condition is met.

Ex 1.

code:

var answer : string

loop
    put " How are you doing today? "
    get answer
   
    if answer = "good" then
        exit
    else
        put "ok"
    end if
end loop



Ex. 2

code:

var answer : string

loop
    put " How are you doing today? "
    get answer

    exit when answer = "good"
    put "ok"
end loop



3rd. as for the image's and moving them look in the tutoral section for some good tips. i whode sugest thess tutrales:

How to use images in Turing

Character control on screen

Smooth Animation / Moving Background[/url]
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
Killa Hilla




PostPosted: Sun Mar 02, 2003 4:55 am   Post subject: (No subject)

Ok i used your two Code Examples above. When i typed in "good" during the program the Program exited but the Program Window was still open. Is there anyway that I can put a Exit command that will exit the Window as well?

Thanks Smile
Tubs




PostPosted: Sun Mar 02, 2003 7:28 am   Post subject: (No subject)

im pretty sure if you use the 'quit' command it exits the window so just replace exit with quit
Tony




PostPosted: Sun Mar 02, 2003 11:08 pm   Post subject: (No subject)

exit will get you out of the loop
quit will terminate the program.

idealy you would use exit to get out of the loop, then add quit outside the loop, possibly with a getch() command so that program terminates on a keystroke. This way you can output a message saing program ended or something.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
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  [ 5 Posts ]
Jump to:   


Style:  
Search: