Pages: 1
  Print  
Author Topic: Game End Return Value  (Read 9667 times)
Offline (Male) Goombert
Posted on: April 05, 2014, 11:51:37 pm

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 2991

View Profile
Just curious, why did game_end() never get a parameter? In most programming languages, ie. Java has System.Exit(return);

We should overload it to accept variant or some shit for ENIGMA.
« Last Edit: April 15, 2014, 01:16:04 pm by Robert B Colton » Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Unknown gender) The 11th plague of Egypt
Reply #1 Posted on: April 14, 2014, 07:00:30 am
Member
Joined: Dec 2009
Posts: 274

View Profile
Good idea.
Does it also return something?
Logged
Offline (Male) Rusky
Reply #2 Posted on: April 14, 2014, 09:32:38 am

Resident Troll
Joined: Feb 2008
Posts: 954
MSN Messenger - rpjohnst@gmail.com
View Profile WWW Email
It returns the first argument of the next run of the game, which starts at that call.
Logged
Offline (Male) Goombert
Reply #3 Posted on: April 14, 2014, 02:11:55 pm

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 2991

View Profile
What Rusky? That doesn't make much sense.
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Male) Rusky
Reply #4 Posted on: April 14, 2014, 11:25:58 pm

Resident Troll
Joined: Feb 2008
Posts: 954
MSN Messenger - rpjohnst@gmail.com
View Profile WWW Email
It makes more sense than asking for a return value from System.Quit
Logged
Offline (Male) Goombert
Reply #5 Posted on: April 14, 2014, 11:34:18 pm

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 2991

View Profile
Troll. Anyway, I went ahead and overloaded it per Josh's instructions with an int parameter type for all platforms.

Documentation for the function is here.
http://enigma-dev.org/docs/Wiki/Game_end
This was the commit.
https://github.com/RobertBColton/enigma-dev/commit/5484cbdb1f4fab04618c128cbb4b407bb5a45b22
« Last Edit: April 15, 2014, 12:26:59 am by Robert B Colton » Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Male) Rusky
Reply #6 Posted on: April 15, 2014, 08:51:27 am

Resident Troll
Joined: Feb 2008
Posts: 954
MSN Messenger - rpjohnst@gmail.com
View Profile WWW Email
printf("%d\n", game_end(5))

$ ./game
$ echo $?
5

$ ./game 42
42
Logged
Pages: 1
  Print