Alice Community  

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

Reply
 
Thread Tools Display Modes
Is there something wrong with random numbers?
Old
dragonmaster905
Member
 
Status: Offline
Posts: 15
Join Date: May 2012
Default Is there something wrong with random numbers? - 05-29-2012, 07:04 AM

My method is as follows
set attack# to random number minimum 0 maximum 1
if attack# == 0
world.fireatk
else
world.thunderatk

For some reason, it always does the thunder atk!! Is there a reason?
   
Reply With Quote
Yep
Old
MrMoke
Senior Member
 
MrMoke's Avatar
 
Status: Offline
Posts: 501
Join Date: Sep 2007
Location: Austin, Texas
Default Yep - 05-29-2012, 06:05 PM

Quote:
Originally Posted by dragonmaster905 View Post
My method is as follows
set attack# to random number minimum 0 maximum 1
if attack# == 0
world.fireatk
else
world.thunderatk

For some reason, it always does the thunder atk!! Is there a reason?
Drag a print from the bottom and put it immediately under the assignment, and use it to print the attack# variable. The problem is not with the language

Last edited by MrMoke; 05-29-2012 at 08:16 PM.
   
Reply With Quote
Old
dragonmaster905
Member
 
Status: Offline
Posts: 15
Join Date: May 2012
Default 05-30-2012, 05:52 AM

K thanks.
   
Reply With Quote
Integer only!
Old
dragonmaster905
Member
 
Status: Offline
Posts: 15
Join Date: May 2012
Cool Integer only! - 05-30-2012, 05:55 AM

Ok, I get it now.
   
Reply With Quote
cool!
Old
MrMoke
Senior Member
 
MrMoke's Avatar
 
Status: Offline
Posts: 501
Join Date: Sep 2007
Location: Austin, Texas
Default cool! - 05-30-2012, 10:59 AM

that troubleshooting technique will come in real handy
   
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 ©2023, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.