
-----------------------------------
crazygurl
Thu Apr 07, 2005 7:27 pm

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

-----------------------------------
Delos
Thu Apr 07, 2005 7:42 pm


-----------------------------------
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.

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 
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.


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
Thu Apr 07, 2005 7:58 pm


-----------------------------------
Is there a menu tutorial? I might make one.
