From f3c354d396a38033dac28ece6f6220e75cef5aec Mon Sep 17 00:00:00 2001 From: Guillermo Ramos Date: Tue, 1 Jul 2014 20:51:07 +0200 Subject: [Lua] Día 2 (sin terminar) --- lua/util.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 lua/util.lua (limited to 'lua/util.lua') diff --git a/lua/util.lua b/lua/util.lua new file mode 100644 index 0000000..e68c615 --- /dev/null +++ b/lua/util.lua @@ -0,0 +1,16 @@ +function print_table(t) + for k, v in pairs(t) do + print(k .. ": " .. v) + end +end + +function table_to_string(t) + local result = {} + + for k, v in pairs(t) do + result[#result+1] = k .. ": " .. v + end + + return table.concat(result, "\n") +end + -- cgit v1.2.3