scene.org File Archive

File download

<root>­/­parties­/­2021­/­vintagecomputingchristmaschallenge21­/­challenge/vc3_2021_python_mmakaay.zip

File size:
600 379 bytes (586.31K)
File date:
2021-12-25 12:55:53
Download count:
all-time: 13

Preview

  • file_id.diz 1.41K
  • screenshot.png 607.95K
  • tree_00.py 55B
  • tree_00.README.txt 3.46K
  • tree_01.py 57B
  • tree_01.README.txt 3.76K
  • tree_02.py 66B
  • tree_03.py 66B
  • tree_03.README.txt 4.35K
  • tree_04.py 68B
  • tree_04.README.txt 4.63K

file_id.diz

Challenge URL: http://logiker.com/Vintage-Computing-Christmas-Challenge-2021
Author: Maurice Makaay
System: Linux
Language: Python 3
Length of source code: 55 bytes
Length of executable: 55 bytes

This archive contains multiple Python-based solutions for the challenge.
My personal target was to draw the Christmas tree using the least amound
of source code as possible, also known as "code golf".

I wrote multiple solutions, using various strategies. I bundled the ones
that I found most interesting in this archive.

Normally, the smallest code golf solutions also are the least readable ones
and cause the most cognitive burden when trying to understand their inner
workings. What I really enjoyed when I got to my final 55 byte version,
is that this one is actually the easiest to read and understand.

Available solutions:

 code file  | size | explanation        | strategy
------------+------+--------------------+--------------------------------------
 tree_00.py |   55 | tree_00.README.txt | Tree widths encoded in base 24 input
 tree_01.py |   57 | tree_01.README.txt | Tree widths encoded in ASCII chars
 tree_02.py |   66 | n/a                | Slight improvement of tree_04.py
 tree_03.py |   66 | tree_03.README.txt | Tree widths encoded in nibbles
 tree_04.py |   68 | tree_04.README.txt | Compute using DIV/MOD logic
------------+------+--------------------+--------------------------------------