38 posts
Location
The IRC channel.
Posted 25 March 2012 - 07:01 PM
The CC-Chess team has ran into an error we can't fix
The error:
cc-chess:475: index expected, got nil
The code : (its over 800 lines , don't expect a code tag)
http://pastebin.com/9GDUy1qydo NOT come with dumb answers , or incomplete answers.
We need to know where the index is missing , not that it is missing.
it happens after line 585 has ben ran but before line 596
61 posts
Location
Pontefract, West Yorkshire, England
Posted 25 March 2012 - 08:28 PM
:/ damnn thats a lot of code
378 posts
Location
In the TARDIS
Posted 25 March 2012 - 09:55 PM
what is that self API?
38 posts
Location
The IRC channel.
Posted 26 March 2012 - 07:49 PM
what is that self API?
Its the Lua class system , google "Lua users wiki Classes"
454 posts
Location
London
Posted 26 March 2012 - 10:28 PM
what is that self API?
Its the Lua class system , google "Lua users wiki Classes"
Lua has no class system, though you can implement something similar, if you desire.
It's basically just some syntax sugar:
local tbl = {}
function tbl:stuff() ->
function tbl.stuff(self)
tbl:stuff() ->
tbl.stuff(tbl)
Which allows you to do neat stuff with metamethods.
38 posts
Location
The IRC channel.
Posted 27 March 2012 - 05:27 PM
what is that self API?
Its the Lua class system , google "Lua users wiki Classes"
Lua has no class system, though you can implement something similar, if you desire.
It's basically just some syntax sugar:
local tbl = {}
function tbl:stuff() ->
function tbl.stuff(self)
tbl:stuff() ->
tbl.stuff(tbl)
Which allows you to do neat stuff with metamethods.
Lua classes are with metamethods indeed lol , check this page for info on it
http://lua-users.org/wiki/SimpleLuaClasses
124 posts
Location
Liverpool (no I am not a Scouser Im form Holland)
Posted 27 March 2012 - 05:31 PM
no matter where you are or what your on someone always makes a chess game
378 posts
Location
In the TARDIS
Posted 27 March 2012 - 08:16 PM
no matter where you are or what your on someone always makes a chess game
First: Chess rules!
Second: Maybe that self API isn't implemented in the CC Lua Interpreter
454 posts
Location
London
Posted 27 March 2012 - 08:22 PM
no matter where you are or what your on someone always makes a chess game
First: Chess rules!
Second: Maybe that self API isn't implemented in the CC Lua Interpreter
It's not an API, it's just sugar:
local cat = {}
function cat:new(...)
local o = {}
self.__index = self
setmetatable(o, self)
return o:__construct(...)
end
function cat:__construct(name)
self.name = name
return self
end
function cat:meow()
print(self.name, " meows!")
end
local Felix = cat:new("Felix")
local Sofia = cat:new("Sofia")
Felix:meow()
Sofia:meow()
Output:
Felix meows!
Sofia meows!
378 posts
Location
In the TARDIS
Posted 27 March 2012 - 08:38 PM
oh ok sry
161 posts
Posted 01 April 2012 - 06:41 AM
Line 468 reads:
self.cells[y] = nil
It should read:
self.cells[x][y] = nil