Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   Works-In-Progress (http://www.alice.org/community/forumdisplay.php?f=14)
-   -   Need Help Bowling (http://www.alice.org/community/showthread.php?t=12257)

mandapanda625 07-03-2020 01:16 PM

Need Help Bowling
 
1 Attachment(s)
I am having issues randomizing my pins falling and randomizing the bowling game for my term project. I'm not exactly sure how to execute it. There needs to be a winning and losing aspect as well. any help is appreciated!

djslater107 07-04-2020 02:13 PM

Randomize Bowling Pins Falling
 
Use the [B]For All In Order[/B] control structure with your array of pins.

Also, you will need a count variable of how many pins fall, and use that count to help determine whether you win or lose

Inside the [B]For All In Order[/B] - for each pin
[LIST]
[LI] if (choose true <probability of true> of the time) - from the World functions tab[/LI][LIST]
[LI]pin fall(set duration to very small number so it looks like they are happening together)[/LI]
[LI] increase count by 1[/LI][/LIST][LI] Look at count value to determine win or lose[/LIST]
Hope this helps.

Don Slater
Alice Project


All times are GMT -5. The time now is 05:29 AM.

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