Alice Community Solution: Use integers as string without decimal

 Solution: Use integers as string without decimal
 TroyFrostwind Guest   Status: Posts: n/a Solution: Use integers as string without decimal - 05-20-2008, 03:34 PM Well, I was looking around, trying to find the solution, and I wasn't getting any response, so I spent some time trying to look for different methods to use an integer in a string (I used mine in a 3D text) without the decimals. It took me some time, but I finally found a way to accomplish this: I'll show you something from my health bar. Also a part of this, I created a number variable (realize, in my health bar example) within the method to help me with the printing. You could actually go around using this variable, but I like having the entire code in sight. Heres how I did it: [world.health] set value to (world.health - world.damaging) [realize] set value to [random number [integer only=true][minimum=world.health][maximum=world.health]] [health meter] set text to [[HP:] joined with [[realize as a string] joined with [100]]] Hope thats not too confusing =D
 Also works for a clock
 stephenmgj Guest   Status: Posts: n/a Also works for a clock - 07-15-2008, 11:10 PM Thanks for putting the missing cog into my clock! I had made the connection with the random number to make an integer but not using the max and min values - very cunning. I will post the clock when I am done.

 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