scene.org File Archive

File download

<root>­/­parties­/­2022­/­vccc22­/­christmas_star_challenge/dudleysoft_bbc_basic_vc3-2022.zip

File size:
15 481 bytes (15.12K)
File date:
2022-12-30 11:32:13
Download count:
all-time: 4

Preview

  • christmas_star.ssd 200.00K
  • file_id.diz 1.59K
  • result.png 5.01K
  • source.png 10.16K
  • source.txt 156B
  • STAR 120B
  • STAR.inf 19B

file_id.diz

Christmas Star

Author: DudleySoft
Category: Christmas Challenge
System:   BBC Micro
Language: BASIC
Len source code: 156 bytes
Len exe file:    120 bytes
Len code only:   120 bytes
Instructions:
In BeebEm select File->Load Disc 0...
Select christmas_star.ssd
Press Shift-F12
The file STAR is the tokenised BASIC program as included on the disc image, it can be put onto a DISK image using tools found online, a .INF file is included to ensure that the file can be correctly written by those tools.

Description:
The code creates the star mirrored in both axies, the data is stored as two nibbles written as ASCII characters into the rem statement at the end of the line of code and read directly from the end of the program rather than from DATA statements. 

The high nibble is the offset from the edge of the star, the low nibble is the number of stars that section contains, a string is built that many stars long and is then plotted top-left,top-right, bottom-left and bottom-right towards the middle of the star. 

I added an indent of 2 to bring all the values into the range of printable ASCII characters so I could type them directly into the code. 

I have removed redundant spaces from the code, including changing DIV to / and swapping the order of the AND so the space can be removed (AAND wont tokenise but ANDA will)


Comments:
I did consider trying to implement this in assembler but it would have turned out larger than this code, I would need a completely different method for assembler which wouldn't translate back into BASIC easily, so I've decided to stick with my BASIC version.