From: Svjatoslav Agejenko Date: Tue, 19 Aug 2025 22:10:36 +0000 (+0300) Subject: Better code readability X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=commitdiff_plain;h=2d99e881dc9336d70ebc349502c64f666d46a64b;p=qbasicapps.git Better code readability --- diff --git a/Games/Pomppu Paavo.bas b/Games/Pomppu Paavo.bas index 16c81d5..64122de 100755 --- a/Games/Pomppu Paavo.bas +++ b/Games/Pomppu Paavo.bas @@ -18,7 +18,7 @@ DEFINT A-Z DIM SHARED graphicsMode DIM SHARED asciiLevelData(1 TO 20) AS STRING * 31 DIM SHARED hedgehogY, hedgehogX, secondHedgehogY, secondHedgehogX -DIM SHARED remainingLives, raha +DIM SHARED remainingLives, coinCount DIM SHARED uks1, uks2, uks3, uks4 DIM SHARED maa DIM SHARED text$(1 TO 1000) @@ -247,7 +247,7 @@ IF asend((a + 37) \ 20, (b + 38) \ 20) = "z" THEN all = -1: r1 = 2: lk = 1: lke qwer = qwer + 1: IF asend1((a + 30) \ 20, (b + 30) \ 20) = "q" AND qwer > 20 THEN qwer = 1: remainingLives = remainingLives - 1: eda = -10: all = -5: displayGameStats IF qwer > 100 THEN qwer = 50 - IF asend((a + 30) \ 20, (b + 30) \ 20) = "1" THEN raha = raha + 1: kustuta1 = 1: displayGameStats: asend((a + 30) \ 20, (b + 30) \ 20) = "" + IF asend((a + 30) \ 20, (b + 30) \ 20) = "1" THEN coinCount = coinCount + 1: kustuta1 = 1: displayGameStats: asend((a + 30) \ 20, (b + 30) \ 20) = "" IF asend((a + 30) \ 20, (b + 30) \ 20) = "v" THEN all = -8: sipp = 3 IF asend1((a + 30) \ 20, (b + 38) \ 20) = ">" THEN eda = 3 IF asend1((a + 30) \ 20, (b + 38) \ 20) = "<" THEN eda = -3 @@ -335,7 +335,7 @@ IF asend((a + 37) \ 20, (b + 38) \ 20) = "z" THEN all = -1: r1 = 2: lk = 1: lke qwer = qwer + 1: IF asend1((a + 30) \ 20, (b + 30) \ 20) = "q" AND qwer > 20 THEN qwer = 1: remainingLives = remainingLives - 1: eda = -5: all = -3: displayGameStats IF qwer > 100 THEN qwer = 50 -IF asend((a + 30) \ 20, (b + 30) \ 20) = "1" THEN raha = raha + 1: kustuta1 = 1: displayGameStats: asend((a + 30) \ 20, (b + 30) \ 20) = "" +IF asend((a + 30) \ 20, (b + 30) \ 20) = "1" THEN coinCount = coinCount + 1: kustuta1 = 1: displayGameStats: asend((a + 30) \ 20, (b + 30) \ 20) = "" IF asend((a + 30) \ 20, (b + 30) \ 20) = "v" THEN all = -8: sipp = 3 IF asend1((a + 30) \ 20, (b + 38) \ 20) = ">" THEN eda = 3 IF asend1((a + 30) \ 20, (b + 38) \ 20) = "<" THEN eda = -3 @@ -396,9 +396,9 @@ SUB displayGameStats LOCATE 1, 1 IF graphicsMode = 2 THEN GOTO 12 PRINT " " -IF raha > 9 THEN raha = 0: remainingLives = remainingLives + 1 +IF coinCount > 9 THEN coinCount = 0: remainingLives = remainingLives + 1 LOCATE 1, 1 -PRINT "o "; raha; " Lives "; remainingLives +PRINT "o "; coinCount; " Lives "; remainingLives 12 IF remainingLives < 0 THEN END END SUB