Advertisement
LBASIC

QBasic Tank Game - Source Code

Mar 19th, 2023 (edited)
623
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QBasic 14.35 KB | None | 0 0
  1. 'ÍËÍ Ò Ò ÉÍÍ          
  2. ' º  Ì͹ ÌÍ        
  3. ' Ð  Ð Ð ÈÍÍ      
  4. '         ÛÛÛÛÛÛÛÛÛÛ   ÜÛÛÛÛÜ   ÛÛÛ    ÛÛ   ÛÛ     ÜÛÛ         ÚÄÄÄÄÄ¿
  5. '   ÛÛ      ÛÛß  ßÛÛ  ÛÛÛÛ   ÛÛ   ÛÛ   ÜÛÛß          ³     ³ÍÍÍÍÍ
  6. '   ÛÛ      ÛÛ    ÛÛ  ÛÛ ÛÛ  ÛÛ   ÛÛ ÜÛÛß      ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
  7. '   ÛÛ      ÛÛÛÛÛÛÛÛ  ÛÛ  ÛÛ ÛÛ   ÛÛÛÛÛÛÜ      ³ _______________ ³
  8. '   ÛÛ      ÛÛ    ÛÛ  ÛÛ   ÛÛÛÛ   ÛÛß  ßÛÛÜ     ÚÄ¿øøøøøøøøøøøÚÄ¿
  9. '   ÛÛ      ÛÛ    ÛÛ  ÛÛ    ÛÛÛ   ÛÛ     ßÛÛ    ÀÄÙ           ÀÄÙ
  10. '        ÉÍÍ» ÉÍ» ɻɻ ÉÍÍ
  11. '        º Í» Ì͹ ºÈ¼º ÌÍ
  12. '        ÈÍͼ Ð Ð Ð  Ð ÈÍÍ
  13. '  Press "F5" to play
  14. '
  15. 'If the screen flickers too much while you are playing the game, or the game
  16. 'goes to fast, make the number after "Flicker.Control =" bigger.  If the game
  17. 'goes to slow, make the number smaller.
  18. Flicker.Control = 60000
  19. 'Programmed by Jeff Lewis
  20. '
  21. SCREEN 7  '320 x 200
  22. RANDOMIZE TIMER
  23.  
  24. CLS
  25. LOCATE 10, 1
  26. PRINT "Welcome to"
  27. PRINT
  28. PRINT "          The Tank game."
  29. PRINT
  30. PRINT "Do you need instructions? y/n"
  31.  
  32. instruct.y.n:
  33. y.n$ = INKEY$
  34. SELECT CASE y.n$
  35. CASE "y"
  36. GOTO instruct
  37. CASE "n"
  38. GOTO start
  39. END SELECT
  40. GOTO instruct.y.n
  41.  
  42. instruct:
  43. CLS
  44. LOCATE 1, 1
  45. PRINT "The object of the game is to shoot your"
  46. PRINT "opponent.  There are two sets of"
  47. PRINT "controls for each player, one to steer"
  48. PRINT "the tank, and the other to aim the gun."
  49. PRINT "For the blue tank, the buttons i, j, k, "
  50. PRINT "and l steer the tank.  Buttons e, s, d,"
  51. PRINT "and f aim the gun.  Their directions are"
  52. PRINT "in the same layout as the arrow keys."
  53. PRINT "The space bar is his fire button.  For"
  54. PRINT "the white tank, the numeric keypad (make"
  55. PRINT "sure Num Lock is on) steers the tank, "
  56. PRINT "while the arrow keys aim the gun.  For "
  57. PRINT "steering, the tank will go in the"
  58. PRINT "direction of the arrow on the key.  The"
  59. PRINT "0 is his fire button.  If you  are"
  60. PRINT "playing a one player game, you are white"
  61. PRINT "and the computer is blue."
  62. PRINT
  63. PRINT "Note: You can only fire one shell at a"
  64. PRINT "time.  If you try to fire another, your"
  65. PRINT "first shell will disappear."
  66. start:
  67. num.players = 3
  68. PRINT
  69. PRINT "How many players? (1/2) "
  70. WHILE num.players <> 1 AND num.players <> 2
  71. num$ = INKEY$
  72. SELECT CASE num$
  73. CASE "1"
  74. num.players = 1
  75. PRINT "1"
  76. CASE "2"
  77. num.players = 2
  78. PRINT "2"
  79. END SELECT
  80. WEND
  81.  
  82. IF num.players = 1 THEN
  83. PRINT
  84. PRINT "Easy ,Difficult, Super Hard,"
  85. PRINT "or Impossible? e/d/s/i"
  86. difficulty$ = "0"
  87. WHILE difficulty$ <> "e" AND difficulty$ <> "d" AND difficulty$ <> "s" AND difficulty$ <> "i"
  88. diff$ = INKEY$
  89. SELECT CASE diff$
  90. CASE "e"
  91. difficulty$ = "e"
  92. s.difficulty$ = "e"
  93. PRINT "Easy"
  94. CASE "d"
  95. difficulty$ = "d"
  96. s.difficulty$ = "e"
  97. PRINT "Difficult"
  98. CASE "s"
  99. difficulty$ = "d"
  100. s.difficulty$ = "s"
  101. PRINT "It can be done."
  102. CASE "i"
  103. difficulty$ = "d"
  104. s.difficulty$ = "i"
  105. PRINT "You're in for it, now."
  106. END SELECT
  107. WEND
  108. END IF
  109.  
  110. PRINT
  111. IF num.players = 2 THEN
  112. PRINT "What is the person's name who will be"
  113. INPUT "driving the blue tank? ", tanka.NAME$
  114. ELSE
  115. tanka.NAME$ = "Computer"
  116. computer.duration = 0
  117. computer.time = 0
  118. END IF
  119. PRINT
  120.  
  121. PRINT "What is the person's name who will be"
  122. INPUT "driving the white tank? ", tankb.NAME$
  123. PRINT
  124. INPUT "How many rounds do you want to play? ", rounds.limit
  125. rounds = 0
  126. tanka.score = 0
  127. tankb.score = 0
  128. n.y = 1
  129. newround:
  130.  
  131. IF rounds >= rounds.limit THEN
  132. GOTO finish
  133. END IF
  134.  
  135. rounds = rounds + 1
  136.  
  137. tanka.direction$ = "E"
  138. tankb.direction$ = "W"
  139. tanka.aim$ = "E"
  140. tankb.aim$ = "W"
  141. tanka.x = 20
  142. tanka.y = 100
  143. tankb.x = 300
  144. tankb.y = 100
  145. tanka.missile.x = -5000
  146. tanka.missile.y = -5000
  147. tankb.missile.x = -5000
  148. tankb.missile.y = -5000
  149. tanka.missile.direction$ = "0"
  150. tankb.missile.direction$ = "0"
  151.  
  152. a:
  153.  
  154. CLS
  155.  
  156. LINE (tanka.x - 10, tanka.y - 10)-(tanka.x + 10, tanka.y + 10), 9, BF
  157. LINE (tankb.x - 10, tankb.y - 10)-(tankb.x + 10, tankb.y + 10), 15, BF
  158. LINE (tanka.missile.x - 1, tanka.missile.y - 1)-(tanka.missile.x + 1, tanka.missile.y + 1), 15, B
  159. LINE (tankb.missile.x - 1, tankb.missile.y - 1)-(tankb.missile.x + 1, tankb.missile.y + 1), 9, B
  160.  
  161. COLOR 15
  162. SELECT CASE tanka.aim$
  163. CASE "N"
  164. LINE (tanka.x, tanka.y)-(tanka.x, tanka.y - 10)
  165. CASE "E"
  166. LINE (tanka.x, tanka.y)-(tanka.x + 10, tanka.y)
  167. CASE "S"
  168. LINE (tanka.x, tanka.y)-(tanka.x, tanka.y + 10)
  169. CASE "W"
  170. LINE (tanka.x, tanka.y)-(tanka.x - 10, tanka.y)
  171. END SELECT
  172.  
  173. COLOR 1
  174. SELECT CASE tankb.aim$
  175. CASE "N"
  176. LINE (tankb.x, tankb.y)-(tankb.x, tankb.y - 10)
  177. CASE "E"
  178. LINE (tankb.x, tankb.y)-(tankb.x + 10, tankb.y)
  179. CASE "S"
  180. LINE (tankb.x, tankb.y)-(tankb.x, tankb.y + 10)
  181. CASE "W"
  182. LINE (tankb.x, tankb.y)-(tankb.x - 10, tankb.y)
  183. END SELECT
  184.  
  185. FOR count = 1 TO Flicker.Control
  186. NEXT count
  187.  
  188. SELECT CASE tanka.direction$
  189. CASE "N"
  190. tanka.y = tanka.y - 3
  191. CASE "E"
  192. tanka.x = tanka.x + 3
  193. CASE "S"
  194. tanka.y = tanka.y + 3
  195. CASE "W"
  196. tanka.x = tanka.x - 3
  197. END SELECT
  198.  
  199. SELECT CASE tankb.direction$
  200. CASE "N"
  201. tankb.y = tankb.y - 3
  202. CASE "E"
  203. tankb.x = tankb.x + 3
  204. CASE "S"
  205. tankb.y = tankb.y + 3
  206. CASE "W"
  207. tankb.x = tankb.x - 3
  208. END SELECT
  209.  
  210. SELECT CASE tanka.missile.direction$
  211. CASE "N"
  212. tanka.missile.y = tanka.missile.y - 6
  213. CASE "E"
  214. tanka.missile.x = tanka.missile.x + 6
  215. CASE "S"
  216. tanka.missile.y = tanka.missile.y + 6
  217. CASE "W"
  218. tanka.missile.x = tanka.missile.x - 6
  219. END SELECT
  220.  
  221. SELECT CASE tankb.missile.direction$
  222. CASE "N"
  223. tankb.missile.y = tankb.missile.y - 6
  224. CASE "E"
  225. tankb.missile.x = tankb.missile.x + 6
  226. CASE "S"
  227. tankb.missile.y = tankb.missile.y + 6
  228. CASE "W"
  229. tankb.missile.x = tankb.missile.x - 6
  230. END SELECT
  231.  
  232. change$ = INKEY$
  233. SELECT CASE change$
  234. CASE "q"
  235. GOTO quit
  236. CASE "p"
  237. WHILE INKEY$ <> " "
  238. WEND
  239.  
  240. CASE CHR$(0) + "H"
  241. tankb.aim$ = "N"
  242. CASE CHR$(0) + "M"
  243. tankb.aim$ = "E"
  244. CASE CHR$(0) + "P"
  245. tankb.aim$ = "S"
  246. CASE CHR$(0) + "K"
  247. tankb.aim$ = "W"
  248. CASE "8"
  249. tankb.direction$ = "N"
  250. CASE "6"
  251. tankb.direction$ = "E"
  252. CASE "2"
  253. tankb.direction$ = "S"
  254. CASE "4"
  255. tankb.direction$ = "W"
  256. CASE "0"
  257. tankb.missile.direction$ = tankb.aim$
  258. tankb.missile.x = tankb.x
  259. tankb.missile.y = tankb.y
  260. END SELECT
  261.  
  262. IF num.players = 2 THEN
  263. SELECT CASE change$
  264. CASE "e"
  265. tanka.aim$ = "N"
  266. CASE "f"
  267. tanka.aim$ = "E"
  268. CASE "d"
  269. tanka.aim$ = "S"
  270. CASE "s"
  271. tanka.aim$ = "W"
  272. CASE "i"
  273. tanka.direction$ = "N"
  274. CASE "l"
  275. tanka.direction$ = "E"
  276. CASE "k"
  277. tanka.direction$ = "S"
  278. CASE "j"
  279. tanka.direction$ = "W"
  280. CASE " "
  281. tanka.missile.direction$ = tanka.aim$
  282. tanka.missile.x = tanka.x
  283. tanka.missile.y = tanka.y
  284. END SELECT
  285.  
  286. ELSE
  287. IF computer.time >= computer.duration THEN
  288. computer.time = 0
  289. computer.duration = INT(19 * RND) + 1
  290. computer.direction = INT(4 * RND) + 1
  291. SELECT CASE computer.direction
  292. CASE 1
  293. tanka.direction$ = "N"
  294. CASE 2
  295. tanka.direction$ = "E"
  296. CASE 3
  297. tanka.direction$ = "S"
  298. CASE 4
  299. tanka.direction$ = "W"
  300. END SELECT
  301. END IF
  302. computer.time = computer.time + 1
  303.  
  304. SELECT CASE tanka.missile.direction$
  305. CASE "N"
  306. IF (tanka.missile.x < tankb.x + 10) AND (tanka.missile.x > tankb.x - 10) AND (tankb.y - 10 <= tanka.missile.y) THEN
  307. GOTO endselect
  308. ELSE
  309. GOTO newtarget
  310. END IF
  311. CASE "E"
  312. IF (tanka.missile.y < tankb.y + 10) AND (tanka.missile.y > tankb.y - 10) AND (tankb.x + 10 >= tanka.missile.x) THEN
  313. GOTO endselect
  314. ELSE
  315. GOTO newtarget
  316. END IF
  317. CASE "S"
  318. IF (tanka.missile.x < tankb.x + 10) AND (tanka.missile.x > tankb.x - 10) AND (tankb.y + 10 >= tanka.missile.y) THEN
  319. GOTO endselect
  320. ELSE
  321. GOTO newtarget
  322. END IF
  323. CASE "W"
  324. IF (tanka.missile.y < tankb.y + 10) AND (tanka.missile.y > tankb.y - 10) AND (tankb.x - 10 <= tanka.missile.x) THEN
  325. GOTO endselect
  326. ELSE
  327. GOTO newtarget
  328. END IF
  329. END SELECT
  330.  
  331. newtarget:
  332.  
  333. IF (tanka.x < tankb.x + 10) AND (tanka.x > tankb.x - 10) AND (tankb.y - 10 <= tanka.y) THEN
  334. tanka.missile.direction$ = "N"
  335. tanka.missile.x = tanka.x
  336. tanka.missile.y = tanka.y
  337. END IF
  338.  
  339. IF (tanka.y < tankb.y + 10) AND (tanka.y > tankb.y - 10) AND (tankb.x + 10 >= tanka.x) THEN
  340. tanka.missile.direction$ = "E"
  341. tanka.missile.x = tanka.x
  342. tanka.missile.y = tanka.y
  343. END IF
  344.  
  345. IF (tanka.x < tankb.x + 10) AND (tanka.x > tankb.x - 10) AND (tankb.y + 10 >= tanka.y) THEN
  346. tanka.missile.direction$ = "S"
  347. tanka.missile.x = tanka.x
  348. tanka.missile.y = tanka.y
  349. END IF
  350.  
  351. IF (tanka.y < tankb.y + 10) AND (tanka.y > tankb.y - 10) AND (tankb.x - 10 <= tanka.x) THEN
  352. tanka.missile.direction$ = "W"
  353. tanka.missile.x = tanka.x
  354. tanka.missile.y = tanka.y
  355. END IF
  356.  
  357. tanka.aim$ = tanka.missile.direction$
  358.  
  359. endselect:
  360.  
  361. IF s.difficulty$ = "s" THEN
  362. direction.num = INT(2 * RND)
  363. SELECT CASE direction.num
  364. CASE 0
  365. direction.e.w$ = "E"
  366. direction.n.s$ = "N"
  367. CASE 1
  368. direction.e.w$ = "W"
  369. direction.n.s$ = "S"
  370. END SELECT
  371.  
  372. SELECT CASE tanka.direction$
  373. CASE "N"
  374. IF tankb.missile.y < tanka.y AND tankb.missile.direction$ <> "N" AND tankb.missile.direction$ <> "S" THEN
  375. tanka.direction$ = direction.e.w$
  376. END IF
  377. CASE "E"
  378. IF tankb.missile.x > tanka.x AND tankb.missile.direction$ <> "E" AND tankb.missile.direction$ <> "W" THEN
  379. tanka.direction$ = direction.n.s$
  380. END IF
  381. CASE "S"
  382. IF tankb.missile.y > tanka.y AND tankb.missile.direction$ <> "N" AND tankb.missile.direction$ <> "S" THEN
  383. tanka.direction$ = direction.e.w$
  384. END IF
  385. CASE "W"
  386. IF tankb.missile.x < tanka.x AND tankb.missile.direction$ <> "E" AND tankb.missile.direction$ <> "W" THEN
  387. tanka.direction$ = direction.n.s$
  388. END IF
  389. END SELECT
  390. END IF
  391.  
  392. IF s.difficulty$ = "i" THEN
  393. direction.num = INT(2 * RND)
  394. SELECT CASE direction.num
  395. CASE 0
  396. direction.e.w$ = "E"
  397. direction.n.s$ = "N"
  398. CASE 1
  399. direction.e.w$ = "W"
  400. direction.n.s$ = "S"
  401. END SELECT
  402.  
  403. SELECT CASE tanka.direction$
  404. CASE "N"
  405. IF tankb.missile.y > tanka.y - 13 AND tankb.missile.y < tanka.y AND tankb.missile.y > 1 AND tankb.missile.y < 200 AND tankb.missile.direction$ <> "N" AND tankb.missile.direction$ <> "S" THEN
  406. tanka.direction$ = direction.e.w$
  407. END IF
  408. CASE "E"
  409. IF tankb.missile.x < tanka.x + 13 AND tankb.missile.x > tanka.x AND tankb.missile.x > 1 AND tankb.missile.x < 320 AND tankb.missile.direction$ <> "E" AND tankb.missile.direction$ <> "W" THEN
  410. tanka.direction$ = direction.n.s$
  411. END IF
  412. CASE "S"
  413. IF tankb.missile.y < tanka.y + 13 AND tankb.missile.y > tanka.y AND tankb.missile.y > 1 AND tankb.missile.y < 200 AND tankb.missile.direction$ <> "N" AND tankb.missile.direction$ <> "S" THEN
  414. tanka.direction$ = direction.e.w$
  415. END IF
  416. CASE "W"
  417. IF tankb.missile.x > tanka.x - 13 AND tankb.missile.x < tanka.x AND tankb.missile.x > 1 AND tankb.missile.x < 320 AND tankb.missile.direction$ <> "E" AND tankb.missile.direction$ <> "W" THEN
  418. tanka.direction$ = direction.n.s$
  419. END IF
  420. END SELECT
  421. END IF
  422.  
  423.  
  424. 'difficult game - tank changes direction if headed right for a missile headed for him
  425. IF difficulty$ = "d" THEN
  426. direction.num = INT(2 * RND)
  427. SELECT CASE direction.num
  428. CASE 0
  429. direction.e.w$ = "E"
  430. direction.n.s$ = "N"
  431. CASE 1
  432. direction.e.w$ = "W"
  433. direction.n.s$ = "S"
  434. END SELECT
  435.  
  436. SELECT CASE tankb.missile.direction$
  437.  
  438. CASE "N"
  439. IF (tankb.missile.x < tanka.x + 10) AND (tankb.missile.x > tanka.x - 10) AND (tanka.y - 10 <= tankb.missile.y) AND (tanka.direction$ <> "E") AND (tanka.direction$ <> "W") THEN
  440. tanka.direction$ = direction.e.w$
  441. END IF
  442.  
  443. CASE "E"
  444. IF (tankb.missile.y < tanka.y + 10) AND (tankb.missile.y > tanka.y - 10) AND (tanka.x + 10 >= tankb.missile.x) AND (tanka.direction$ <> "N") AND (tanka.direction$ <> "S") THEN
  445. tanka.direction$ = direction.n.s$
  446. END IF
  447.  
  448. CASE "S"
  449. IF (tankb.missile.x < tanka.x + 10) AND (tankb.missile.x > tanka.x - 10) AND (tanka.y + 10 >= tankb.missile.y) AND (tanka.direction$ <> "E") AND (tanka.direction$ <> "W") THEN
  450. tanka.direction$ = direction.e.w$
  451. END IF
  452.  
  453. CASE "W"
  454. IF (tankb.missile.y < tanka.y + 10) AND (tankb.missile.y > tanka.y - 10) AND (tanka.x - 10 <= tankb.missile.x) AND (tanka.direction$ <> "N") AND (tanka.direction$ <> "S") THEN
  455. tanka.direction$ = direction.n.s$
  456. END IF
  457.  
  458. END SELECT
  459.  
  460. END IF
  461.  
  462. END IF
  463.  
  464. IF tanka.x < 1 THEN
  465. tanka.direction$ = "E"
  466. END IF
  467.  
  468. IF tanka.x > 319 THEN
  469. tanka.direction$ = "W"
  470. END IF
  471.  
  472. IF tanka.y < 1 THEN
  473. tanka.direction$ = "S"
  474. END IF
  475.  
  476. IF tanka.y > 199 THEN
  477. tanka.direction$ = "N"
  478. END IF
  479.  
  480. IF tankb.x < 1 THEN
  481. tankb.direction$ = "E"
  482. END IF
  483.  
  484. IF tankb.x > 319 THEN
  485. tankb.direction$ = "W"
  486. END IF
  487.  
  488. IF tankb.y < 1 THEN
  489. tankb.direction$ = "S"
  490. END IF
  491.  
  492. IF tankb.y > 199 THEN
  493. tankb.direction$ = "N"
  494. END IF
  495.  
  496. 'change direction if tanks hit
  497.  
  498. IF (tanka.x + 10 >= tankb.x - 10) AND (tanka.y - 10 <= tankb.y + 10) AND (tanka.y + 10 >= tankb.y - 10) AND (tanka.x + 6 < tankb.x - 6) THEN
  499. tanka.direction$ = "W"
  500. tankb.direction$ = "E"
  501. END IF
  502.  
  503. IF (tankb.x + 10 >= tanka.x - 10) AND (tankb.y - 10 <= tanka.y + 10) AND (tankb.y + 10 >= tanka.y - 10) AND (tankb.x + 6 < tanka.x - 6) THEN
  504. tankb.direction$ = "W"
  505. tanka.direction$ = "E"
  506. END IF
  507.  
  508. IF (tanka.y + 10 >= tankb.y - 10) AND (tanka.x - 10 <= tankb.x + 10) AND (tanka.x + 10 >= tankb.x - 10) AND (tanka.y + 6 < tankb.y - 6) THEN
  509. tanka.direction$ = "N"
  510. tankb.direction$ = "S"
  511. END IF
  512.  
  513. IF (tankb.y + 10 >= tanka.y - 10) AND (tankb.x - 10 <= tanka.x + 10) AND (tankb.x + 10 >= tanka.x - 10) AND (tankb.y + 6 < tanka.y - 6) THEN
  514. tankb.direction$ = "N"
  515. tanka.direction$ = "S"
  516. END IF
  517.  
  518. 'target recognition
  519.  
  520. LOCATE 12, 13
  521.  
  522. IF (tanka.missile.x > tankb.x - 10) AND (tanka.missile.x < tankb.x + 10) AND (tanka.missile.y > tankb.y - 10) AND (tanka.missile.y < tankb.y + 10) THEN
  523. COLOR 9
  524. PRINT tankb.NAME$; " got hit."
  525. tanka.score = tanka.score + 1
  526. GOTO new
  527. END IF
  528.  
  529. IF (tankb.missile.x > tanka.x - 10) AND (tankb.missile.x < tanka.x + 10) AND (tankb.missile.y > tanka.y - 10) AND (tankb.missile.y < tanka.y + 10) THEN
  530. COLOR 15
  531. PRINT tanka.NAME$; " got hit."
  532. tankb.score = tankb.score + 1
  533. GOTO new
  534. END IF
  535.  
  536. GOTO a
  537.  
  538. quit:
  539. finish:
  540. LOCATE 1, 12
  541. IF tanka.score > tankb.score THEN
  542. COLOR 9
  543. PRINT tanka.NAME$; " wins!"
  544. ELSE
  545.   IF tankb.score > tanka.score THEN
  546.   COLOR 15
  547.   PRINT tankb.NAME$; " wins!"
  548.   ELSE
  549.   COLOR 12
  550.   PRINT "Tie"
  551.   END IF
  552. END IF
  553. IF n.y = 0 THEN
  554. GOTO gameover
  555. END IF
  556.  
  557. new:
  558. LOCATE 15, 1
  559. PRINT "Score:"
  560. LOCATE 16, 5
  561. PRINT tanka.NAME$; "-"; tanka.score; "  "; tankb.NAME$; "-"; tankb.score
  562. IF change$ = "q" OR rounds >= rounds.limit THEN
  563. n.y = 0
  564. GOTO finish
  565. END IF
  566. LOCATE 17, 12
  567. PRINT "space to continue"
  568. WHILE INKEY$ <> " "
  569. WEND
  570. GOTO newround
  571.  
  572. gameover:
  573. LOCATE 18, 12
  574. COLOR 12
  575. PRINT "Game Over"
  576. LOCATE 19, 5
  577. PRINT "Do you want to play again? y/n"
  578. again:
  579. y.n$ = INKEY$
  580. SELECT CASE y.n$
  581. CASE "y"
  582. COLOR 15
  583. CLS
  584. GOTO start
  585. CASE "n"
  586. END
  587. END SELECT
  588. GOTO again
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement