Lunar Lander for SCELBI and is there a “Solution”?

While putting the finishing touches on a new version of my OS/X SCELBI app, I spent some time porting over the classic Lunar Lander game program to SCELBAL. I started with the version from a 1978 edition of “BASIC Computer Games” by David H. Ahl. I bought my edition of that book back in 1978, along with my Apple II.

BASIC Computer Games

BASIC Computer Games

I remember trying to type in a game from this book, the first night that I had the Apple II, only to almost immediately run out of memory. I initially purchased a 4K Apple II system, and only about 2K was usable by BASIC, so it didn’t take much to exceed it’s memory capacity.

Anyway, back to the present. I found porting Lander to SCELBAL was pretty easy. I had two issues.

  • First was an issue with the calculations exceeding the 6 digits of precision supported by SCELBI floating point, which caused a math error. This was fixed by changing the compare instruction at line 340 to IF S <5E-1 THEN 260 instead of S<5E-3 then 260, which reduced the amount of precision required.
  • The second issue is that SCELBI doesn’t support multiple statements on one line, which was easily rectified.
  • While working on this, I wondered if there was a single number solution for Lunar Lander. Using a simple binary search mechanism and multiple copies of the SCELBI app, I was able to determine that with 6 digits of precision allowed by SCELBAL that there isn’t a single number that can be entered every time and result in a safe landing. The closest I could get is a burn rate of 76.4386, which results in a crater only 33.83179 feet deep. Entering a number of 76.4387 results in an out of fuel situation, as the lander just misses landing before proceeding to accelerate upward after which it runs out of fuel and then comes crashing back down.

    As far as releasing an updated SCELBI app, it is in pretty good shape and I should be releasing it within the next week. I’ve taken advantage of a holiday break from work in order to make significant improvements and revisions and I think this version will be a vast improvement over the last release.

    Oh and here is a link to the ported version of Lunar Lander.