Celestial BASIC – Lunar Eclipses

I used my Pico MZ-80K emulator to create a version of the ECLIP program from Celestial BASIC by Eric Burgess. The code correctly predicts that the next lunar eclipse is due on 14th March 2025.

Output from the ECLIP program, showing that the next lunar eclipse is due on March 14th 2025. The magnitude of the eclipse will be 1.19.
Output from the “ECLIP” program, pages 59-64, Celestial BASIC

I’ve tidied the output somewhat and there are clearly other optimisations that could be made. For example, there’s a calculation on line 530 that is always constant. However, for that true retro feel I’ve left the code largely unchanged.

It’s also been run through my mzfview program – a good test, as there’s both an exponentiation operator and a pi constant used in the code (lines 360 and 240 respectively).

Part of the BASIC code for the ECLIP program (number 9) from "Celestial BASIC"
The first half of the code for “ECLIP” – program 9 from Celestial BASIC by Eric Burgess. Output produced by my mzfview utility program. Line 240 shows the pi symbol, line 360 the exponentiation symbol and line 530 is bonkers.

The mzf file for this program is in my Sharp MZ-80K programs repository.