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
27
votes
12answers
3k 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 ...
7
votes
1answer
296 views

How can I shorten this multiple assignment in Lua?

Is there any better way to golf this (other than removing newlines/indentation)? ...
7
votes
2answers
1k 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 ...
22
votes
10answers
2k 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 ...
1
vote
5answers
1k views

Lua: Render a chess board in smallest code

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