Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   How do I...? (http://www.alice.org/community/forumdisplay.php?f=16)
-   -   How do you make a variable you make work? (http://www.alice.org/community/showthread.php?t=6751)

Jones989 06-13-2011 12:34 PM

How do you make a variable you make work?
 
I need help with a game I am making. I want to make a variable that is called world.forever that will ask the player if he wants to play forever or not. I already know how to make Alice ask, but how do i make it go forever if the variable is true and and not if its false?

TauTrumpsPi 06-13-2011 01:04 PM

Well, if the variable is a number variable, and the person says "yes" to play forever, then have the variable to set value to infinity. (just type infinity into the custom numbers)

David B 06-13-2011 01:12 PM

1 Attachment(s)
You could use an if/else method. See the attached program for an example. The text will tell you what the variable is set to, and to gurantee no errors, I have put a watch on the variable so you can see the actual variable.

I hope this helps.

Jones989 06-13-2011 03:04 PM

Thanks both of you! Now I guarantee that the game will be finshed [I]Eventually...[/I]

David B 06-13-2011 03:45 PM

[QUOTE=Jones989;37365]Thanks both of you! Now I guarantee that the game will be finshed [I]Eventually...[/I][/QUOTE]

Your welcome! Anytime you need help, just ask.


All times are GMT -5. The time now is 10:08 PM.

Copyright ©2019, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.