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

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 ...
28 votes
12 answers

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 ...
7 votes
2 answers

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 ...
7 votes
1 answer

How can I shorten this multiple assignment in Lua?

Is there any better way to golf this (other than removing newlines/indentation)? ...
1 vote
5 answers

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:...