Alice Community Real to integer
 User Name Remember Me? Password

 Thread Tools Display Modes
 Real to integer
 Hypotenuse Man Guest   Status: Posts: n/a Real to integer - 11-06-2006, 10:12 PM Hey, I'm working on a 'guess the number' program, and it's going very smoothly except for one thing - where I have Alice output the guess the user inputs, as well as the number of guesses the user has taken, it invariably comes out as a decimal - 50.0, 67.0, 2.0 - but always one ending in '.0'. Is there any way I can force those real numbers into integers? Thank you in advance.
 thewhiterabbit. Guest   Status: Posts: n/a 11-07-2006, 07:40 AM What you are asking is foolish. First off this cant be done with a program such as alice, and plus... 50.0, 67.0, and 2.0 ARE all real numbers. the square root of a neg is an immaginary number. Try using a different program, i dont believe that you can acomplish this with alice.
 Hypotenuse Man Guest   Status: Posts: n/a 11-07-2006, 07:59 AM Yeah, I get that they are all reals. The thing is, I would like to display not 50.0, 67.0, and 2.0, but 50, 67, and 2.
 thewhiterabbit. Guest   Status: Posts: n/a 11-07-2006, 08:06 AM just if # then display in a 3d text the number minus the .0
 Hypotenuse Man Guest   Status: Posts: n/a 11-07-2006, 08:08 AM The thing is, I don't know what the number will be - I'm trying to output a variable that's got the offending number in it.
 thetrippster Guest   Status: Posts: n/a 11-07-2006, 08:42 AM umm there is a function to force it to display real number without decimels let me look it up 1.click more in the random number tile(purple) and select interger only and true in the pull down menu. that shoudl only give u numbers without decimels. so yes it is possible to do this in alice.
 Hypotenuse Man Guest   Status: Posts: n/a 11-07-2006, 08:45 AM Thanks man, I appreciate it, but I had tried that already - that only forces the random number to be an integer. Everything else is still a real number.
 thetrippster Guest   Status: Posts: n/a 11-07-2006, 08:47 AM hmm i guess it shall require more research!!! im off to find out again!!!

 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