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

Username:   Password: 
 RegisterRegister   
 Linking 3 programs into one --help
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
crazygurl




PostPosted: Thu Apr 07, 2005 7:05 pm   Post subject: Linking 3 programs into one --help

Hi, Im a new programmer

I have an assignment due tommorrow and i have spent a while making a few games. I now want to like them into one game where the player can choose what game they want to play?

Im am using an older version of Turing
I have tried using if commands for the game the player wants to play but it doesnt seem to work. My programs have a series of procedures. I was wondering if somone cold help me on this issue>

Can I put an entire game as a variable like var s=speedy and other games as variables... i am really confusued on how to do this....
can someone pls help me as soon as possible


Thanx
Crazygurl
Sponsor
Sponsor
Sponsor
sponsor
AsianSensation




PostPosted: Thu Apr 07, 2005 7:15 pm   Post subject: (No subject)

You have three games. Let's say you wrote them separately, declared your variables separately (meaning you might have repeat variable names) and you don't want to go back and change everything. Then I suggest compiling each game into an exe form, so you can just use Sys.Exec () to access each game.

Otherwise, you can use include to link three separately written programs into one, provided that you don't have repeating variables.

In the last case, if you've written all three games in one file, and also made them into procedures, then you can always use an if statement.

Turing:
var ans : int

get ans

if ans = 1 then
    ProcTicTacToe
elsif ans = 2 then
    ProcSnake
else
    ProcConnect4
end if
[/code]
Drakain Zeil




PostPosted: Thu Apr 07, 2005 7:48 pm   Post subject: (No subject)

Alternely, you could make each game a procedure. Then make a simple menu...

get option

if option = 1 then
game1
elsif option=2 then
gam2

etc etc...
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  [ 3 Posts ]
Jump to:   


Style:  
Search: