Questions tagged [lua-table]

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

Filter by
Sorted by
Tagged with
1 vote
2 answers
167 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 ...
Thiago Luiz's user avatar
0 votes
0 answers
141 views

Lua: print table at specific table depth

This is my custom function: ...
user3713179's user avatar
2 votes
1 answer
350 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- ...
ravi's user avatar
  • 429
3 votes
1 answer
159 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 ...
ravi's user avatar
  • 429
4 votes
1 answer
363 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 ...
frostblue's user avatar
  • 137
-2 votes
1 answer
742 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 ...
Tarass's user avatar
  • 175
7 votes
1 answer
203 views

Lua/Love2D Resource Loader (Queue)

I made this resource queue in Love2D. ...
Accumulator's user avatar
4 votes
0 answers
141 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 ...
WolfeFan's user avatar
  • 166
5 votes
1 answer
243 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 "...
sceiler's user avatar
  • 305
4 votes
1 answer
60 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: ...
user3204810's user avatar
4 votes
1 answer
1k 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 ...
ComFreek's user avatar
  • 751
6 votes
1 answer
513 views

String split and tables

I have a table structured like this: ...
user3204810's user avatar
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, ...
SatheeshJM's user avatar
6 votes
1 answer
81 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"): ...
hjpotter92's user avatar
  • 8,716