scene.org File Archive

File download

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

File size:
93 029 bytes (90.85K)
File date:
2024-01-03 14:15:18
Download count:
all-time: 6

Preview

  • diamonds.prg 53B
  • diamonds.txt 78B
  • file_id.diz 905B
  • result.png 90.66K

file_id.diz

51 byte Christmas Diamonds in Basic

Author: serato / finnish gold
Category: Christmas Challenge
System:   C64
Language: C64 Basic V2
Len source code: 78
Len exe file:    53
Len code only:   51
Instructions:
Load PRG and run
Description:
The desired repeating diamond pattern may be constructed as the union of forward-
leaning diagonal stripes /// and backward-leaning diagonal stripes \\\. As these
are just mirror images, this code only calculates the x values of the backward
leaning stripes over a range of [-17,18] and uses ABS() to fold the negative
values onto the positive range.
Comments:
1. C64 Basic V2 has no modulo function. The conventional substitution is
x-n*INT(x/n). The coarse X offset is added inside the brackets.
2. The key to this working is giving TAB() random access, which is achieved by
allowing the natural carriage return provided by PRINT, and cursoring up one line.