#Brain-Flak, 487810 327722 75564 + 1 = 75565 bytes
Brain-Flak, 487810 327722 75564 + 1 = 75565 bytes
Unfortunately this is a tad big to fit in an answer.
With the -A
flag this outputs an ASCII ppm file that looks as follows:
#Explanation
Explanation
You may have already guessed I did not write this by hand. So here's how I did it:
I first made the image you see above from the image provided by the challenge. It has the distinction of having no color channel that is at any value other than 255
or 0
this way we can wrap it up into a smaller file with the max color channel set to 1. I then wrote a python script to golf a Brain-Flak program that solves this using a module I wrote myself that can be found here. Its not very polished its just a hack I threw together for things like this. push
is a function that returns efficient Brain-Flak code to push a number to the stack and kolmo
is a very simple Kolmogorov complexity solving program that attempts to find an efficient way to push a particular string to the stack.
from value import push,kolmo
def group(a, n):
return zip(*[a[i::n]for i in range(n)])
f=open("R.ppm")
a=["".join(x)for x in group(f.read().split()[3:][::-1],3)]
f.close()
def hardcode(string):
result = push(ord("\n")).join("(<>({})<>"+{"0":"","1":"()"}[x]+")"for x in string)
return result
last = ""
acc = 0
result = push(ord("0"))+"<>"
for x in a+[""]:
if x != last:
string = ("" if not last else kolmo("\n")+hardcode(last))
result += min([push(acc)+"{({}[()]<%s>)}{}"%string,acc*string],key=len)
acc=1
else:
acc += 1
last = x
print result+kolmo("P3 100 100 ")
This was quite fun and I hope to improve my answer