Changing the [Random] objects range?

Mar 28, 2008 at 7:10pm

Changing the [Random] objects range?

I want the [Random] object to output a number between 36 and 60. I tried to set random to 60 and then use a number box to limit the values between 36 and 60 but the trouble is that 36 keeps coming up (obviously becasue every time the random object outputs a figure below 36 the number box cant handle deal with it so it just shows 36).

So I’m a little baffled, is there anyway to change the range of the random object effectively? Or am i barking up the wrong tree?

#36579
Mar 28, 2008 at 7:25pm

Hi James,

Set [random] to 24, then offset (i.e. add) 36 to the output.


Owen

James wrote:
> I want the [Random] object to output a number between 36 and 60. I
> tried to set random to 60 and then use a number box to limit the
> values between 36 and 60 but the trouble is that 36 keeps coming up
> (obviously becasue every time the random object outputs a figure
> below 36 the number box cant handle deal with it so it just shows
> 36).
>
> So I’m a little baffled, is there anyway to change the range of the
> random object effectively? Or am i barking up the wrong tree?
>
>

#125632
Mar 28, 2008 at 7:39pm

[random 24]
|
[+ 36]

On Fri, Mar 28, 2008 at 9:10 PM, James wrote:

>
> I want the [Random] object to output a number between 36 and 60. I tried
> to set random to 60 and then use a number box to limit the values between 36
> and 60 but the trouble is that 36 keeps coming up (obviously becasue every
> time the random object outputs a figure below 36 the number box cant handle
> deal with it so it just shows 36).
>
> So I’m a little baffled, is there anyway to change the range of the random
> object effectively? Or am i barking up the wrong tree?
>

#125633
Mar 28, 2008 at 7:39pm

Your range is 24. 60 – 36.

Random 25 (because it goes from 0 to n-1) + 36.

In before litter power.

bt

On Mar 28, 2008, at 12:10 PM, James wrote:
>
> I want the [Random] object to output a number between 36 and 60. I
> tried to set random to 60 and then use a number box to limit the
> values between 36 and 60 but the trouble is that 36 keeps coming up
> (obviously becasue every time the random object outputs a figure
> below 36 the number box cant handle deal with it so it just shows 36).
>
> So I’m a little baffled, is there anyway to change the range of the
> random object effectively? Or am i barking up the wrong tree?

barry threw
Media Art and Technology

San Francisco, CA
Work: 857-544-3967
Email: bthrew (at) gmail (dot) com
Web: http://www.barrythrew.com

#125634
Mar 28, 2008 at 10:04pm

Quote: barry threw wrote on Fri, 28 March 2008 20:39
—————————————————-
> In before litter power.
—————————————————-

Maybe, but isn’t [lp.tata 36 60] easier?

Litter Starter Pack. Free. URL below.

Best,
Peter

#125635
Mar 29, 2008 at 1:43am

Many thanks to all the replies, got it sussed now.

Cheers,
James.

#125636

You must be logged in to reply to this topic.