Gift for Atari 8-bit computers in FastBasic
Author: dmsc
Category: Christmas Challenge
System: Atari 8-bit
Language: FastBasic
Len source code: 74
Instructions:
Run the provided ATR floppy disk image in any Atari 8-bit emulator (Altirra
or Atari800 are good ones), type FB to load FastBasic, then load the source
file pressing CONTROL-L and typing "D:GIFT.FB", and finally run the program
by pressing CONTROL-R
After the program runs, press any key to return to the FastBasic IDE.
Description:
This program uses a simple loop to check if it needs to print any of the gift
characters, '!' if the X coordinate modulo 9 is 0, '-' if the Y coordinate
modulo 9 is 0 and '+' if both are 0 modulo 9.
This is the "expanded" source code of the program:
' Print the bow
? TAB(10) "\O/"
' And now the gift, 19 rows of 19 columns
FOR Y=0 TO 18
FOR X=0 TO 18
' Print the correct character in each position
? " !-+"[1 + (X MOD 9 = 0) + 2 * (Y MOD 9 = 0), 1];
NEXT
?
NEXT
Comments:
FastBasic is a good language to write small source code, as all keywords can
be abbreviated, and the language does not use line numbers.
Also, we use the TAB function in the first PRINT to advance to the correct
position to show the bow.
You can compile a standalone executable from the FastBasic IDE by pressing
CONTROL-W and typing any name ending on ".COM".