I am trying to make a random number generator that can generate any number from 100 to 255. If anyone would be willing to explain/give that code, it would be very much appreciated. Thanks!

Hey there, try using the code playground on our website, where you can type out your own code. That way you can use JavaScript that we don’t have keys for in our mobile app.

For a random number generator, take a look at some of the Math methods that are built in to JavaScript. By combining a few of them, you should be able to create the function you’re looking for without too much trouble!

In particular, pay attention to Math.random(), which generates a random number between `0`

and `1`

.

You can then multiply this number to scale it up. For example, `Math.random() * 100`

will generate a number between `0`

and `100`

.

To generate a number between `100`

and `255`

, you could generate a random number between `0`

and `155`

, then add `100`

.

Other methods that might be helpful are:

- Math.round(), which rounds up or down to the nearest integer
- Math.floor(), which rounds down only
- Math.ceil(), which rounds up only
- Math.trun(), which removes any fractional digits (e.g: 1.23 becomes 1)

Good luck! Post your code here once you’re finished!

Ben