How does one go about creating a random number generator that generates a number from 1-20?

All generators that I've found in these forums have returned "null" as a result. How would I make a generator that actually works?

The simplest would probably be using a little javascript.

    squiffy.set("randomnumber", Math.floor(Math.random() * 20) + 1);

The random number is {randomnumber}.

Yup! And just remember that when you use the code, the JavaScript is tabbed and comes BEFORE Andy regular text. Otherwise it messes things up.

My favorite evening was the evening I spent with ONE LINE of JS with three spaces before it. I looked and looked and didn't see the obvious, since there were no other JS lines nearby. After I went for a long frustrated walk, I came in, looked at the screen, and thought "you're kidding!"

Log in to post a reply.