2

I've decided to port Chase! to Swift, apparently because I am insane. In any event, I'm trying to collect the various switches in versions from the era.

One of these is unique, found here under the alternative name Escape! for the TRS-80. This version adds a "tank", and I'm going cross-eyed trying to figure out it's logic.

My question is simply "can the tank be destroyed?"

Following the code line-by-line is difficult in the print form. I tried to OCR the code using a couple of packages on the 'net, but the results were surprisingly abysmal considering the original quality seems quite good (check the PDF version).

1

1 Answer 1

2

It's just a single page ... of true spaghetti code :))

AFAICT the tank (A(x,y)=25 and B(1/2,1)) elimitnates everything on it's way.

  • Moves of attackers into him (line 610) eliminate them (line 630).
  • If the player runs into him (line 540) game is lost.

There are like a dozend or more places where the code can be straightened and some other where it can be simplified a lot - not at least by removing unneccessary jumps, and more so by not using variables for different purpose. It seams as if this program has been ported several times and somehow hacked each time.

5
  • 1
    That is precisely what happened, ports of ports of ports. The version in More BASIC games is much easier to read but lacks the tank. Now I'm confused about the win condition though... but that one I can get. Thanks! Apr 2, 2019 at 21:07
  • The win condition is to simply kill the Robots. The Tank represents an unstoppable robot. Everything moves at the same speed, and uses the same simple logic. The tank kills everything (Robots, mines, you). But if you run out of Robots, you win. In other versions of this game, where the field is bigger, and the number of Robots increase each round, it's easy to be in a position where you're behind a Mine, and the last Robot(s) is far away, so you simply have to wait them out. With the Tank, if the Tank is closer to you than the last Robot is to a mine -- then, tough luck. Use the '9' key. Apr 2, 2019 at 21:25
  • Yes, I see that's in the N3=5. I think this program would be much easier to read if they put the variable list in front of the code instead of the demonstration output! Apr 2, 2019 at 21:27
  • Oh, don't trust the list - there are several errors. Like giving 2-5 as index for the attackers, while it's 2-6 and likewise 7 is the player. Or mentioning Y as the variable taking the user input, but not telling that it's as well used as a coordinate (with X) in many routines. and so on. I'd say you better take the knowledge about the workings and do a clean room reimplementation instead of a port :))
    – Raffzahn
    Apr 2, 2019 at 21:43
  • I've got the implementation to the point where it's processing the user input. Everything up to that point is actually well structured even though the formatting hides that somewhat. Unfortunately, it gets somewhat confusing at that point and I'd have to sit down and dry run the code a bit to finish the implementation.
    – JeremyP
    Apr 3, 2019 at 10:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .