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

Biggest Table In Cc For A Game?

Started by Goof, 03 October 2013 - 02:58 PM
Goof #1
Posted 03 October 2013 - 04:58 PM
Hey everyone!

I just wanted to show you a nice thingy i found in my own "WIP" Code, for a game im going to develop.

this single table (called "data") is containing about 900 lilnes of variables and tables :o/> O.o

Spoiler
And im NOT even kidding! this is not just a massive amount of spaces… it is FILLED with tables and variables…


Also; This table is the only thing i've made so far and that big… (i used about 3 hours on it)

I've never seen any tables, being almost 900 lines :o/>


What do you think? Wierd, or totally wierd?
Cranium #2
Posted 03 October 2013 - 06:07 PM
Not really part of the "media" category…

Moved to General.
Grim Reaper #3
Posted 04 October 2013 - 12:42 AM
That's certainly interesting, but what exactly is in this table? A 900 line table of variables seems like a strange and memory intensive way to do things.
Goof #4
Posted 04 October 2013 - 07:06 AM
Well… Thanks Cranium for moving it… I didn't know what to put this in…

Grim Reaper:
Well… Im having about 600 lines of tables, with IP-addresses( well not actually IRL ip-addresses… just some random numbers )… then im having a softwareTool-table ( about 100-ish lines) and then im having a lot of variables.

This is a blemish'd picture (so you cant see the actual code, because its a secret project)
Spoiler
Vilsol #5
Posted 04 October 2013 - 08:45 AM
Well… Thanks Cranium for moving it… I didn't know what to put this in…

Grim Reaper:
Well… Im having about 600 lines of tables, with IP-addresses( well not actually IRL ip-addresses… just some random numbers )… then im having a softwareTool-table ( about 100-ish lines) and then im having a lot of variables.

This is a blemish'd picture (so you cant see the actual code, because its a secret project)
Spoiler

Why are you storing some IP addresses in a table? Why cant you just generate them dynamically?
Cranium #6
Posted 04 October 2013 - 09:13 AM
Or, save them to a file…
M4sh3dP0t4t03 #7
Posted 04 October 2013 - 02:30 PM
Most of my Lua projects have huge tables because I like OOP. But I don't really see the point of writing down 100s of IP-addresses, when you could just generate them automatically with just about 10 to 20 lines of code.
electrodude512 #8
Posted 04 October 2013 - 04:06 PM
How about we move this to forum games to see who can come up with the longest table (that actually did something useful in a real program)?

I have a sentence diagramer I'm working on. It has a table of methods that's 537 lines and a dictionary that's only 418 lines right now but could easily grow to thousands (but that would end up being automated). The method table's contents get dumped into the dictionary (i.e. if it's an adjective then give it the appropriate methods for an adjective, etc.) at runtime so I don't have to keep tons of identical methods updated and so I don't have to define multiple properties redundantly (so I don't say {pos = "adj", method = function() blah end}, just {pos = "adj"}). If I didn't rebuild the dictionary every time the program ran but changed nothing else, the dictionary would grow to be at least 5881 lines long.
Lyqyd #9
Posted 04 October 2013 - 04:20 PM
Not really a game.
ShadowedZenith #10
Posted 04 October 2013 - 04:54 PM
That seems kind of resource wasteful…
Geforce Fan #11
Posted 05 October 2013 - 03:31 PM
It'd be too easy to make a long table. I could just do this:

longTable = {}
i = 0
while true do
longTable[i] = "HUGE Table!"
i = i+1
sleep(0)
end
and I'd win, that generates an infinitely long table.
Engineer #12
Posted 05 October 2013 - 07:33 PM
Im wanting to see the content of that huge table. PM or here, I dont really care where, but Im curious if there is even revelant data and not just some random bull****