From 59cbebfad59c23d97ea3423570494aa7fad7cb61 Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Tue, 15 Oct 2024 22:49:31 +0300 Subject: [PATCH] Refactoring code for better readability --- .../Presentations/{tour.bas => slides.bas} | 135 ++++++------------ 1 file changed, 46 insertions(+), 89 deletions(-) rename Graphics/Presentations/{tour.bas => slides.bas} (79%) diff --git a/Graphics/Presentations/tour.bas b/Graphics/Presentations/slides.bas similarity index 79% rename from Graphics/Presentations/tour.bas rename to Graphics/Presentations/slides.bas index 0b227d1..89e7ec8 100755 --- a/Graphics/Presentations/tour.bas +++ b/Graphics/Presentations/slides.bas @@ -1,3 +1,5 @@ +' Example presentation program. Shows slides and animations. + DECLARE SUB setink (a!) DECLARE SUB inke (a$) DECLARE SUB mkjuku (x!, y!, a!, c!) @@ -40,7 +42,6 @@ DIM SHARED tim$ start - CLS 'GOTO 8 @@ -77,7 +78,6 @@ SUB box1 (x1, y1, x2, y2, c) IF c = 1 THEN za = 51 ELSE za = 102 - FOR zy = y1 + 7 TO y2 + 7 FOR zx = x1 + 7 TO x2 + 7 zc = POINT(zx, zy) @@ -97,7 +97,6 @@ PSET (zx, zy), zc + za NEXT zx NEXT zy - END SUB DEFSNG Z @@ -110,7 +109,7 @@ box xs, ys END SUB SUB ef1 - + pal 3 'LINE (51, 171)-(270, 190), 25, BF @@ -123,7 +122,6 @@ FOR a = 1 TO 320 buf3(a) = 200 NEXT a - b = 0 c1 = 1 setink 10 @@ -159,7 +157,6 @@ END IF buf3(x) = buf3(x + 1) NEXT x - a = 50 FOR x = 65 + 18 TO 270 STEP 40 a = a + 1 @@ -173,7 +170,6 @@ inke a$ SOUND 0, .4 IF a$ = "" THEN GOTO 1 - END SUB SUB ef2 @@ -195,8 +191,6 @@ SOUND 0, .3 NEXT b NEXT a - - FOR a = 20 TO 0 STEP -1 b = (a * 4) / 20 e = 0 @@ -240,7 +234,6 @@ LINE (0, 100 + a)-(319, 100 + a), 1 LINE (0, 100 - a)-(319, 100 - a), 1 NEXT a - PCOPY 0, 1 CLS SOUND 0, .4 @@ -256,15 +249,13 @@ LINE (0, 100 + a)-(319, 100 + a), 25 LINE (0, 100 - a)-(319, 100 - a), 25 NEXT a - resiz pal 3 -pri 11, 8, "-* A U T O R I D *-", 55 -pri 10, 11, CHR$(254) + " Danel Makko", 55 -pri 10, 13, CHR$(254) + " Meelis Altma", 55 -pri 10, 15, CHR$(254) + " Svjatoslav Agejenko", 55 -'pri 10, 17, CHR$(254) + " Kenno Kink", 55 +pri 11, 8, "-* A U T H O R S *-", 55 +pri 10, 11, CHR$(254) + " John Doe", 55 +pri 10, 13, CHR$(254) + " Jane Doe", 55 +pri 10, 15, CHR$(254) + " Anonymous", 55 pri 20, 19, "I-01 a. 2001", 55 inpur @@ -292,25 +283,24 @@ deca xs, ys, 1, 1 CASE 201 'pal4 255, 63, 45, 0 -'prin 10, tey, 2, 255, "Infoallikas:" +'prin 10, tey, 2, 255, "Sources:" tey = tey + 20 CASE 290 pal4 254, 20, 20, 63 -prin 70, tey, 7, 254, "NETI" +prin 70, tey, 7, 254, "TEST" tey = tey + 60 CASE 350 pal4 254, 20, 20, 63 -prin 100, tey, 2, 254, "www.neti.ee" +prin 100, tey, 2, 254, "www.12345.com" tey = tey + 20 CASE 400 pal4 254, 20, 20, 63 -prin 100, tey, 2, 254, CHR$(16) + "„ri\turism" +prin 100, tey, 2, 254, CHR$(16) + "Subject 1" tey = tey + 10 - END SELECT FOR a = 2 TO (xs - 5) / 8 @@ -323,15 +313,12 @@ GET (x, 183 - ys + 14)-(x + 7, 183), buf4(1) PUT (x, 183 - ys + 6), buf4(1), PSET NEXT x - inke a$ IF a$ <> "" THEN GOTO 3 wpr GOTO 4 - - 3 END SUB @@ -354,7 +341,6 @@ LINE (0, 200 - a)-(319, 200 - a), 0 SOUND 0, .4 NEXT a - END SUB SUB inke (a$) @@ -406,7 +392,6 @@ c7 = (c3 + c4) / 2 + RND * s - sp IF c7 > lm2 THEN c7 = lm2 IF c7 < lm1 THEN c7 = lm1 - IF INT(RND * 30) = 2 THEN c5 = 50 PSET (x + sp, y + sp), c5 PSET (x + s, y + sp), c6 @@ -431,7 +416,6 @@ NEXT x NEXT y NEXT a - END SUB SUB mkjuku (x, y, a, c) @@ -448,11 +432,9 @@ y2 = y + SIN(b) * 3 + 10 x3 = x + COS(b + 1) * 2 y3 = y + SIN(b + 1) * 2 + 2 - LINE (x2, y2)-(x1, y1), c LINE (x2, y2)-(x3, y3), c - x1 = x + COS(b + pii) * 10 y1 = y + SIN(b + pii) * 5 + 20 @@ -499,6 +481,7 @@ END SUB SUB pal (x) SELECT CASE x CASE 1 + FOR f = 0 TO 25 OUT &H3C8, f OUT &H3C9, f * 4.1 @@ -572,7 +555,7 @@ OUT &H3C9, ((50 - f) * 1.5 + b * 1) / 2 NEXT f END SUB -SUB pal4 (c, r, g, b) +SUB pal4 (c, r!, g!, b!) OUT &H3C8, c OUT &H3C9, r OUT &H3C9, g @@ -596,7 +579,6 @@ PRINT b$ SOUND 0, 1 NEXT a - END SUB SUB prin (x1, y1, s, c1, a$) @@ -618,7 +600,6 @@ END SUB SUB resiz - FOR a = 1 TO 10 CIRCLE (160, 100), a, a * 2 + 5 NEXT a @@ -655,7 +636,7 @@ SUB sc1 pal 2 LOCATE 1, 1 COLOR 1 -PRINT "TURISM" +PRINT "HEADER" FOR x = 0 TO 80 FOR y = 0 TO 16 @@ -668,7 +649,6 @@ NEXT x LOCATE 1, 1 PRINT " " - FOR y = 30 TO 80 FOR x = 0 TO 319 c = POINT(x, y) @@ -701,11 +681,6 @@ PSET (x, y), c1 NEXT y NEXT x - - - - - END SUB SUB sc2 @@ -719,13 +694,12 @@ pal3 0, 0, 0 box1 30, 30, 290, 170, 1 -prin 65, 50, 3, 0, "Eesm„rk:" - -prin 40, 100, 1, 0, CHR$(254) + " Uurida, interneti kaudu tu-" -prin 40, 108, 1, 0, " rismifirmade poolt pakutavaid" -prin 40, 116, 1, 0, " teenuseid." -prin 40, 130, 1, 0, CHR$(254) + " Saada hinne." +prin 65, 50, 3, 0, "Goal:" +prin 40, 100, 1, 0, CHR$(254) + " Random text" +prin 40, 108, 1, 0, " goes here to test" +prin 40, 116, 1, 0, " text layout." +prin 40, 130, 1, 0, CHR$(254) + " Testing 123." inpur @@ -737,9 +711,9 @@ mkback pal2 64, 64, 0 box1 30, 30, 290, 150, 1 -prin 57, 50, 3, 0, " T„nan" -prin 45, 74, 3, 0, "t„helepanu" -prin 45, 98, 3, 0, " eest" +prin 57, 50, 3, 0, "Thank you" +prin 45, 74, 3, 0, " for" +prin 45, 98, 3, 0, "attention" inpur END SUB @@ -749,36 +723,29 @@ SUB sc4 pal 4 mkback - - pal2 0, 0, 32 box1 3, 3, 260, 50, 1 pal4 255, 50, 50, 0 -prin 10, 10, 2, 255, "Eesti Reisiinfo" -prin 50, 30, 1, 255, "www.reisiinfo.ee" +prin 10, 10, 2, 255, "Random header" +prin 50, 30, 1, 255, "www.randomsite.org" pal3 10, 20, 0 box1 20, 40, 290, 180, 2 pal4 254, 63, 45, 0 - b = 25 -prin 40, 60, 1, 254, CHR$(254) + " Eestisisesed reisid" +prin 40, 60, 1, 254, CHR$(254) + " Lorem ipsum dolor sit amet," a = b -prin 40, 60 + a, 1, 254, CHR$(254) + " Reisiv“imaluste tutvustus" +prin 40, 60 + a, 1, 254, CHR$(254) + " consectetur adipiscing elit," a = a + b -prin 40, 60 + a, 1, 254, CHR$(254) + " Otsingumootor" +prin 40, 60 + a, 1, 254, CHR$(254) + " sed do eiusmod" a = a + b -prin 40, 60 + a, 1, 254, CHR$(254) + " Valida sobiv tegevus" - +prin 40, 60 + a, 1, 254, CHR$(254) + " tempor incididunt ut labore" inpur - - - END SUB SUB sc5 @@ -789,26 +756,24 @@ pal2 0, 0, 32 box1 3, 3, 300, 50, 1 pal4 255, 50, 50, 0 -prin 10, 10, 2, 255, "Wristours" -prin 50, 30, 1, 255, "www.wristours.ee" +prin 10, 10, 2, 255, "Totam rem aperiam" +prin 50, 30, 1, 255, "www.moditempora.org" pal3 20, 32, 63 box1 20, 40, 290, 180, 2 pal4 254, 63, 45, 0 b = 25 -prin 40, 60, 1, 254, CHR$(254) + " Reisid le maailma" +prin 40, 60, 1, 254, CHR$(254) + " Nemo enim ipsam voluptatem" a = b -prin 40, 60 + a, 1, 254, CHR$(254) + " Väimalus tellida" +prin 40, 60 + a, 1, 254, CHR$(254) + " Sed quia consequuntur" a = a + b -prin 40, 60 + a, 1, 254, CHR$(254) + " Info viisade kohta" +prin 40, 60 + a, 1, 254, CHR$(254) + " Magni dolores eos" a = a + b -prin 40, 60 + a, 1, 254, CHR$(254) + " V“imalus liisinguks" +prin 40, 60 + a, 1, 254, CHR$(254) + " Qui ratione voluptatem" inpur - - END SUB SUB sc6 @@ -827,19 +792,16 @@ box1 20, 40, 290, 180, 2 pal4 254, 63, 45, 0 b = 25 -prin 40, 60, 1, 254, CHR$(254) + " Aktiivne puhkus" +prin 40, 60, 1, 254, CHR$(254) + " Quis autem vel eum" a = b -prin 40, 60 + a, 1, 254, CHR$(254) + " Reisipaiga valik" +prin 40, 60 + a, 1, 254, CHR$(254) + " Iure reprehenderit qui" a = a + b -prin 40, 60 + a, 1, 254, CHR$(254) + " V“imalused registreerida" +prin 40, 60 + a, 1, 254, CHR$(254) + " In ea voluptate velit" a = a + b -prin 40, 60 + a, 1, 254, CHR$(254) + " Tellimusreisid" +prin 40, 60 + a, 1, 254, CHR$(254) + " Esse quam nihil molestiae" inpur - - - END SUB SUB sc7 @@ -850,30 +812,27 @@ pal2 0, 0, 32 box1 3, 3, 300, 50, 1 pal4 255, 50, 50, 0 -prin 10, 10, 2, 255, "Last Minute" -prin 50, 30, 1, 255, "www.lastminute.ee" +prin 10, 10, 2, 255, "Et dolore magna" +prin 50, 30, 1, 255, "www.utenimadminim.org" pal3 20, 32, 63 box1 20, 40, 290, 180, 2 pal4 254, 63, 45, 0 b = 25 -prin 40, 60, 1, 254, CHR$(254) + " Reisid" +prin 40, 60, 1, 254, CHR$(254) + " Ut enim ad minim veniam" a = b -prin 40, 60 + a, 1, 254, CHR$(254) + " Valida sihtkoht" +prin 40, 60 + a, 1, 254, CHR$(254) + " Quis nostrud exercitation" a = a + b -prin 40, 60 + a, 1, 254, CHR$(254) + " V“imalused tellida reis" +prin 40, 60 + a, 1, 254, CHR$(254) + " Laboris nisi ut aliquip ex" a = a + b -prin 40, 60 + a, 1, 254, CHR$(254) + " V“imalus reisikindlustuseks" +prin 40, 60 + a, 1, 254, CHR$(254) + " Sed ut perspiciatis unde" inpur - - - END SUB -SUB setink (a) +SUB setink (a!) ink = a tim$ = TIME$ END SUB @@ -886,7 +845,6 @@ mkfont tim = 0 tim2 = 0 - FOR a = 1 TO 500 jas(a) = RND * 10 NEXT a @@ -909,8 +867,7 @@ SELECT CASE tim2 CASE 0 IF a = 10 THEN tim2 = 1: tim = 0: pal4 255, 63, 45, 0 CASE 1 -pr 10, 10, 2, 255, a, "Infoallikas:" - +pr 10, 10, 2, 255, a, "Sources:" END SELECT END IF -- 2.20.1