a bit of a math problem (iam kinda new to lua)
My code makes a large table with many different numbers and i want my code to take the numbers from that table (i know how tables work) and find the closest number in the table to a preset number.
For context i have made a few programs already, but none of them needed this.
https://redd.it/1mluuvs
@r_lua
My code makes a large table with many different numbers and i want my code to take the numbers from that table (i know how tables work) and find the closest number in the table to a preset number.
For context i have made a few programs already, but none of them needed this.
https://redd.it/1mluuvs
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Lua Fake Vector - preprocessor that duplicates expressions to do vector math without garbage
https://github.com/mceicys/lua-fake-vector
https://redd.it/1mlutlv
@r_lua
https://github.com/mceicys/lua-fake-vector
https://redd.it/1mlutlv
@r_lua
GitHub
GitHub - mceicys/lua-fake-vector
Contribute to mceicys/lua-fake-vector development by creating an account on GitHub.
Is it better to declare the core module globally in an embedded environment?
My program exposes it's main functionality through lua, there is not that much of it so it's in one module. Now I'm wondering if it's better to expose it globaly, or should the user require the module themselves(one benefit of this would be no lsp warnings). I looked around and saw other projects doing this like love2d or neovim(I'm strictly referring to the module providing the core functionality), but I'm still not sure.
https://redd.it/1mnijpq
@r_lua
My program exposes it's main functionality through lua, there is not that much of it so it's in one module. Now I'm wondering if it's better to expose it globaly, or should the user require the module themselves(one benefit of this would be no lsp warnings). I looked around and saw other projects doing this like love2d or neovim(I'm strictly referring to the module providing the core functionality), but I'm still not sure.
https://redd.it/1mnijpq
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Luans - a Lua learning App inspired by Koans
Hello everyone
We’re excited to share that Luans has leveled up—version 2.0 is now live at [play.tenum.app](https://play.tenum.app).
Here’s what’s new:
* **More lessons** — a broader range of topics to help you build your Lua skills step by step.
* **Cleaner feedback** — clearer, more immediate answers when tests fail or pass, so you always know what’s going on.
* **Mission‑style format** and **Layout improvements**
We’d love your feedback on v2.0. We’re planning to implement user-submitted lessons, letting the community contribute topics and challenges. This would open the door for even more diverse content and learning paths.
https://redd.it/1mp83sf
@r_lua
Hello everyone
We’re excited to share that Luans has leveled up—version 2.0 is now live at [play.tenum.app](https://play.tenum.app).
Here’s what’s new:
* **More lessons** — a broader range of topics to help you build your Lua skills step by step.
* **Cleaner feedback** — clearer, more immediate answers when tests fail or pass, so you always know what’s going on.
* **Mission‑style format** and **Layout improvements**
We’d love your feedback on v2.0. We’re planning to implement user-submitted lessons, letting the community contribute topics and challenges. This would open the door for even more diverse content and learning paths.
https://redd.it/1mp83sf
@r_lua
My awesome PWA app
Best PWA app in the world!
Best Online Resources for Learning?
I've had a little experience with Lua but I want to learn a lot more so I can start modding and developing games of my own. What's the most effective way I can learn?
https://redd.it/1mp96te
@r_lua
I've had a little experience with Lua but I want to learn a lot more so I can start modding and developing games of my own. What's the most effective way I can learn?
https://redd.it/1mp96te
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
cant install luasocket
module mime/core.dll cant compile. idk what is the problem
>C:\\Users\\Intel>luarocks install luasocket
>Installing https://luarocks.org/luasocket-3.1.0-1.src.rock
>
>
>luasocket 3.1.0-1 depends on lua >= 5.1 (5.4-1 provided by VM: success)
>x86_64-w64-mingw32-gcc -O2 -c -o src/luasocket.o -IC:\\Lua\\5.4\\src src/luasocket.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\\windows\\system32\\include
>x86_64-w64-mingw32-gcc -O2 -c -o src/timeout.o -IC:\\Lua\\5.4\\src src/timeout.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\\windows\\system32\\include
>x86_64-w64-mingw32-gcc -O2 -c -o src/buffer.o -IC:\\Lua\\5.4\\src src/buffer.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\\windows\\system32\\include
>x86_64-w64-mingw32-gcc -O2 -c -o src/io.o -IC:\\Lua\\5.4\\src src/io.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\\windows\\system32\\include
>x86_64-w64-mingw32-gcc -O2 -c -o src/auxiliar.o -IC:\\Lua\\5.4\\src src/auxiliar.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\\windows\\system32\\include
>x86_64-w64-mingw32-gcc -O2 -c -o src/options.o -IC:\\Lua\\5.4\\src src/options.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\\windows\\system32\\include
>x86_64-w64-mingw32-gcc -O2 -c -o src/inet.o -IC:\\Lua\\5.4\\src src/inet.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\\windows\\system32\\include
>x86_64-w64-mingw32-gcc -O2 -c -o src/except.o -IC:\\Lua\\5.4\\src src/except.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\\windows\\system32\\include
>x86_64-w64-mingw32-gcc -O2 -c -o src/select.o -IC:\\Lua\\5.4\\src src/select.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\\windows\\system32\\include
>x86_64-w64-mingw32-gcc -O2 -c -o src/tcp.o -IC:\\Lua\\5.4\\src src/tcp.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\\windows\\system32\\include
>x86_64-w64-mingw32-gcc -O2 -c -o src/udp.o -IC:\\Lua\\5.4\\src src/udp.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\\windows\\system32\\include
>x86_64-w64-mingw32-gcc -O2 -c -o src/compat.o -IC:\\Lua\\5.4\\src src/compat.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\\windows\\system32\\include
>x86_64-w64-mingw32-gcc -O2 -c -o src/wsocket.o -IC:\\Lua\\5.4\\src src/wsocket.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\\windows\\system32\\include
>x86_64-w64-mingw32-gcc -shared -o C:\\Users\\Intel\\AppData\\Local\\Temp\\luarocks_build-LuaSocket-3.1.0-1-2048758\\socket\\core.dll src/luasocket.o src/timeout.o src/buffer.o src/io.o src/auxiliar.o src/options.o src/inet.o src/except.o src/select.o src/tcp.o src/udp.o src/compat.o src/wsocket.o -lws2_32 C:\\Lua\\5.4\\lua54.dll -lm
>x86_64-w64-mingw32-gcc -O2 -c -o src/mime.o -IC:\\Lua\\5.4\\src src/mime.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\\windows\\system32\\include
>x86_64-w64-mingw32-gcc -O2 -c -o src/compat.o -IC:\\Lua\\5.4\\src src/compat.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\\windows\\system32\\include
>x86_64-w64-mingw32-gcc -shared -o C:\\Users\\Intel\\AppData\\Local\\Temp\\luarocks_build-LuaSocket-3.1.0-1-2048758\\mime\\core.dll src/mime.o src/compat.o -Lc:\\windows\\system32 C:\\Lua\\5.4\\lua54.dll -lm
>C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../lib/dllcrt2.o: in function `_CRT_INIT':
>D:/W/B/src/mingw-w64/mingw-w64-crt/crt/crtdll.c:126:(.text+0x8e): undefined reference to `_execute_onexit_table'
>C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/W/B/src/mingw-w64/mingw-w64-crt/crt/crtdll.c:79:(.text+0x117): undefined reference to `_initialize_onexit_table'
>C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/W/B/src/mingw-w64/mingw-w64-crt/crt/crtdll.c:126:(.text+0x1c6): undefined reference to `_execute_onexit_table'
>C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../lib/dllcrt2.o:
module mime/core.dll cant compile. idk what is the problem
>C:\\Users\\Intel>luarocks install luasocket
>Installing https://luarocks.org/luasocket-3.1.0-1.src.rock
>
>
>luasocket 3.1.0-1 depends on lua >= 5.1 (5.4-1 provided by VM: success)
>x86_64-w64-mingw32-gcc -O2 -c -o src/luasocket.o -IC:\\Lua\\5.4\\src src/luasocket.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\\windows\\system32\\include
>x86_64-w64-mingw32-gcc -O2 -c -o src/timeout.o -IC:\\Lua\\5.4\\src src/timeout.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\\windows\\system32\\include
>x86_64-w64-mingw32-gcc -O2 -c -o src/buffer.o -IC:\\Lua\\5.4\\src src/buffer.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\\windows\\system32\\include
>x86_64-w64-mingw32-gcc -O2 -c -o src/io.o -IC:\\Lua\\5.4\\src src/io.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\\windows\\system32\\include
>x86_64-w64-mingw32-gcc -O2 -c -o src/auxiliar.o -IC:\\Lua\\5.4\\src src/auxiliar.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\\windows\\system32\\include
>x86_64-w64-mingw32-gcc -O2 -c -o src/options.o -IC:\\Lua\\5.4\\src src/options.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\\windows\\system32\\include
>x86_64-w64-mingw32-gcc -O2 -c -o src/inet.o -IC:\\Lua\\5.4\\src src/inet.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\\windows\\system32\\include
>x86_64-w64-mingw32-gcc -O2 -c -o src/except.o -IC:\\Lua\\5.4\\src src/except.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\\windows\\system32\\include
>x86_64-w64-mingw32-gcc -O2 -c -o src/select.o -IC:\\Lua\\5.4\\src src/select.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\\windows\\system32\\include
>x86_64-w64-mingw32-gcc -O2 -c -o src/tcp.o -IC:\\Lua\\5.4\\src src/tcp.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\\windows\\system32\\include
>x86_64-w64-mingw32-gcc -O2 -c -o src/udp.o -IC:\\Lua\\5.4\\src src/udp.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\\windows\\system32\\include
>x86_64-w64-mingw32-gcc -O2 -c -o src/compat.o -IC:\\Lua\\5.4\\src src/compat.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\\windows\\system32\\include
>x86_64-w64-mingw32-gcc -O2 -c -o src/wsocket.o -IC:\\Lua\\5.4\\src src/wsocket.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\\windows\\system32\\include
>x86_64-w64-mingw32-gcc -shared -o C:\\Users\\Intel\\AppData\\Local\\Temp\\luarocks_build-LuaSocket-3.1.0-1-2048758\\socket\\core.dll src/luasocket.o src/timeout.o src/buffer.o src/io.o src/auxiliar.o src/options.o src/inet.o src/except.o src/select.o src/tcp.o src/udp.o src/compat.o src/wsocket.o -lws2_32 C:\\Lua\\5.4\\lua54.dll -lm
>x86_64-w64-mingw32-gcc -O2 -c -o src/mime.o -IC:\\Lua\\5.4\\src src/mime.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\\windows\\system32\\include
>x86_64-w64-mingw32-gcc -O2 -c -o src/compat.o -IC:\\Lua\\5.4\\src src/compat.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\\windows\\system32\\include
>x86_64-w64-mingw32-gcc -shared -o C:\\Users\\Intel\\AppData\\Local\\Temp\\luarocks_build-LuaSocket-3.1.0-1-2048758\\mime\\core.dll src/mime.o src/compat.o -Lc:\\windows\\system32 C:\\Lua\\5.4\\lua54.dll -lm
>C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../lib/dllcrt2.o: in function `_CRT_INIT':
>D:/W/B/src/mingw-w64/mingw-w64-crt/crt/crtdll.c:126:(.text+0x8e): undefined reference to `_execute_onexit_table'
>C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/W/B/src/mingw-w64/mingw-w64-crt/crt/crtdll.c:79:(.text+0x117): undefined reference to `_initialize_onexit_table'
>C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/W/B/src/mingw-w64/mingw-w64-crt/crt/crtdll.c:126:(.text+0x1c6): undefined reference to `_execute_onexit_table'
>C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../lib/dllcrt2.o:
in function `atexit':
>D:/W/B/src/mingw-w64/mingw-w64-crt/crt/crtdll.c:183:(.text+0x2db): undefined reference to `_register_onexit_function'
>C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../lib/libmingw32.a(lib64_libmingw32_a-pseudo-reloc.o): in function `__report_error':
>D:/W/B/src/mingw-w64/mingw-w64-crt/crt/pseudo-reloc.c:150:(.text+0x28): undefined reference to `__acrt_iob_func'
>C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/W/B/src/mingw-w64/mingw-w64-crt/crt/pseudo-reloc.c:151:(.text+0x46): undefined reference to `__acrt_iob_func'
>collect2.exe: error: ld returned 1 exit status
>
>Error: Build error: Failed compiling module mime\\core.dll
https://redd.it/1mpoe1p
@r_lua
>D:/W/B/src/mingw-w64/mingw-w64-crt/crt/crtdll.c:183:(.text+0x2db): undefined reference to `_register_onexit_function'
>C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../lib/libmingw32.a(lib64_libmingw32_a-pseudo-reloc.o): in function `__report_error':
>D:/W/B/src/mingw-w64/mingw-w64-crt/crt/pseudo-reloc.c:150:(.text+0x28): undefined reference to `__acrt_iob_func'
>C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/W/B/src/mingw-w64/mingw-w64-crt/crt/pseudo-reloc.c:151:(.text+0x46): undefined reference to `__acrt_iob_func'
>collect2.exe: error: ld returned 1 exit status
>
>Error: Build error: Failed compiling module mime\\core.dll
https://redd.it/1mpoe1p
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
[New to coding] Wasn't satisfied with my understanding of arrays and "for" loops, so I decided to create code for Fibonacci sequence
https://redd.it/1mpxn0z
@r_lua
https://redd.it/1mpxn0z
@r_lua
Reddit
From the lua community on Reddit: [New to coding] Wasn't satisfied with my understanding of arrays and "for" loops, so I decided…
Explore this post and more from the lua community
A response to the "Luajit is wicked fast" video
https://marioarias.hashnode.dev/a-response-to-the-luajit-is-wicked-fast-video
https://redd.it/1mqjl1w
@r_lua
https://marioarias.hashnode.dev/a-response-to-the-luajit-is-wicked-fast-video
https://redd.it/1mqjl1w
@r_lua
ELM11 (Embedded Lua Machine) maker board
This is possibly of interest to readers of this subreddit - https://brisbanesilicon.com.au/elm11/.
I don't think I am breaking any 'R/LUA' rules by posting this here - apologies in advance if so.
https://redd.it/1mqo6fq
@r_lua
This is possibly of interest to readers of this subreddit - https://brisbanesilicon.com.au/elm11/.
I don't think I am breaking any 'R/LUA' rules by posting this here - apologies in advance if so.
https://redd.it/1mqo6fq
@r_lua
Can someone help me with this? It keeps crashing and Ive been trying to fix it on my own for a while now. (error & code in the link since it can't fit it all)
https://docs.google.com/document/d/1ZUiZ6icbjjCs-GN_UunTFWfJs27dOojysgzQeG7Y1mc/edit?tab=t.0
https://redd.it/1mqppwy
@r_lua
https://docs.google.com/document/d/1ZUiZ6icbjjCs-GN_UunTFWfJs27dOojysgzQeG7Y1mc/edit?tab=t.0
https://redd.it/1mqppwy
@r_lua
Google Docs
Coding Problem with lua :/
Error Syntax error: card.lua:4105: '<eof>' expected near 'end' Traceback [love "callbacks.lua"]:228: in function 'handler' [C]: at 0x010520a598 [C]: in function "require' main.lua:25: in main chunk [C]: in function 'require' [C]: in function 'xpcall' [C]:…
Help figuring out "requires" with c++ and windows
Hello,
I'm reading a book that teaches Lua and C++ together (Integrated Lua with C++), and I'm having difficulty figuring out how to accomplish this portion of the book. They use a Makefile and create a file called Destinations.SO, which is a Unix thing (I'm using Windows). I'm trying to figure out what exactly it wants so it can read it correctly.
I'm getting " Failed to execute: noscript.lua:1: module 'destinations' not found:" and a bunch of locations saying "no file 'D:....."
I'm going to provide the snippet of the book, and hopefully that makes it clearer:
>So far in this book, we have only explicitly registered C++ modules to Lua in C++ code. However, there is another way to provide a C++ module to Lua.
>You can produce a shared library for a module and place it in Lua’s search path. When the Lua code requires the module, Lua will load the shared library automatically.
>
>Chapter09 % ../lua/src/lua
Lua 5.4.6 Copyright (C) 1994-2023 Lua.org, PUC-Rio
\> Destinations = require "destinations"
\> dst = Destinations.new("Shanghai", "Tokyo") Destinations instance created: 0x155a04210 > dst:wish("London", "Paris", "Amsterdam") > dst:went("Paris")
\> print("Visited:", dst:list_visited()) Visited: Paris
\> print("Unvisited:", dst:list_unvisited()) Unvisited: Amsterdam London Shanghai Tokyo > os.exit()
Destinations instance destroyed: 0x155a04210
>The most important statement is the require statement. This loads destinations.so and assigns the module to the Destinations global variable.
>We started the Lua interactive interpreter in the same folder where the module binary resides because require will search the current working directory for modules. Alternatively, you can put the library in a system search path. You can check the reference manual to learn more about require and its behaviors.
>A standalone C++ module is useful when you need to reuse the module in the binary form across multiple projects or enforce code isolation on the C++ side, but this is just a design choice.
Any help would be appreciated, because this is driving me crazy.
https://redd.it/1mrdml0
@r_lua
Hello,
I'm reading a book that teaches Lua and C++ together (Integrated Lua with C++), and I'm having difficulty figuring out how to accomplish this portion of the book. They use a Makefile and create a file called Destinations.SO, which is a Unix thing (I'm using Windows). I'm trying to figure out what exactly it wants so it can read it correctly.
Destinations = require "destinations" -- This loads `destinations.so` and assigns the module to the Destinations global variable.I'm getting " Failed to execute: noscript.lua:1: module 'destinations' not found:" and a bunch of locations saying "no file 'D:....."
I'm going to provide the snippet of the book, and hopefully that makes it clearer:
>So far in this book, we have only explicitly registered C++ modules to Lua in C++ code. However, there is another way to provide a C++ module to Lua.
>You can produce a shared library for a module and place it in Lua’s search path. When the Lua code requires the module, Lua will load the shared library automatically.
>
To test the standalone module, in the folder where `destinations.so` resides, start a Lua interactive interpreter and execute the following statements:>Chapter09 % ../lua/src/lua
Lua 5.4.6 Copyright (C) 1994-2023 Lua.org, PUC-Rio
\> Destinations = require "destinations"
\> dst = Destinations.new("Shanghai", "Tokyo") Destinations instance created: 0x155a04210 > dst:wish("London", "Paris", "Amsterdam") > dst:went("Paris")
\> print("Visited:", dst:list_visited()) Visited: Paris
\> print("Unvisited:", dst:list_unvisited()) Unvisited: Amsterdam London Shanghai Tokyo > os.exit()
Destinations instance destroyed: 0x155a04210
>The most important statement is the require statement. This loads destinations.so and assigns the module to the Destinations global variable.
>We started the Lua interactive interpreter in the same folder where the module binary resides because require will search the current working directory for modules. Alternatively, you can put the library in a system search path. You can check the reference manual to learn more about require and its behaviors.
>A standalone C++ module is useful when you need to reuse the module in the binary form across multiple projects or enforce code isolation on the C++ side, but this is just a design choice.
Any help would be appreciated, because this is driving me crazy.
https://redd.it/1mrdml0
@r_lua
How do I even make a lua obfuscator?
I know someone already ask this but im asking like how does it work tbh I dont mind if it was fully made using lua like that prometheus obfuscator or using c or java of whatever type of programing language you know
https://redd.it/1mrsz35
@r_lua
I know someone already ask this but im asking like how does it work tbh I dont mind if it was fully made using lua like that prometheus obfuscator or using c or java of whatever type of programing language you know
https://redd.it/1mrsz35
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Any simple ways a 13-year-old could earn money with Lua?
I’ve been learning Lua for about a year, mostly with Luau, and recently I’ve started using the LÖVE framework to make games. I’m 13 (in 8th grade), so I know I’m still pretty young, but I was curious: are there any simple or realistic ways for someone my age to make a bit of money with Lua coding?
https://redd.it/1ms83f2
@r_lua
I’ve been learning Lua for about a year, mostly with Luau, and recently I’ve started using the LÖVE framework to make games. I’m 13 (in 8th grade), so I know I’m still pretty young, but I was curious: are there any simple or realistic ways for someone my age to make a bit of money with Lua coding?
https://redd.it/1ms83f2
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
Best Lua IDE?
Usually I just use Notepad++, but I have tried using Intellij with the Lua plugin and that was so-so.
Do any of you guys have suggestions?
https://redd.it/1msh79h
@r_lua
Usually I just use Notepad++, but I have tried using Intellij with the Lua plugin and that was so-so.
Do any of you guys have suggestions?
https://redd.it/1msh79h
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community
setmetatable and index
I'm doing more on classes - and I'm making a class
MyClass = {}
function MyClass:new()
o = {}
setmetatable(o, MyClass)
self.index = MyClass
return o
end
function MyClass:myfunc()
print("myfunc called")
end
c = MyClass:new()
I realise the manual example uses 'self' rather than MyClass - but I'm not looking for inheritance yet.
And I'm wondering why I need both to set the metatable and index to MyClass. Just setting the metatable fills the metatable of c with fields named after the MyClass functions (eg myfunc) that point to the metamethods - so they should be callable? Yet calling them is calling nil. Why do I require index to be set as well?
I've read the manual on the index metamethod and I see how setting index to the MyClass table and the index metamethod is called if there is no field in the metatable - yet the metatable of c has the field myfunc in even if I miss setting index.
https://redd.it/1mt5726
@r_lua
I'm doing more on classes - and I'm making a class
MyClass = {}
function MyClass:new()
o = {}
setmetatable(o, MyClass)
self.index = MyClass
return o
end
function MyClass:myfunc()
print("myfunc called")
end
c = MyClass:new()
I realise the manual example uses 'self' rather than MyClass - but I'm not looking for inheritance yet.
And I'm wondering why I need both to set the metatable and index to MyClass. Just setting the metatable fills the metatable of c with fields named after the MyClass functions (eg myfunc) that point to the metamethods - so they should be callable? Yet calling them is calling nil. Why do I require index to be set as well?
I've read the manual on the index metamethod and I see how setting index to the MyClass table and the index metamethod is called if there is no field in the metatable - yet the metatable of c has the field myfunc in even if I miss setting index.
https://redd.it/1mt5726
@r_lua
Reddit
From the lua community on Reddit
Explore this post and more from the lua community