This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Agoldfish's profile picture

Interval Empty?

Started by Agoldfish, 15 November 2013 - 12:53 PM
Agoldfish #1
Posted 15 November 2013 - 01:53 PM
Hi, I was writing a program, and I have the following for line 1.

local weather = math.random(60-90)

And I get:
Race:1:  bad argument  #1: interval is empty 

What the heck is that? I have worked with variables before and that has never showed up before.
Thanks to anyone who helps.
nolongerexistant #2
Posted 15 November 2013 - 02:03 PM

local weather = math.random(60-90)

You have to use a comma instead of a minus


local weather = math.random(60, 90)
Edited on 15 November 2013 - 01:05 PM
Engineer #3
Posted 15 November 2013 - 02:04 PM
Read documentation

So it generally accepts two arguments, in your case:

math.random( 60, 90 )

Edit: Ninja's, ninja's everywhere!
Edited on 15 November 2013 - 01:04 PM
Agoldfish #4
Posted 15 November 2013 - 03:36 PM
I feel sooooo dumb. -_-/>