How does one go about creating a random number generator that generates a number from 1-20?
oddvorelover
20 Nov 2021, 06:32All generators that I've found in these forums have returned "null" as a result. How would I make a generator that actually works?
mrangel
20 Nov 2021, 09:22The simplest would probably be using a little javascript.
squiffy.set("randomnumber", Math.floor(Math.random() * 20) + 1);
The random number is {randomnumber}.
broadwaydude
29 Nov 2021, 00:21Yup! And just remember that when you use the code, the JavaScript is tabbed and comes BEFORE Andy regular text. Otherwise it messes things up.
Bluevoss
17 Dec 2021, 18:45My 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!"