OUTPOST: Print weapon names when keys hit#20
OUTPOST: Print weapon names when keys hit#20hackerb9 wants to merge 3 commits intodplassgit:trunkfrom
Conversation
Other changes: * Prints results (miss, hit) on the same line as targetting. * Shows ellipsis animation before Missed or Hit. * Show "Target Destroyed" on last line instead of erasing previous line. * Use semicolon after print statements to prevent unintended scrolling. * Clear lines using CL$=CHR$(13)+SPACE$(39)+CHR$(13) instead of relying on each print statement to end with the right number of spaces.
dplassgit
left a comment
There was a problem hiding this comment.
Thanks for the PR! I haven't gotten a chance to patch it and play with this version yet.
t100/outpost/OUTPST.DO
Outdated
| 1020 ?@P,"TYPE: "; | ||
| 1030 FOR G=1 TO 4: ?E$(ET(G))" ";: NEXT | ||
| 1100 P=P+40: ?@P,"DIST:": P=P+40: ?@P,"PROB:": P=P+40: ?@P,"ENGY: | ||
| 1100 P=P+40: ?@P,"DIST:": P=P+40: ?@P,"PROB:": P=P+40: ?@P,"ENGY:"; |
There was a problem hiding this comment.
This change isn't needed. Since the next print (line 1125) is an @P, there's no need for the semicolon ending on line 1100. Same thing for many of the other lines that were updated in this file.
In general I follow the premise that trailing strings do not need a closing quote. See https://www.ordersomewherechaos.com/rosso/fetish/m102/web100/docs/basic-tips.html : "Eliminate final quote marks on all literals that appear at the ends of lines. A byte is saved for each."
There was a problem hiding this comment.
If that's what you prefer for this project, that's what I'll do.
t100/outpost/OUTPST.DO
Outdated
| 6030 IF A$="C" OR A$="c" THEN GOSUB1000: RETURN | ||
| 6035 IF (A$="S" OR A$="s") AND S>0 THEN ?"SECONDARY BATTERY": A=4: Z=5: GOSUB20: S=S-FA: IF S<0 THEN S=0 | ||
| 6040 IF (A$="T" OR A$="t") AND T>0 THEN ?"TORPEDO": A=9: T=T-1 | ||
| 6060 IF A<3 THEN ?@M1,CL$;"BAD INPUT!";: FORZ=1TO500: NEXT: GOTO6000 |
There was a problem hiding this comment.
?@M1,CL$"BAD INPUT!"
(no semicolon in the middle, no trailing semicolon) is more canonical and follows the pattern in the rest of the file.
Same comment elsewhere (lines 6100, 6240, etc.)
There was a problem hiding this comment.
Sure. Note that the semicolon is not superfluous when printing to the final line of the screen.
t100/outpost/OUTPST.DO
Outdated
| 2999 REM Move ship positions, test for supply ship, test for die | ||
| 3000 ?@M1,"ENEMY FIRING & MOVING | ||
| 3010 ?@M2,SPACE$(39) | ||
| 3000 ?@M1,CL$;"ENEMY FIRING & MOVING"; |
There was a problem hiding this comment.
Since cl$ has two newlines, this may not show up in the right place. How does it look on the machine?
There was a problem hiding this comment.
It has two carriage returns, which puts the cursor to the beginning of the line without advancing to a new line.
| 5330 M%(EY(G), EX(G))=48+G-30*(G=5) | ||
| 5400 RETURN | ||
| 5999 REM Get input and fire weapon | ||
| 6000 ?@M1,"WEAPON (M/S/T/C): |
There was a problem hiding this comment.
The extra spaces after the weapon were to erase whatever might have been left over from "ENEMY FIRING & MOVING". Does it look OK?
They are not necessary in this dialect.
|
Okay, I've removed all the superfluous end quotation marks and interstitial semicolons. Let me know if this works for you. |
Other changes:
CL$=CHR$(13)+SPACE$(39)+CHR$(13)instead of relying on each print statement to end with the right number of spaces.