[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [FUN] A bit of code golfing
- From: Valentin <vsl@...>
- Date: Thu, 29 Sep 2016 02:09:14 +0200
Egor Skriptunoff wrote:
> On Thu, Sep 29, 2016 at 2:59 AM, Valentin <vsl@dasdeck.com> wrote:
>
>> > Only one task is remaining to solve.
>> > Try to find 41-byte solution for Lua 5.1
>>
>> I found one:
>>
>> function NVL(...)return arg[#x+2]or x end
>>
>> It says "attempt to get length of global 'x' (a nil value)"
Yes, realized directly after posting, sorry.
This one works, but has 43 bytes, sigh ;)
function NVL(x,...)return arg[#x+1]or x end