7
I'm (still) trying to make another submission to the Largest Number Printable question, and I've got the following bit of code:
f=->a{b,c,d=a;b ?a==b ?~-a:a==a-[c-c]?[[b,c,f[d]],~-c,b]:b:$n}
h=[],$n=?~.ord,[]
h=f[h]until h==p($n+=$n)-$n
Ungolfed:
f=->{b,c,d=a
if b
if a==b # a is not an array
return a-1
elsif a==a-[0] # a does not contain 0
t = [b,c,f[d]]
return [t,c-1,b]
else # a is an array containing 0
return b
end
else # if a == []
return $n
end}
$n = 126
h = [[],n,[]]
until h==0 do
$n += $n
p $n
h = f[h]
end
The conditions I'm working with:
Maximum 100 bytes.
No digits allowed in my code.
My code is currently at 108 bytes, but I can't figure out how to golf it further.
The h==p($n+=$n)-$n
may be replaced with h==0
, but I can't use digits and I still need to print $n
and apply $n+=$n
in the until
loop.
I'm also satisfied with code that replaces $n+=$n
with $n+=1
, but I can't use digits unfortunately.
Any suggestions?
It would be helpful if you could include in your question a version of the code with whitespace and comments so we don’t have to figure every bit out on our own. – Jordan – 2017-12-02T21:43:19.417
@Jordan Updated, sorry. – Simply Beautiful Art – 2017-12-02T22:11:12.560