Alice Community rounding to whole numbers

 rounding to whole numbers
 blaklite Guest   Status: Posts: n/a rounding to whole numbers - 04-30-2009, 01:40 PM in my world i have a skateboard that is both rolling and spinning variable amounts depending on where you set the feet on them. I'm looking for a way to make it so that when the board lands (finishes its spin) it will know whether or not the trick was landed. also, since alice is working with long decimal numbers here, it will need to approximate within a certain range whether the board has spun enough or not. in pseudo: if (board's amount rolled) == (something close to whole number): run trick landed, evaluate trick, etc else: run trick failed is it possible to manipulate numbers like that in alice?
 elementface Guest   Status: Posts: n/a 05-02-2009, 10:16 AM Heres what you could do roll=randomNumber(minimum=roll)(maximum=roll)(inte gerOnly=true) that should turn any floating decimal into an integer. as to rounding, im not sure how it will work, all i know is that it will be an integer

 Thread Tools Display Modes Linear Mode

 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 Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Announcements     Community News and Announcements Alice 3     How Do I?     Works In Progress     Share Your World     Share Custom Classes     Bugs and Trouble Shooting     Suggestion Box Alice 2     How do I...?     Works-In-Progress     Share Worlds     Share Objects     Bugs and Troubleshooting     Suggestion Box Educators     Teaching with Alice     Teaching Using Alice 3     Teaching Using Alice 2     CS Principles and Alice     AP CSA and Intro to Java and Alice     Workshops General Discussion     Questions and Comments     The Lounge