Atari BASIC conversion of David Ahl's classic Basic Computer Games. The book content is also available at Atari Archives and some interesting discussion is at the DigiBarn Online Museum.
Original source code download from http://vintage-basic.net/games.html
Interesting related project: https://github.com/coding-horror/basic-computer-games
I'll try to keep track of how I make changes. There's a recent comparison of Atari to MS BASIC that notes several differences of Atari BASIC compared to other flavors. It points out missing keywords, lack of string arrays, and other screen I/O differences. The book itself has notes about converting to other BASICs but does not include Atari as it was published a year after the Microcomputer Addition. One of the greated differences is in string handling, which is similar to how HP BASIC works, for which techniques are discussed. The books also lists all the MS BASIC commands and statements that are used, so some systematic approach of conversion to Atari would be nice.
The clear screen command is replaced with by ? CHR$(125)
.
As Atari BASIC does not support function definitions, code will have to be changed to remove them.
Will need to establish a regular conditional structure with jumps to deal with a missing ELSE
.
For now assume:
10 IF A THEN PRINT "A" ELSE PRINT "B"
20 REM NEXT STATEMENT
becomes
10 IF A THEN PRINT "A": GOTO 20
15 PRINT "B"
20 REM NEXT STATEMENT
Atari BASIC does not allow INPUT prompts such as INPUT$ "PROMPT";A$
. Instead use ? "PROMPT":INPUT A$
Atari BASIC does not support the TAB() function to insert spaces. It is used original programs to center text on the screen. Common practice for conversions should be to clear the screen, set the lefthand margin to 0 and then center the title text. For example,
9 POKE 82,0: PRINT CHR$(125)
10 POKE 85,13: PRINT "CENTERED TITLE"
In graphics mode, the horizontal cursor location of the 4-line text window is in memory location 657. For example
10 GRAPHICS 6
20 POKE 657, 13: PRINT "CENTERED TITLE"