Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   How do I...? (http://www.alice.org/community/forumdisplay.php?f=16)
-   -   how to use the loops and if/else conditions? (http://www.alice.org/community/showthread.php?t=28)

glaze 09-09-2005 12:01 AM

how to use the loops and if/else conditions?
 
hi, :o
my school, iligan capitol college, is probably the first school in the whole philippines or asia that teaches alice. but sad to say our teacher often left us by ourselves, neglecting to teach us the basics.
we do have a hard time using the if and else conditions, the do while loops, do together, do in order, etc.
could you please give me some hints or some infos how to use them?
could you give me some informations on how to create a game or story?
my classmates and i are very interested to learn more about alice but we lack informations.
thank you very much!

glaze

kingsamses 09-09-2005 03:00 PM

If/Else: This will execute code depending on wether a certain condition is met. Like this:
[url="http://img324.imageshack.us/my.php?image=ifelse3xw.gif"][img]http://img324.imageshack.us/img324/7581/ifelse3xw.th.gif[/img][/url]
This code will move the camera forward .5 meters if the variable "number" is greater than two, and backwards if the variable is not greater than two. If the code was executed, the camera would move back.

Do while: This will repeat code until the given condition is not true.
Example:
[url="http://img373.imageshack.us/my.php?image=dowhile3pb.gif"][img]http://img373.imageshack.us/img373/1107/dowhile3pb.th.gif[/img][/url]
This will increase the value of the variable "number" and then wait for one second, repeating until [i]number[/i] is not less than five, then turn the camera.

Do together: This will execute multiple lines of code at the same time.
Example:
[url="http://img373.imageshack.us/my.php?image=dotogether8bo.gif"][img]http://img373.imageshack.us/img373/1641/dotogether8bo.th.gif[/img][/url]
This will spin the camera and move it up at the same time.

Do in order: This will execute lines of code one at a time. This is primarily used inside Do Togethers.
Example:
[url="http://img195.imageshack.us/my.php?image=dotogether1dn.gif"][img]http://img195.imageshack.us/img195/8605/dotogether1dn.th.gif[/img][/url]
This will spin the camera twice, over a two-second period. While the camera is spinning, the ground will change to red, then to blue.

glaze 09-20-2005 11:32 PM

thank you
 
sigh, bad thing we do not have internet in our lab room, it could have been better if we use alice and at the same time got a connection so that we can report bugs easily and we can be taught directly..
can you suggest a good story, just a simple one to create? :confused:


All times are GMT -5. The time now is 09:08 AM.

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