Questions tagged [lua-table]

This tag refers to the table type in Lua that implements associative arrays.

Filter by
Sorted by
Tagged with
2
votes
1answer
70 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
1answer
90 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
1answer
201 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 ...
-3
votes
1answer
357 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
1answer
160 views

Lua/Love2D Resource Loader (Queue)

I made this resource queue in Love2D. ...
4
votes
0answers
111 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
1answer
158 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
1answer
57 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
1answer
673 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
1answer
445 views

String split and tables

I have a table structured like this: ...
4
votes
1answer
1k 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
1answer
77 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"): ...