Alice Community  

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

Reply
 
Thread Tools Display Modes
Help with Randomness..
Old
DonnYYY
Junior Member
 
Status: Offline
Posts: 2
Join Date: Apr 2012
Location: Netherlands
Default Help with Randomness.. - 04-09-2012, 08:35 AM

Hello Everyone!

I'm supposed to make a "educative program" in Alice.
It has to be for children and it's for a school assignment.
But.. I'm having a few problems..
I'm just a beginner, so I don't really know what to do.. but this is what I think should happen, or at least, It's my idea of what I want..

- I need to create a loop(?) that randomly adds one bunny to turn after the player finishes the previous loop.
- A message that says if it's good or right(I now the bunny's already says that, but it doesn't fit because of the random nummer)

Can someone help me with this?
Attached Files
File Type: a2w Konijnen.a2w (1.61 MB, 5 views)
   
Reply With Quote
Old
GameKid
Senior Member
 
GameKid's Avatar
 
Status: Offline
Posts: 467
Join Date: May 2011
Location: My magnificent castle
Default 04-09-2012, 03:09 PM

What you need to do is sneak your movement variable into when the bunnies move so it can record how many times they did it. Look at the "Start" method to see what I mean.
I snuck the variable in and put the feedback stuff in the right place. Here you go.
Attached Files
File Type: a2w BunnyMemory.a2w (922.7 KB, 23 views)


[COLOR=e4eaf2]Your text here[/COLOR]
Come on, you know you want to try it.
   
Reply With Quote
Old
DonnYYY
Junior Member
 
Status: Offline
Posts: 2
Join Date: Apr 2012
Location: Netherlands
Default 04-10-2012, 07:59 AM

Thanks a lot, that helped me out a lot more.
but I still can't figure one thing out.
when you start, al the bunnies move ( I know the loops tells them to) but what I want is that at random the bunnies move..
Like this:
- first round: yellow
- second: yellow, green, green
- third: yellow, blue, pink, yellow, blue
etcetera..
so just a random order of movement which changes every round

I hope someone can help me with this!

Last edited by DonnYYY; 04-10-2012 at 08:02 AM.
   
Reply With Quote
Old
GameKid
Senior Member
 
GameKid's Avatar
 
Status: Offline
Posts: 467
Join Date: May 2011
Location: My magnificent castle
Default 04-13-2012, 09:20 PM

Quote:
Originally Posted by DonnYYY View Post
Thanks a lot, that helped me out a lot more.
but I still can't figure one thing out.
when you start, al the bunnies move ( I know the loops tells them to) but what I want is that at random the bunnies move..
Like this:
- first round: yellow
- second: yellow, green, green
- third: yellow, blue, pink, yellow, blue
etcetera..
so just a random order of movement which changes every round

I hope someone can help me with this!
Oh, poo. A simon. That is what I'm not really good at. But you can fix it with a few more variables. You're going to have to have a maximum amount of times the bunnies turn, though, else we'll be stuck clicking the "New variable" button forever. What you need to do is make 20 (I'm guessing ten's how many bunnies are going to turn) number variables, and sneak them in just like I did with the start method, only there will only be one variable for every turn. Sneak the first variable into wherever the first bunny to spin will come to a verdict. Have it record itself to a certain number depending on which bunny spins, i.e, if the red one spins have it set to "1", the yellow, "2". Fix it up nine more times like this, using the other variables. You will make handy use of the Copy/Paste function, I believe. Then, do the excact same with the rest of the variables only with mouses clicking (events) instead of bunnies spinning. You'll need another number variable to keep track of how many times the mouse has already clicked. Then, use if/else statements to figure out if all of the first ten variables are the same as the next ten.
------------
If you need any more help, I'm still here.


[COLOR=e4eaf2]Your text here[/COLOR]
Come on, you know you want to try it.
   
Reply With Quote
Reply

Thread Tools
Display Modes

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 ©2017, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.