scene.org File Archive

File download

<root>­/­parties­/­2023­/­vccc23­/­christmas-diamonds/dmsc_atari_fastbasic_vc3-2023.zip

File size:
17 238 bytes (16.83K)
File date:
2024-01-03 14:15:17
Download count:
all-time: 3

Preview

  • atari-fb/ dir
  • atari-fb/diamond.atr 90.02K
  • atari-fb/diamond.fb 48B
  • atari-fb/diamond.txt 73B
  • atari-fb/fb-result.png 349B
  • atari-fb/fb-source.png 582B
  • atari-fb/file_id.diz 1.40K

file_id.diz

Diamond for Atari 8-bit computers in FastBasic

Author: dmsc
Category: Christmas Challenge
System:   Atari 8-bit
Language: FastBasic
Len source code: 48
Len exe file:    N/A
Len code only:   N/A
Instructions:
  With the provided ATR floppy disk image, type FB to load FastBasic, then load
  the source file pressing CONTROL-L and typing "D:DIAMOND.FB", and finally run
  the program by pressing CONTROL-R

  After the program runs, press the BREAK key to interrupt and return to the
  FastBasic IDE with any key.

Description:
  This program calculates the position of the stars to draw using the following
  formula for each value of N:

            X = ABS((N + 4) MOD 36 - 18)
            Y = N MOD 30 - 11

  Any negative value of X and Y is ignored by the Atari OS, this restrict the
  output to the needed coordinates.

  This is the "expanded" source code of the program:

      DO
        INC N
        POSITION ABS((N + 4) MOD 36 - 18), N MOD 30 - 11
        ? "*";
      LOOP

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. For example,
  here, we use "POS." as abbreviation for "POSITION", "A." to abbreviate
  "ABS()" and "M." to abbreviate "MOD"

  You can compile a standalone executable from the FastBasic IDE by pressing
  CONTROL-W and typing any name ending on ".COM".