Alice Community  

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

View Poll Results: what version of alice supports levels
1 1 50.00%
2 0 0%
3 0 0%
none 0 0%
unknown 1 50.00%
Voters: 2. You may not vote on this poll

Reply
 
Thread Tools Display Modes
make a door open using a random number
Old
dmitchell
Guest
 
Status:
Posts: n/a
Question make a door open using a random number - 06-04-2009, 12:50 PM

i want a door to open if the player gets the random number corect but hoew can i.
please help fast project due the 16th
please help.i need this anwsered soon next week i dont have computer acses so i need a anwser today

Last edited by dmitchell; 06-05-2009 at 10:17 AM.
   
Reply With Quote
please help
Old
dmitchell
Guest
 
Status:
Posts: n/a
Lightbulb please help - 06-05-2009, 08:37 AM

Quote:
Originally Posted by dmitchell View Post
i want a door to open if the player gets the random number corect but hoew can i.
i need help quick because the project is due next friday please help me
the following link links to a page that helped solve all other issues but this issue was not there.
http://www.tech4dreams.com/
i advise that if you have a problem look there but please do help me

Last edited by dmitchell; 06-05-2009 at 08:46 AM.
   
Reply With Quote
got it
Old
dmitchell
Guest
 
Status:
Posts: n/a
Default got it - 06-05-2009, 10:29 AM

i figured it out so heres how:


door open's Code
Created by: david mitchell
doorway
Methods
doorway.open ( )
pick = 0
Do in order
doorway say well hello to get past me you must guess the secret number.get it right and you can pass get it wrong 5 times and you loose
Loop 5 times times
pick set value to ( ask user for a number question = Enter a Number: )
If ( pick < ( random number minimum = 0 maximum = 10 integerOnly = true ) )
doorway say ha thats not right
Else
If ( pick > ( random number minimum = 0 maximum = 10 integerOnly = true ) )
doorway say ha thats not right
Else
If ( pick == ( random number minimum = 0 maximum = 10 integerOnly = true ) )
Do together
doorway say hey your a smart guy; you got it right.you may now pass
doorway.door turn right 0.25 revolutions
Else
doorway say ha thats not right




hope that helps anyone else that had trouble
   
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 ©2018, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.