July 31, 2025

Tiny Code Christmas - Day 1

Link to the first day

On day 1, we created the image of an christmas tree and a snow man in 256 bytes.

For painting the christmas tree, we used a series of green triangles.
In a loop, we draw increasingly larger triangles symmetrical around the tree stump:

for i=y,80,10 do
tri(150, i/2, -- first point
150 - i/2, i, -- second point
150 + i/2, i, -- third point
7)
end

The tree got an yellow star on top out of a small circle of radius 1.

The snowman we built out of two white circles for the body, one red circle for the nose, two circles for eyes and two lines for the arms.
The coordinates were all handcoded since there was space left for the 256 bytes limit.

To save space, we abbreviated the function calls to a single character (`c` instead of `circ`)

Link to my solutions

Here is the resulting image: 


No comments:

Post a Comment