Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
For code written in Lua, or built to interface with Lua (e.g. native code providing Lua functions).
2
votes
Censoring words in lua
If you care about performance, you should have a look at LPeg. It makes it way easier to handle large numbers of string matching and substitution rules.
For example, you could define patterns and the …
3
votes
Accepted
Currying in Lua
Repeated string interpolation and concatenation in Lua are slow because 1) it needs to constantly allocate new space and 2) it needs to hash every intermediate result. … It also lets Lua allocate space for the entire result string from the start, though I am not sure if it does that for string.concat. …
1
vote
I wrote my first pathfinding algorithm
The board's dimensions can be saved inside the board itself, since Lua tables can act as both arrays and objects at the same time. …
5
votes
1
answer
786
views
Collision detection for moving 2D objects
purely meant for 2D, no intention to try it in 3D
most shapes will be rectangles, on average they may have at most 10 or so vertices
Vectors and segments are implemented using LuaJIT FFI structs, not Lua …
1
vote
Accepted
Building a 64 × 64 particle accelerator frame in Minecraft with a computercraft turtle
First of all, use more local. It will save you a lot of headache in the future.
Instead of the three place functions, you could just do
local function selectAnyBlock()
for i=1,16 -- 4 x 4 inventor …