Diamonds Author: Ethan Dicks Category: Christmas Challenge System: Commodore PET (and other 8-bit Commodore machines, C-64, VIC-20...) Language: Commodore 8-bit BASIC Len source code: 135 bytes (not including BASIC load address) Len exe file: n/a Len code only: n/a Instructions: Works with VICE (xpet, etc). Can load from host filesystem or from a disk image Description: Relies on auto-DIM of arrays to 10 elements and that uninitialized strings are null. Program uses one loop to read string fragments and to count through 25 total "lines", but there are only six strings in the data statement. When X AND 7 == 6 or 7, those elements are unset, so nothing gets printed for those values of X (this logic could be simpler if Commodore BASIC had a modulus operator, but it does not). Additionally, the strings in the data statement are 1/3 of a line, so the strings are printed 3 times per line. For the exception case of the widest point of the diamond, that line is checked for, and an additional trailing "*" is printed. Comments: Line 1 is too long to be typed in with an 80-column editor limitation. Runs on most versions of 8-bit Microsoft BASIC, as long as logical terms "(X=3)" evaluate to -1.