Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
Random boolean list
Old
rico
Guest
 
Status:
Posts: n/a
Default Random boolean list - 05-17-2010, 02:28 PM

Hey to all.

I have a world variable which is a list with boolean values. I want every time i run the simulation, each item to take a random value (true or false). I tried this
when the world starts :



but the items still have the value that i gave them in the creation of the list.

Any ideas are welcome
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 05-17-2010, 04:55 PM

Its because it is setting the variables true 50% of the time, but you are not specifying to set it to false anywhere, it can only turn true.


Check out my best projects so far and please comment:

Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
   
Reply With Quote
Old
rico
Guest
 
Status:
Posts: n/a
Default 05-18-2010, 03:46 AM

Thank you Dameria for your answer It worked!
   
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



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