Name: Anonymous 2011-11-24 13:26
I was wondering, me and my buds wanna start making a game and we wondering which language (LUA or Pygame) we should use for that. Any recommendations or information about these 2?
for loop, wouldn't using something like for (i=1; i<=length; i++) to iterate over all of it look a bit strange? Or using i<=length to check if i is not out of bounds?public static void createFactoringFactoryFactory(FactoringFactory factory). There are many ways to do the same thing, and part of being a knowledgable programmer is understanding that there are many different conventions and ways for doing the same sorts of things, each with their own advantages and disadvantages.
public static void createFactoringFactoryFactory(FactoringFactory factory)void, if it's a factory?
public static FactoringFactoryFactoryable createFactoringFactoryFactory(FactoringFactory factory)
function zset(table, index, value)
table[index + 1] = value
end
function zget(table, index)
return table[index + 1]
end
function zipairs(table)
return coroutine.wrap(function()
for i,v in ipairs(table) do
coroutine.yield(i-1, v)
end
end)
end
Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio
a = {}
a[6] = 9
for i,v in ipairs(a) do print(i,v) end
for i,v in pairs(a) do print(i,v) end
6 9
a[1] = 34
for i,v in ipairs(a) do print(i,v) end
1 34
for i,v in pairs(a) do print(i,v) end
1 34
6 9
0, a[0], and then continues with ipairs.
a = {}
a = {item='data1', next=a}
a = {item='data2', next=a}a = nil
herp = {">>30-san", "is", "a", "fgt"}
for _, val in pairs(herp) do
print(val)
endclass "Anus" ("Haxable")
:init(function (self) print "hax my anus" end)
:destroy(function (self) print(self.haxed and "haxed" or "not haxed") end)
:method "hax" (function (self) self.haxed = true end)
:method "shit" (function (self) collectgarbage() end)