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

= expected

Started by ETHANATOR360, 07 September 2012 - 12:35 AM
ETHANATOR360 #1
Posted 07 September 2012 - 02:35 AM
iv just started making a BASIC api iv already hit a problem
code:

function RND(int)
local random = math.random (0,int)
return random
end
post 1 through 3 do not resolve the problem
error code: [string BASIC:1: '=' expected
Noodle #2
Posted 07 September 2012 - 02:41 AM
Lua counts from 1
function RND(int)
random = math.random(1, int)
return random
end
You type
print(RND(5))
EDIT: 750 Post!
ETHANATOR360 #3
Posted 07 September 2012 - 02:44 AM
derp i forgot to post that the error was on line one and congragulations on your 750 post
Noodle #4
Posted 07 September 2012 - 02:46 AM
derp i forgot to post that the error was on line one and congragulations on your 750 post
Thanks! (Especially for posting this so I could achieve my goal)