Improve code readability
authorSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Sun, 23 Feb 2025 12:12:09 +0000 (14:12 +0200)
committerSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Sun, 23 Feb 2025 12:12:09 +0000 (14:12 +0200)
Math/Truth table calculator/truth.bas

index d40db74..9d417f2 100755 (executable)
@@ -26,7 +26,6 @@
 DECLARE SUB removeRedundancies (startIndex!, endIndex!, removalCount!)\r
 DECLARE SUB getOperatorPriority (a!, b!)\r
 DECLARE SUB movM (x1!, n!)\r
-DECLARE SUB lihts (x1, x2, l)\r
 DECLARE SUB clearScreenBuffer ()\r
 DECLARE SUB lendm (x1!, m!)\r
 DECLARE SUB mov (x1!, n!)\r
@@ -176,17 +175,6 @@ m = c - x1 + 1
 17\r
 END SUB\r
 \r
-SUB lihts (x1, x2, l)\r
-    ' Removes redundant parentheses from the logical expression and marks how many were removed\r
-    removeRedundancies x1, x2, l1\r
-    l = l1\r
-    'BEEP\r
-    prnp = prnp + 1\r
-    FOR a = x1 TO x2 - l\r
-        printText a, 0, 13, 1, CHR$(tehe(a))\r
-    NEXT a\r
-END SUB\r
-\r
 SUB mov (x1, n)\r
 ' Moves a portion of the logical expression to the right\r
 FOR a = 79 - n TO x1 STEP -1\r
@@ -227,20 +215,9 @@ FOR a = 0 TO ln
     printText a, 0, 13, 1, CHR$(tehe(a))\r
 NEXT a\r
 \r
-printText 0, 1, 7, 0, "Do you want to simplify it (unfinished so press N)"\r
-a = 0\r
-23\r
-clearScreenBuffer\r
-a$ = INPUT$(1)\r
-IF a$ = "n" OR a$ = "N" THEN GOTO 24\r
-IF a$ = "y" OR a$ = "Y" THEN  ELSE GOTO 23\r
-a = 1\r
-24\r
 printText 0, 1, 7, 0, SPACE$(79)\r
 \r
-l = 0\r
-IF a = 1 THEN lihts 0, ln, l\r
-lahend 0, ln - l\r
+lahend 0, ln\r
 \r
 a$ = INPUT$(1)\r
 \r