help with science fair question

Non-platform specific questions.

help with science fair question

Postby tlah » Sat Jul 05, 2008 12:41 pm

I am making a code in game editor for my upcoming science fair. I need it to write a random number from 1-6, without deciamls. So far, it says stuff like "4.7185386914". help me!
User avatar
tlah
 
Posts: 66
Joined: Sun Apr 06, 2008 12:10 pm
Location: In your head, readin' ur mind
Score: 2 Give a positive score

Re: help with science fair question

Postby Thanx » Sat Jul 05, 2008 2:48 pm

I don't think you've been using the
rand
function, have you?
rand(6); or rand(5) + 1;
that should do it, and as far as I know, it gives integers back doesn't it?
or else:
do this: I know you used some function, do this:
round(the function used);
that'll rond the double to the closest integer!
:wink: Cheers! Good luck with the science fair! :) 8)
http://www.youtube.com/watch?v=XyXexDJBv58
http://www.youtube.com/watch?v=Be4__gww1xQ
These are me and playing the piano (second one with a friend/fellow student)
Hope you watch and enjoy!
User avatar
Thanx
 
Posts: 314
Joined: Sat Jan 26, 2008 10:07 pm
Location: Home sweet home! :)
Score: 24 Give a positive score

Re: help with science fair question

Postby tlah » Sat Jul 05, 2008 5:43 pm

Thanx wrote:I don't think you've been using the
rand
function, have you?
rand(6); or rand(5) + 1;
that should do it, and as far as I know, it gives integers back doesn't it?
or else:
do this: I know you used some function, do this:
round(the function used);
that'll rond the double to the closest integer!
:wink: Cheers! Good luck with the science fair! :) 8)

thanks! i have been using rand(6) and unsucsessfully tried round. I'm gonna try the round function your way.
User avatar
tlah
 
Posts: 66
Joined: Sun Apr 06, 2008 12:10 pm
Location: In your head, readin' ur mind
Score: 2 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron