Questions tagged [lua]

This challenge is related to the Lua language. Note that challenges that require the answers to be in a specific language are generally discouraged.

Filter by
Sorted by
Tagged with
28 votes
11 answers
4k views

Tips for golfing in Lua

What general tips do you have for golfing in Lua? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to Lua (e.g. "remove comments" is not ...
scheurneus's user avatar
28 votes
12 answers
4k views

Compress 8 bits to 6 when certain bit patterns will never occur

Consider an eight bit number in which an even position bit will never be 1 if one of its neighbors is 0 (considering MSB and LSB as neighbors). There are fewer than 64 such numbers, so there is at ...
Sparr's user avatar
  • 6,058
7 votes
1 answer
818 views

How can I shorten this multiple assignment in Lua?

Is there any better way to golf this (other than removing newlines/indentation)? ...
Phrogz's user avatar
  • 221
7 votes
2 answers
2k views

Smallest Lua table copy

So I really like to mess with tables and shallow and deep copies and I can do it in 239 chars! I wonder if there's a shorter way to do it... Rules: It must be done in less than 239 chars. You must ...
SoniEx2's user avatar
  • 377
1 vote
5 answers
2k views

Lua: Render a chess board in smallest code [closed]

I'm creating a simple challenge here as a first test of the community's reactions. Please let me know if this challenge is the kind of thing you guys like or what I can improve... :) The task is this:...
Stefan Reich's user avatar