
Program: perfectlyclean.prg
Binary size: 134 Byte ($0801 - $0886)
File size: 136 Byte
Source size: 231 Byte
Platform: C64, Language: BASIC V2, PUR-160
Line length: 167 chars, Input length: 143 chars
Editor: C64-Studio, Author: atomcode, Date: 23.12.2025


-= How it works =-

First, the screen is cleared. A holds the base address 1523; that's the center of the snowflake.

Y is the row (STEP 40) as seen from the X-axis upwards (A-Y) and downwards (A+Y). A data is read in each pass of this loop. The data represents the lines of a quadrant, including the X-axis but not the Y-axis.

To draw the Y-axis as well, in each line the POKE value is first set to code 42 for the asterisk, this is POKEd, and then the bits from the last read date are processed.

X cycles through 9 bits of the stored 10 data, with each bit representing one character.

The bits are shifted into bit 0 one after the other by continuously halving the data, then peeked out of bit 0 using an AND filter, and the character code is calculated from this by multiplying the bit by 10 and adding it to the SPACE code 32, which may result in 42, the code for the asterisk.

These chars are written into all four quadrants by adding or subtracting X and Y to or from the center point, i.e., mirrored to the right and down. Hence, the axes are written twice, and the center point is written four times.