scene.org File Archive

File download

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

File size:
80 011 bytes (78.14K)
File date:
2024-01-03 14:15:18
Download count:
all-time: 2

Preview

  • __MACOSX/ravn_cpm_mbasic_vc3-2023/._file_id.diz 240B
  • __MACOSX/ravn_cpm_mbasic_vc3-2023/._source+result.png 688B
  • ravn_cpm_mbasic_vc3-2023/ dir
  • ravn_cpm_mbasic_vc3-2023/file_id.diz 1.33K
  • ravn_cpm_mbasic_vc3-2023/source+result.png 95.44K
  • ravn_cpm_mbasic_vc3-2023/X3.BAS 79B

file_id.diz

microsoft basic 79 chars

Author: Thorbjørn Ravn Andersen
Category: Christmas Challenge
System:   CP/M (but should work on any 8-bit Microsoft Basic)
Language: Microsoft Basic 5.29 
Len source code: 79 (saved as ascii)
Len exe file:    N/A
Len code only:   N/A
Instructions:
Clone and compile https://github.com/MockbaTheBorg/RunCPM.  I did it on a Mac.
In the RunCPM directory unpack the included DISK.ZIP to A/0
Copy X3.BAS to A/0
Execute the RunCPM binary, this should give an "A0>" prompt
Type "DIR" to verify files are present, including MBASIC.COM and X3.BAS
Type "MBASIC X3" to execute the program.
Type "SYSTEM" to return to the A0> prompt
Type "EXIT" to leave the emulator
Comments:

The code uses the fact that the desired pattern can be drawn using
lines that are 45 degrees giving that an +1 change horisontally 
(variable J)
give either a +1 or a -1 change vertically.  (variable I)
As they also are 6 characters apart this can be done simply by saying
that we look at I+J and I-J modulo 6 to see if an asterisk should be drawn.

The loop values are chosen to ensure that the pattern is drawn correctly and
to avoid that (I-J) becomes negative which appeared to confuse MOD.

The CHR$ replaced an IF...THEN?"*";ELSE?" " construction to save two characters. 
The ">0" returns -1 if true.

This was fun.  Thanks
Mac OS X        	2¾ðATTRð˜X˜Xcom.apple.quarantineq/0083;658a0a0a;com.apple.Safari.SandboxBroker.xpc;1A025890-209B-4C66-83EC-5481AA800CB9