Jump to content
IGNORED

Great Inventions (Parallel Systems,Inc.) - Modified by me.


jrhodes
 Share

Recommended Posts

Attached is the original version and a version modified by me of Parallel Systems,Inc.'s Great Inventions.
"GREATINVEN" is the original, and "GREATINV" is the modified version.

For some reason, i just could not stand looking at that huge pile of GOTO statements. There just had to be a better way of coding this.
The following lines were removed entirely:
7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51

The GOTO stack was replaced by:
2 @=5040
3 FOR \=1 TO 50
4 @=@+10
5 GOTO @
6 NEXT \

Lines 2030 and 2035 needed to be updated as follows to work with with my removal of the GOTO stack:
2030 ON A GOTO 5050,5060,5070,5080,5090,5100,5110,5120,5130,5140,5150,5160,5170,5180,5190,5200,5210,5220,5230,5240,5250,5260,5270,5280,5290
2035 ON B GOTO 5300,5310,5320,5330,5340,5350,5360,5370,5380,5390,5400,5410,5420,5430,5440,5450,5460,5470,5480,5490,5500,5510,5520,5530,5540

Great Inventions modified and original.zip

Edited by jrhodes
  • Like 4
Link to comment
Share on other sites

Attached is the original version and a version modified by me of Parallel Systems,Inc.'s Great Inventions.

"GREATINVEN" is the original, and "GREATINV" is the modified version.

 

For some reason, i just could not stand looking at that huge pile of GOTO statements. There just had to be a better way of coding this.

The following lines were removed entirely:

7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51

 

The GOTO stack was replaced by:

2 @=5040

3 FOR \=1 TO 50

4 @=@+10

5 GOTO @

6 NEXT \

 

Lines 2030 and 2035 needed to be updated as follows to work with with my removal of the GOTO stack:

2030 ON A GOTO 5050,5060,5070,5080,5090,5100,5110,5120,5130,5140,5150,5160,5170,5180,5190,5200,5210,5220,5230,5240,5250,5260,5270,5280,5290

2035 ON B GOTO 5300,5310,5320,5330,5340,5350,5360,5370,5380,5390,5400,5410,5420,5430,5440,5450,5460,5470,5480,5490,5500,5510,5520,5530,5540

attachicon.gifGreat Inventions modified and original.zip

 

Well this is a perfect example of really bad code even in Basic or XB.

 

The real solution is to use CALL (Subroutine name) and use the @ as a index to that line.

This is how it should be done in TI99/4A XB.

Link to comment
Share on other sites

Attached is the original version and a version modified by me of Parallel Systems,Inc.'s Great Inventions.

"GREATINVEN" is the original, and "GREATINV" is the modified version.

 

For some reason, i just could not stand looking at that huge pile of GOTO statements. There just had to be a better way of coding this.

The following lines were removed entirely:

7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51

 

The GOTO stack was replaced by:

2 @=5040

3 FOR \=1 TO 50

4 @=@+10

5 GOTO @

6 NEXT \

 

Lines 2030 and 2035 needed to be updated as follows to work with with my removal of the GOTO stack:

2030 ON A GOTO 5050,5060,5070,5080,5090,5100,5110,5120,5130,5140,5150,5160,5170,5180,5190,5200,5210,5220,5230,5240,5250,5260,5270,5280,5290

2035 ON B GOTO 5300,5310,5320,5330,5340,5350,5360,5370,5380,5390,5400,5410,5420,5430,5440,5450,5460,5470,5480,5490,5500,5510,5520,5530,5540

Great Inventions modified and original.zip

Neat!!! Looking forward to downloading and playing!!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...