scene.org File Archive

File download

<root>­/­parties­/­2025­/­vccc25­/­christmas_challenge/atsampson_acornbbcmicro_bbcbasic_159b_vc3-2025.zip

File size:
33 790 bytes (33.00K)
File date:
2025-12-30 23:34:07
Download count:
all-time: 2

Screenshot (by Demozoo)

Screenshot

Preview

  • bbc3.bas 203B
  • bbc9-code.png 20.75K
  • bbc9-result.png 16.13K
  • bbc9.bas 183B
  • bbc9.ssd 768B
  • file_id.diz 1.45K

file_id.diz

A Star with PROCs

Author:   atsampson
Category: Christmas Challenge
System:   Acorn BBC Micro
Language: BBC BASIC
Len source code: 183
Len exe file:    159
Instructions:
  bbc9.ssd is a disk image that should work in any BBC emulator or a real BBC.
  For example, you could start B-Em with:
    b-em bbc9.ssd
  Or start MAME with:
    mame bbcb -flop1 bbc9.ssd
  Then type this to load and run the program:
    CH."BBC9"
Description:
  See the ASCII file bbc3.bas for an earlier, clearer version of the code;
  bbc9.bas is the final version with some optimisation for size.

  I'm sure this won't be the shortest BBC BASIC version, but I quite liked the
  two techniques it uses:
  - The shape has 8-way symmetry, so each star needs to be drawn in 8 reflected
    locations. This can be done quite neatly in BBC BASIC by overlapping PROC
    definitions, so to reflect on one axis, you call the next PROC with the
    reflected arguments (e.g. -x, y) and then fall through into its definition
    for the unreflected version (x, y). Stack up three layers of this and
    you've got all eight reflections.
  - Each 1/8th of the star can be drawn as two straight lines of 8 stars, plus
    8 additional stars - so one loop can draw all three of these at once.

  The final version turns the list of constants into a string, and unrolls some
  of the PROCs where the unrolled version is shorter (boo).
Comments:
  Mode 7 has the best-looking stars.