These are the
variables used in the original program. I changed these to reasonably meaningful names. I tend to favour pascal capitalization
LikeThis, though I may have missed the odd one.
- A, I, M and J - General reuse for input and loop indices.
- S, G, L, P, R, W and T - Subroutine line numbers also generally reused.
- O - DOcked Flag.
- U and V - Location of Enterprise in Quadrants.
- X and Y - Location of enterprise in Sectors.
- F - Number of Photon Torpedoes.
- E - Enterprise Energy.
- D - Days Left.
- C - Casualties.
- K - Number of Klingons.
- N - Number of Klingons in Quadrant.
- B - number of Starbases.
- H - Number of Klingons to kill. (Copy of K)
- Y - Difficulty Level. 2999 (Normal), 999 (Hard) or 987 (replay After being Killed).
How the @ Array was used
- 0-63 Quadrants - Each Quadrant has a 3 digit number. KBS where K = # Klingons, B = Bases, S= # Stars.
- 64-70 Damage flags for Starship equipment as follows. Numbers 64-70 are positions in the @ array.
- short_range_sensors - 64
- computer_display - 65
- long_range_sensors - 66
- phasers - 67
- warp_engine - 68
- photon torpedo tubes - 69
- shield - 70
- 71-127 Sectors Each sector holds an single int with the following values:
0 Empty
1 Klingon
2 StarBase
3 Star
4 Enterprise
- 134-151 Klingons (3 x 6 bytes)
- (134-139) - Energy. Initially 300
- (140-145) - Sector X of Klingon
- (146-151) - Sector Y of Klingon
On the next page : Architectural changes I made