Questions tagged [lua-table]
This tag refers to the table type in Lua that implements associative arrays.
13 questions
1
vote
2
answers
329
views
function to print any type in Lua?
I'm learning Lua for about a week now and I've built (I hope) a function to print any type in Lua. As I'm new to Lua I don't quite understand:
if there is a more succinct way to achieve this
if ...
2
votes
1
answer
409
views
Faster way of converting a 1-d table to predefined userdata in Lua
I have defined a userdata in Lua (Lua version is 5.1) as shown below-
...
3
votes
1
answer
189
views
Serializing a table for filing
I have a table in Lua, which contains two 1-dimensional arrays in which each array contains approximately 800,000 elements. I want to serialize this Lua table to file efficiently. Hence, I planned to ...
4
votes
1
answer
431
views
Simple terminal-based Lua task-tracking/calendar
I am learning Lua and wrote this little calendar/time-tracking script. It allows me to create tasks to do with a deadline, print them, and mark them as being done. A task is a table with the following ...
-2
votes
1
answer
806
views
Lua and complex numbers [closed]
I try to use complex numbers in a lua program.
I need to parse a table of complex numbers printing side by side the name of the complex number and its value. Can't get through it :
I don't ask how ...
7
votes
1
answer
228
views
Lua/Love2D Resource Loader (Queue)
I made this resource queue in Love2D.
...
4
votes
0
answers
157
views
Project Euler #14 in Clojure (finding long Collatz sequence chain)
I'm working on a Clojure implementation for Project Euler #14, which asks for the initial element, under 106, that produces the longest collatz-sequence chain. I'm trying to make use of every ...
5
votes
1
answer
271
views
Return table value based on a primitive "priority queue"
I have 2 function in Lua, one to look if a key is present inside a provided table and if true then return the value, else return false. This lookup function is called by another function with a "...
4
votes
1
answer
91
views
Form for choosing settings
I've created a form to choose the settings: These settings are automatically saved in a file from the game client in this form:
...
4
votes
1
answer
2k
views
Default value mechanism in Lua using metatables
I am writing a couple of functions accepting tables as input parameters. These tables constitute a range of options, which should either be given or inferred from default tables.
Concrete use cases ...
6
votes
1
answer
564
views
String split and tables
I have a table structured like this:
...
4
votes
1
answer
2k
views
Return one particular element first, when iterating a lua table
I wish to iterate through a Lua table, but want to get one particular element first always (its key is known beforehand).
Since the pairs function does not guarantee the order of a table's elements, ...
6
votes
1
answer
104
views
Converting the integers to their equivalent string representations
I have the following function which converts an integer (such as 103) to its string representation ("one hundred three"):
...