I'm not sure if this is the right place to ask, but I found this similar question so I'll go ahead.
I'm very new to code golfing, so keep your smothered laughs and throw-up emoji's to yourselves please ;). Anyway, someone recently posted a challenge (that was shortly deleted) to draw a 16x16 pixel image of the Old Man from the original Legend of Zelda, who gives you the wooden sword.
Here's my code (643 characters):
from PIL import Image,ImageColor
g=ImageColor.getrgb
r=range
l=[list('0000033333300000000023233232000000003313313300000000331331330000000042333324000000042222222240000044220000224400044224222242244034424422224424433444442222444443344404422440444304440444444044400444044444404440004044444444040000004444444400000004433443344000'[i*16:i*16+16])for i in r(16)]
i=Image.new('RGB',(16,16),color='black')
for j in r(16):
for k in r(16):
t=k,j
v=l[j][k]
if v=='2':
i.putpixel(t,g('white'))
if v=='3':
i.putpixel(t,g('#FFC864'))
if v=='4':
i.putpixel(t,g('red'))
i.show()
It's bad, I know. Anyway, anyone care to share some tips on shortening it?
1
in your encoding supposed to represent? \$\endgroup\$