A Random Feature

You could just use the noise function for something like that which would be easier. and you likely wouldn’t notice a difference if you “zoom out” enough with it

1 Like

In time for Christmas? :smirk:

1 Like

“In observance of the gift-giving season”

3 Likes

Ehh. Oh. Thanks.

This is now live.

26 Likes

Question about NextNumber(), technically, does it include the min, and approach the max?

Found a minor quirk:

while wait() do
    local R = Random.new(-tick())
    print(R:NextNumber())
end

will print the same number for one second, until the seed changes.

I think that is expected as it’s not exactly the right way to use it, but…

1 Like

Yeah, notice the interval notation:

Closed at min, and open at max, so min <= x < max

1 Like

Yeah, the range is [min,max).

4 Likes

You don’t get the title, hmm?

It’s quite literally random

So in the example:

rng:NextNumber(0, 255)

Does this mean that you will never get 255 as a value?

Since we’re talking about floats, not ints, would it really matter?

2 Likes

That’s correct, you’ll never hit 255.

1 Like

Why not include the end value for NextNumber and make it consistent with how NextInteger works?

2 Likes

You know what would be nice? If the Random data type had support for things like Vector3s.

2 Likes

That might be too specific a use case. Besides, it’s v. easy to make a helper function for that purpose.

3 Likes

Then again, you’re right.

support

1 Like

5 posts were merged into an existing topic: Off-topic and bump posts

Please do not necrobump threads.