Alice Community  

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

Thread Tools Display Modes
Status: Offline
Posts: 38
Join Date: Jan 2010
Default 03-27-2010, 12:09 AM

I'm running 2.2 and the random function works fine for casting to an int (no .0 at the end)

You can do it this way as well.

Create a world function called castInt.

Have it accept a parameter called inValue as a number

for the functions return value set it to random number minimum=inValue, integerOnly=true, maximum=inValue

This will return a number with no decimal place for any number you pass to it.
Reply With Quote

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 ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.