3 in 1 game continued help
Author |
Message |
crazygurl
|
Posted: Thu Apr 07, 2005 7:27 pm Post subject: 3 in 1 game continued help |
|
|
okay so a bunch of people have told me to compile my programs and use a sys.exe() to run them.
I am still confused, because I am new at programming. Can someone write me an example of this if i have compiled my game speedy and trivia. I just want a few line of code to get started. Do i write:
put " what game would you like to play? ( speedy, trivia)"
get ans
if ans=speedy then
sys.exe (speedy)
eslif
sys.exe (trivia)
Thank you people, you are very smart and helpful, You are helping me learn new things. Thanks sooo much |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Delos
|
Posted: Thu Apr 07, 2005 7:42 pm Post subject: (No subject) |
|
|
Ok, either the people you were talking to were trying to mess you up or you misunderstood them.
What you have there is a menu system to access to seperate .exe files. You needn't do this. In fact, it would quite messy to do so.
Instead, programme your 'Speedy' and 'Trivia' proggies using seperate modules/procedures, and use a single menu system as you have above to call the main run procedures.
I'm guessing not much of that made sense...don't worry.
This will introduce you to procedures.
And this will intrduce you to modules.
If, however, you want to stick w/ the whole calling seperate .exe files, you just about have it.
code: |
var ans : string
var path1 : string := "speedy.exe"
var path2 : string := "trivia.exe"
put "Speedy (s) or Trivia (t)?"
get ans
if ans = "s" then
put Sys.Exec (path1)
elsif ans = "t" then
put Sys.Exec (path2)
end if
|
Note, I used [code] tags there to do that. Very useful, use them whenever you're posting code.
You'll notice that the Sys.Exec() is used within a put context. This is because Sys.Exec() returns a boolean value (true/false) and thus cannot be called directly.
[edit]
Oh, it was azn who told you that! Ok, take his advice if you can understand it. He's the rice-no-kami you know. |
|
|
|
|
|
Drakain Zeil
|
Posted: Thu Apr 07, 2005 7:58 pm Post subject: (No subject) |
|
|
Is there a menu tutorial? I might make one. |
|
|
|
|
|
|
|