Jump to content

[help] Random number out of 150 pre-defined ones


monday

Recommended Posts

Hi, is there any simple way to get a random number out of 150 numbers I previously defined? Let's say I have numbers like:

1,3,10,25,26,84,90,111,160, 209,260,302,381

Is there any:

num = math.randomfrom(1,3,10,25,26,84,90,111,160, 209,260,302,381) 
--or  
num = math.random(1,381, [except 2,4,5,6,7,8,9,11,12,13,14,15,16,17,18,19,20,21,22,23,24,27...]) 

Or is it necessary to make a lot of conditions like:

if num > A and num < than B 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...