PDA

View Full Version : Real to integer


Hypotenuse Man
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.
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
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.
11-07-2006, 08:06 AM
just

if # then display in a 3d text the number minus the .0

Hypotenuse Man
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
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.:D

Hypotenuse Man
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
11-07-2006, 08:47 AM
hmm i guess it shall require more research!!!:D im off to find out again!!!