Random number generator multiple times with one command (without copy/paste)

Here is the code to generate a random number between 1 and 10: $(eval Math.floor((Math.random() * 10) + 1))

How would I alter this so that it loops and picks a random number between 1 and 10 over and over again until it spits out 50 results.

1 Like

This should do what you want

$(eval x=``;for(a=0;a<50;a++){y=Math.floor(Math.random()*10)+1;x+=y+` `}x)

Worked perfectly, thank you very much!

1 Like

Is it possible to have it not repeat numbers, if not its fine.

Yes that would be possible but to be clear that would only be 10 results not 50 or do you mean not multiple of the same numbers.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.