Author: MMS
System: Commodore 264 series (16, 116, Plus/4)
Language: CBM BASIC v3.5 (and V7.0)
Lenght of code: 265 characters (BASIC code)
Lenght of ex.code 204 bytes
How to run the code: LOAD+RUN
Description for the version FORFUN:
1. Define the array C with 14 elements and set the volume to max
2. I read the width of the christmas tree's 14 layers into a C array, width of the layer defined in the DATA lines (counted from the Challenge's picture)
3. Before drawing the tree's coming layer, I center the tree by deducting tree's layer width from the 40 (width of C= +4 screen) and divide by two. I used INT function to truncate number for the proper starting position
4. I print as many * characters with a FOR cycle as defined in the layer's C array
5. Between printing the * characters I set a new random color and play a random high frequency sound (BASIC v3.5 specific commands)
6. I repeat it as long as all layers are not drawn
7. Enf of Program
Instead of TAB function I could use +4's CHAR function for positioning, but then it would be only compatible with +4 (and C128).
This version probaly runs on C128 too, but maximum volume is VOL 15, and may set a nicer tone with ENVELOPE command beforehand.