snowflake (BASIC) 1.2
Author: David Payne
Category: Christmas Challenge 2025
System: BBC Micro
Language: BBC BASIC
Len source code: 70 bytes
Len exe file: 70 bytes
Len code only: 70 bytes
Instructions:
Save the VCCC25.ssd file on your local PC
From the https://bbc.xania.org website
click on Discs
From examples or local
Choose file
select the saved VCCC25.ssd file
enter CHAIN"PROGRAM"
Description:
the program is simply:
for y = -9 to 9
for x = -9 to 9
if expression then print "*"; else print " ";
next x
print
next y
I realised that abs(x)*abs(y) is the key to it all due to the 8-fold symmetry. The 1st term looks
complex but it simply checks whether abs(x)*abs(y) is equal to 0 or 4 or 7 or 10 or 16 or 30 or 35.
the expression is comprised of 2 terms, when they are ORed together they give the whole snowflake.
INSTR(" $'*0>C",CHR$(ABSx*ABSy+32))>0 gives:
.........*.........
.......*.*.*.......
....*...***...*....
....*....*....*....
..**...*.*.*...**..
.....*..***..*.....
.........*.........
.*..*..*.*.*..*..*.
..*..*...*...*..*..
*******************
..*..*...*...*..*..
.*..*..*.*.*..*..*.
.........*.........
.....*..***..*.....
..**...*.*.*...**..
....*....*....*....
....*...***...*....
.......*.*.*.......
.........*.........
ABSxMOD9MOD8=ABSy gives:
...................
...................
..*.............*..
...*...........*...
....*.........*....
.....*.......*.....
......*.....*......
.......*...*.......
........*.*........
**.......*.......**
........*.*........
.......*...*.......
......*.....*......
.....*.......*.....
....*.........*....
...*...........*...
..*.............*..
...................
...................
Comments:
To type this program in manually, press shift F3 instead of typing in MOD. This saves 1 space that
would normally be required before the MOD.
It was a bit trickier this year, but still fun. Thanks to Logiker for running this contest again.