ChipMaster's bwBASIC This also includes history going back to v2.10. *WARN* some binary files might have been corrupted by CRLF.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

175 lines
6.8 KiB

  1. 11111111112222222222333333333344444444445555555555666666666677777777778
  2. 12345678901234567890123456789012345678901234567890123456789012345678901234567890
  3. There were a small number of changes made to the programs in order to make them
  4. runnable. These are apparently due to differences between original Microsoft
  5. Basic and later versions (GW-BASIC, QBASIC).
  6. In all cases, the problem was that the program was taking advantage of a quirk
  7. of original Microsoft basic, which didn't work with later versions. So the
  8. GW-Basic/QBasic Modified sources are simply cleaner version of the originals,
  9. and should be usable for other Basic dialects as well.
  10. <------------------------- THINGS THAT WERE FIXED ----------------------------->
  11. 1. In "Sinewave" the statement:
  12. 40 REMARKABLE ....
  13. Uses a trick that worked with many Basic interpreters that recognize keywords
  14. wherever they appear, even in the middle of other words. This does not work in
  15. GWBasic/QBasic.
  16. MYSTRING$
  17. Are allowed, you would go crazy trying to chase down imbedded keywords. It
  18. worked in neither GW-BASIC nor QBASIC.
  19. 2. (various files) Spacing.
  20. As in example (1), it is not possible to have the statement:
  21. 10IFC$="BARK"THENGOTO20
  22. The keywords must not be run together with other keywords and variable names
  23. (which was sometimes done to save memory space on early machines):
  24. 10 IF C$="BARK" THEN GOTO 20
  25. 3. (varius files) Special characters.
  26. Occasionally, a special character (control character) appears in the programs.
  27. These were REMed out. Special characters in ASCII are characters less than 32 in
  28. value (space).
  29. 8. In the program "hexapawn", the function fns appears before its definition,
  30. which causes a problem with Qbasic. The lines 20 and 25 were swapped.
  31. 9. In the program "hexapawn", line 511 uses an unterminated REM statement. Space
  32. added.
  33. 10. "Hexapawn" has an interesting board output routine that executes tab(10)
  34. (line 1030) multiple times. On the original MS Basic (and other basics) tabbing
  35. to a position that is behind or at the current position is a no-op. GW-Basic and
  36. Qbasic actually throw another line and tabs to the position. This was fixed by
  37. replacing:
  38. 1030 PRINT TAB(10);MID$(P$,S((I-1)*3+J)+2,1);
  39. With:
  40. 1015 PRINT TAB(10);
  41. 1020 FOR J=1 TO 3
  42. 1030 PRINT MID$(P$,S((I-1)*3+J)+2,1);
  43. I.e., move the tab to print position to the outter loop, since it only need be
  44. executed once.
  45. 11. "hilo" makes the unwarranted assumption in line 180 that 100*rnd(1) will be
  46. a number from 1 to 100. Actually, the number will be between 0 and 99, since
  47. exact 0 and exact 1 will never be the result of rnd, and the fraction is
  48. removed. Fixed by changing line 180 to:
  49. 180 Y=INT(100*RND(1)+1)
  50. 12. In "horserace", there is a really bazzare bit of code in lines 570 to 780
  51. where the value of N is used after a for n=..next loop, and apparently it
  52. expects the value to be 8. In both IP Basic and Qbasic it isn't, but is instead
  53. 9, and this results in access to the uninitialized variable d(i) and a zero divide.
  54. Fixed this by adding the line:
  55. 721 n = 8
  56. 13. In "salvo", line 1270, DEF FNA is executed twice, because the code loops
  57. back to that point. On several basics this is not a nice trick, although the
  58. original Microsoft Basic probably tolerated it. The solution was to move the
  59. defines upwards toward the top.
  60. 15. "bowling" does not format correctly on GW-Basic and QBasic. This is because
  61. of the tab issue (see "hexapawn" above). The answer is to replace three existing
  62. lines with the following ones:
  63. 3780 PRINT: PRINT TAB(I+1);
  64. 4140 PRINT "+ ";
  65. 4320 PRINT "O ";
  66. 16. In "awari", GW-Basic and QBasic don't apprecate the odd order of the "for"
  67. statement at 230. This occurs because the Basic implementation is doing more
  68. complete analysis of the Basic source while reading it, and it will get confused
  69. if there aren't matching "next" statements for each "for" statement in the
  70. statements following. The fix was to change the statement at 235 to:
  71. 235 NEXT I
  72. Because all the line did was branch to a "NEXT I" statement.
  73. 17. "checkers" has the "for" issue problem at 1340. The code was changed by
  74. moving the "NEXT A" to each of the for loops on previous lines, based on the
  75. fact that S(X,Y) is invariant in the included code.
  76. 1340 X=R(3):Y=R(4):IF S(X,Y)=-1 THEN B=-2:FOR A=-2 TO 2 STEP 4:GOSUB 1370: NEXT A
  77. 1350 IF S(X,Y)=-2 THEN FOR A=-2 TO 2 STEP 4:FOR B=-2 TO 2 STEP 4:GOSUB 1370:NEXT B: NEXT A
  78. 1360 IF R(0)<>-99 THEN PRINT"TO"R(3);R(4);:R(0)=-99:GOTO 1240
  79. 18. In "qubic" (3d tic tac toe), the line 1560 attempts to run non-existant
  80. program "menu" (and crashes/hangs GW-Basic/QBasic). Change this line to:
  81. 1560 STOP
  82. 19. In "qubic", the "lprint" statement is used to print out the playing board.
  83. This is not useful unless you have a printer connected for DOS use, which is not
  84. common with Windows users. These statements were changed to "print".
  85. 20. "life", the program spills out endless printout, since neither GW-Basic nor
  86. QBASIC appear to respond to control-C unless the program performs input. To fix
  87. this, the following statement was added:
  88. 637 INPUT "PRESS RETURN TO CONTINUE";A12
  89. 21. In "banner", the banner text is printed to the screen, then 75 lines of
  90. blanks are printed to the screen. Unless your screen is more than 75 lines tall,
  91. the program will just result in a blank screen, without apparent action.
  92. Banner was designed for continous print forms, like teletypes or old form feed
  93. printers. The best use of it now would be to save the output to a file, which I
  94. have left up to the users.
  95. 22. In "animal", there were two "for-next" issues, lines 415 and 640. The
  96. solution was to move the next statement to the next line.
  97. 23. "bullfght", the lines 1390 and 1395 were swapped to remove definition order
  98. issue.
  99. 24. "poetry" loops forever, which locks up GW-Basic/QBasic. I added the
  100. following line:
  101. 237 INPUT "PRESS RETURN TO CONTINUE"; A12
  102. You are free to change this to output a whole page before stopping, etc.
  103. 25. "splat" has and error in referencing a non-existant line 540. Its wrong in
  104. the original listing from the book, take a look. It does not appear to affect
  105. the program run, which is probally why it exists. QBasic does not appreciate
  106. gotos that go nowhere, so the line was replaced by:
  107. 610 STOP: REM GOTO 540
  108. 26. In "stock", QBasic didn't like the lack of ";" between print items. This was
  109. added.
  110. 658 PRINT "YOU HAVE USED $";-C5;" MORE THAN YOU HAVE."
  111. <------------------------ THINGS THAT WEREN'T FIXED --------------------------->
  112. 1. "checkers" was seen making impossible moves, jumping a opposing player, but
  113. leaving the original position still there (duplicated piece).
  114. 2. "diamond" does not work quite correctly, I suspect because of the tab issue.
  115. 3. "life2" does not match the printout in the book, which frankly does not make
  116. much sense. It looks like the original relied on overprinting on a teletype.
  117. 4. Animal does not work, giving incorrect printout.
  118. 5. "life" works under GW-Basic, but not QBasic.