Top "Lua" questions

Lua is a powerful, fast, lightweight, embeddable scripting language.

"For each" loop in a lua table with key value pairs

Say I have a table defined like this: myTable = { myValue = nil, myOtherValue = nil} How would I iterate through it in …

lua lua-5.2
NSURLErrorDomain error code -999 in iOS

I've been trying to use Corona SDK's Facebook API to post the score on the game I'm developing on facebook. …

ios lua coronasdk nsurl nsurlerrordomain
Lua: converting from float to int

Even though Lua does not differentiate between floating point numbers and integers, there are some cases when you want to …

lua floating-point
How to format a lua string with a boolean variable?

I have a boolean variable whose value I'd like to display in a formatted string. I tried using string.format, …

lua string-formatting
How to iterate individual characters in Lua string?

I have a string in Lua and want to iterate individual characters in it. But no code I've tried works …

lua
Sort points in clockwise order?

Given an array of x,y points, how do I sort the points of this array in clockwise order (around …

algorithm math lua geometry computational-geometry
How to remove a lua table entry by its key?

I have a lua table that I use as a hashmap, ie with string keys : local map = { foo = 1, bar = 2 } I …

lua key lua-table
Lua - Number to string behaviour

I would like to know how Lua handles the number to string conversions using the tostring() function. It is going …

c lua tostring
Check if array contains specific value

I have this array, with some values (int) and I want to check if a value given by the user …

lua lua-table
Lua: Rounding numbers and then truncate

Which is the best efficient way to round up a number and then truncate it (remove decimal places after rounding …

lua rounding truncate