scene.org File Archive

File download

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

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

Preview

  • file_id.diz 1.65K
  • result.jpg 57.60K
  • source.jpg 72.79K
  • source.txt 73B

file_id.diz

<Christmas Challenge>

Author: <Agustín Morales>
Category: <Christmas Challenge>
System:   <BBC Computer Model B>
Language: <BBC Basic VI Version I>
Len source code: <70 bytes>
Len exe file:    <? bytes>
Len code only:   <? bytes>
Instructions:
I have not been able to make an autoexecutable file
 with this emulator, but it can be done:

<1. You can use the BeepEm emulator>
<2. Copy the code (bbc.txt)>
<3. In the emulator: Edit->Paste>
<4. Press Enter>
<5. Type: CLS:RUN>
<6. Press Enter>
Description:
RND(19)-1:Y=RND(19)-1
Generate two random coordinates between 0 and 19

IFABS(X MOD6-3)+ABS(Y MOD6-3)
By doing MOD 6 we reduce any point to the first quadrant
The points of the first rhombus verify that: 
ABS(X MOD6-3)+ABS(Y MOD6-3)=3
Being (3,3) the coordinates of the center of the rhombus

The IF statement ensures that only points that meet that condition are printed.

Comments:
I originally made the code for ZX Basic, but BBC Basic has some advantages
in terms of reducing the length of the source code. In particular:
- It is not mandatory to use LET
- It has the MOD function
- The RND function is also shorter,
- It allows joining some statements by making IFABS instead of IF ABS,
 or MOD6 instead of MOD 6 etc...
- It also allow abbreviations V. instead of VDU, and G.1 instead of GOTO .By the way
 this means that last year's winning code could have been 4 bytes more shorter:
1F.y=-8TO4:F.x=-4TOy+4:V.31,x*SGNRND+8,y*SGNRND+9,42:N.


Finally my apologies since I don't know how to calculate the Len exe file and Len code,
the Len source code. I have calculated the len source code by counting the number of characters