exploring3
0
Calvin Minus Hobbes week 1
What would happen if toy Hobbes never turns into real Hobbes when he is alone with Calvin?
printer
0
Python styled string formatting for lua

Imitating python is easy peasy thanks to metatables. What’s better, even primitives have metatables, albeit some may consider using these types of code as a gross violation of all that Lua stands for (oh come on, do you have to be so dramatic all of a sudden?). To them I... Continue Reading

registry
0
Accessing the registry in Lua

Registries are damned evil, but Lua is good, so when you combine the two, they sort of cancel each other out into mediocrecy. In lieu of I’m-getting-too-lazy-this-summer-to-do-anything-useful, here’s some mediocre code.

Example:

code excluded in excerpt

Note: this code currently only supports reading, stay tuned for updates.

Compilation step using mingw

code excluded in excerpt

Where... Continue Reading

narwhal1
0
Heap based priority queue in Lua

Hey, looks like my freshman year CS class paid off, I can now adequately draw dick whales.

Anyways, back to priority queues; this is an example showcasing how to initialize and use a priority queue:

code excluded in excerpt

API:

function pqueue([cmp], [initial])

cmp: The comparison function, which takes two parameters a and b and... Continue Reading

pickles
0
Pickle – Lua serialization postmortem

Storing a table using its corresponding lua code seems like an elegant idea, but there are a few kinks with the original code.

First of all, self referencing tables will cause the serialization function to break because there are no easy ways of referencing something before its own declaration. I mean,... Continue Reading

1 2 3 4 >