| 1 | GOTO POKR\r |
| 2 | \r |
| 3 | POKR :\r |
| 4 | SCREEN 0 : CLS\r |
| 5 | COLOR 14,1\r |
| 6 | RESTORE BARVY\r |
| 7 | BARVY :\r |
| 8 | \r |
| 9 | DATA 8,7,15,15,7,8\r |
| 10 | FOR A=1 TO 6\r |
| 11 | READ C\r |
| 12 | LINE (A,A)-(640-A,A),C\r |
| 13 | LINE (A,106-A)-(640-A,106-A),C\r |
| 14 | LINE (A,A)-(A,106-A),C\r |
| 15 | LINE (640-A,A)-(640-A,106-A),C\r |
| 16 | LINE (A,110+A)-(640-A,110+A),C\r |
| 17 | LINE (A,200-A)-(640-A,200-A),C\r |
| 18 | LINE (A,110+A)-(A,200-A),C\r |
| 19 | LINE (640-A,110+A)-(640-A,200-A),C\r |
| 20 | NEXT A\r |
| 21 | \r |
| 22 | REM zadani polozek adresare\r |
| 23 | DO\r |
| 24 | A$="NASOB AHOJ POZDR NASO2 KONEC "\r |
| 25 | D=5:X=5:Y=17:C=14\r |
| 26 | GOSUB MENU\r |
| 27 | ON MENU GOSUB NASOB,TEXT,NIC1,NASOB2,KONEC\r |
| 28 | LOOP\r |
| 29 | \r |
| 30 | '-----------------------------------------------------------------------------\r |
| 31 | TEXT :\r |
| 32 | print "ahoj"\r |
| 33 | RETURN\r |
| 34 | '-----------------------------------------------------------------------------\r |
| 35 | NASOB :\r |
| 36 | SCREEN 0\r |
| 37 | CLS\r |
| 38 | SOUND RND*1000+20,70\r |
| 39 | COLOR 4,15\r |
| 40 | N=0\r |
| 41 | S=0\r |
| 42 | V=0\r |
| 43 | SOUND RND*300+12,13\r |
| 44 | SOUND RND*10000+12,13\r |
| 45 | OPET:\r |
| 46 | N=N+1\r |
| 47 | CLS\r |
| 48 | LOCATE 4,23\r |
| 49 | PRINT "PROGRAM PRO ZKOUSENI MALE NASOBILKY"\r |
| 50 | A=INT(RND(5)*10+1)\r |
| 51 | B=INT(RND(4)*10+1)\r |
| 52 | LOCATE 10,5\r |
| 53 | PRINT "NAPIS VYSLEDEK" A "x" B "="\r |
| 54 | INPUT " STISKNI ENTER";C\r |
| 55 | D=A*B\r |
| 56 | IF D=C THEN ANO\r |
| 57 | PRINT " SPATNY VYSLEDEK"\r |
| 58 | SOUND RND*10000+12,13\r |
| 59 | S=S+1\r |
| 60 | GOTO VOLBA\r |
| 61 | SOUND RND*100+12,13\r |
| 62 | ANO:\r |
| 63 | PRINT " SPRAVNE"\r |
| 64 | V=V+1\r |
| 65 | VOLBA:\r |
| 66 | LOCATE 18,10\r |
| 67 | PRINT "Z" N "POKUSU MAS" S "SPATNYCH A" V "DOBRYCH"\r |
| 68 | LOCATE 20,10\r |
| 69 | PRINT "POKUD CHCES POKRACOVAT ZMACKNI ENTER"\r |
| 70 | LOCATE 21,10\r |
| 71 | INPUT "POKUD CHCES SKONCIT NAPIS 1 A ZMACKNI 2 x ENTER";E\r |
| 72 | IF E<>1 THEN OPET\r |
| 73 | REM pise chybu sound rnd*100+12,13\r |
| 74 | RETURN\r |
| 75 | '-----------------------------------------------------------------------------\r |
| 76 | KONEC :\r |
| 77 | print "stlac klavesu Enter"\r |
| 78 | end\r |
| 79 | '-----------------------------------------------------------------------------\r |
| 80 | NIC1 :\r |
| 81 | A$="Zdravi Vas Tomas Mudrunka"\r |
| 82 | CALL ECHO (5,16,A$,13)\r |
| 83 | A$="Jak se mate?"\r |
| 84 | CALL ECHO (7,17,A$,13)\r |
| 85 | A$="Jak se Vam libi tento program?"\r |
| 86 | CALL ECHO (7,18,A$,13)\r |
| 87 | \r |
| 88 | \r |
| 89 | CALL ANYKEY\r |
| 90 | CALL CLWD\r |
| 91 | RETURN\r |
| 92 | '-----------------------------------------------------------------------------\r |
| 93 | NASOB2 :\r |
| 94 | \r |
| 95 | SCREEN 0\r |
| 96 | CLS\r |
| 97 | rem SOUND RND*1000+20,70\r |
| 98 | COLOR 4,15\r |
| 99 | S=0\r |
| 100 | V=0\r |
| 101 | rem SOUND RND*300+12,13\r |
| 102 | rem SOUND RND*10000+12,13\r |
| 103 | \r |
| 104 | FOR I=1 TO 10\r |
| 105 | rem nechat pokud nebude vadit CLS\r |
| 106 | LOCATE 4,20\r |
| 107 | PRINT "PROGRAM PRO ZKOUSENI MALE NASOBILKY - 10 PRIKLADU"\r |
| 108 | \r |
| 109 | A=INT(RND(5)*10+1)\r |
| 110 | B=INT(RND(4)*10+1)\r |
| 111 | LOCATE 10,5\r |
| 112 | REM vymaze radek\r |
| 113 | PRINT " "\r |
| 114 | PRINT " "\r |
| 115 | LOCATE 10,5\r |
| 116 | PRINT "NAPIS VYSLEDEK" A "x" B "="\r |
| 117 | INPUT " STISKNI ENTER";C\r |
| 118 | D=A*B\r |
| 119 | \r |
| 120 | IF D=C THEN ANO2\r |
| 121 | PRINT " SPATNY VYSLEDEK"\r |
| 122 | rem SOUND RND*10000+12,13\r |
| 123 | S=S+1\r |
| 124 | GOTO VOLBA2\r |
| 125 | rem SOUND RND*100+12,13\r |
| 126 | ANO2:\r |
| 127 | PRINT " SPRAVNE"\r |
| 128 | V=V+1\r |
| 129 | VOLBA2:\r |
| 130 | LOCATE 18,10\r |
| 131 | PRINT "Z" I "POKUSU MAS" S "SPATNYCH A" V "DOBRYCH"\r |
| 132 | REM zdrzeni programu\r |
| 133 | FOR G=1 TO 10\r |
| 134 | rem SOUND RND*1000+12,13\r |
| 135 | NEXT G\r |
| 136 | NEXT I\r |
| 137 | \r |
| 138 | LOCATE 18,10\r |
| 139 | PRINT "Z" S+V "POKUSU MAS" S "SPATNYCH A" V "DOBRYCH"\r |
| 140 | \r |
| 141 | IF S=>4 THEN T=5\r |
| 142 | IF S=3 THEN T=4\r |
| 143 | IF S=2 THEN T=3\r |
| 144 | IF S=1 THEN T=2\r |
| 145 | IF S=0 THEN T=1\r |
| 146 | LOCATE 20,10\r |
| 147 | PRINT "VYSLEDNA ZNAMKA" T\r |
| 148 | \r |
| 149 | Input "Ukonci stiskem klavesy ENTER";A\r |
| 150 | RETURN\r |
| 151 | '-----------------------------------------------------------------------------\r |
| 152 | \r |
| 153 | \r |
| 154 | END\r |
| 155 | '-----------------------------------------------------------------------------\r |
| 156 | ' podprogram ECHO\r |
| 157 | ' postupny tisk textu obsazeneho v retezcove promenne A$\r |
| 158 | ' na souradnice X a Y\r |
| 159 | ' barvou C\r |
| 160 | \r |
| 161 | SUB ECHO(X,Y,A$,C)\r |
| 162 | COLOR C\r |
| 163 | LOCATE Y,X\r |
| 164 | FOR A=1 TO LEN(A$)\r |
| 165 | PRINT MID$ (A$,A,1);\r |
| 166 | SOUND 1200,.2\r |
| 167 | SOUND 900,.2\r |
| 168 | SOUND 600,.2\r |
| 169 | FOR I=1 TO 200\r |
| 170 | NEXT I\r |
| 171 | NEXT A\r |
| 172 | END SUB\r |
| 173 | \r |
| 174 | '--------------------------------------------------------------------------\r |
| 175 | \r |
| 176 | MENU :\r |
| 177 | ' PODPROGRAM 'MENU'\r |
| 178 | \r |
| 179 | ' X a Y jsou textove souradnice menu-okna\r |
| 180 | ' A$ obsahuje text okna\r |
| 181 | ' D je pocet polozek (radku) v menu\r |
| 182 | ' W=1 - pouze vypis okna , W=0 - vypis i vyber z menu\r |
| 183 | ' C je barva okna\r |
| 184 | ' v promenne MENU podprogram vraci cislo zvolene polozky\r |
| 185 | \r |
| 186 | L=LEN (A$)/D : MENU = 1 : M = MENU+.0001\r |
| 187 | COLOR C,9:LOCATE Y,X\r |
| 188 | PRINT CHR$(201);\r |
| 189 | FOR A=1 TO L+2 : PRINT CHR$(205); : NEXT A\r |
| 190 | PRINT CHR$ (187);\r |
| 191 | FOR A= 1 TO LEN(A$) STEP L\r |
| 192 | LOCATE Y+A/L+1,X\r |
| 193 | PRINT CHR$(186);" ";MID$(A$,A,L);" ";CHR$(186);\r |
| 194 | NEXT A\r |
| 195 | LOCATE Y+A/L+1,X: PRINT CHR$(200);\r |
| 196 | FOR A=1 TO L+2 : PRINT CHR$(205); : NEXT A\r |
| 197 | PRINT CHR$(188);\r |
| 198 | IF W=1 THEN W=0 : RETURN\r |
| 199 | \r |
| 200 | DO\r |
| 201 | I$ = INKEY$\r |
| 202 | IF LEN(I$)=2 THEN IF ASC(MID$(I$,2,1))=72 THEN MENU = MENU - 1\r |
| 203 | IF LEN(I$)=2 THEN IF ASC(MID$(I$,2,1))=80 THEN MENU = MENU + 1\r |
| 204 | IF MENU < 1 THEN MENU = D\r |
| 205 | IF LEN(I$)=1 THEN IF ASC(I$)=13 THEN EXIT LOOP\r |
| 206 | IF MENU > D THEN MENU = 0 : EXIT LOOP \r |
| 207 | IF MENU <> M THEN LOCATE Y+M,X+L+2 : PRINT " ";:LOCATE Y+M,X+1 : PRINT " ";\r |
| 208 | IF MENU <> M THEN LOCATE Y+MENU,X+L+2:COLOR 11:PRINT CHR$(174);:LOCATE Y+MENU,X+1:PRINT CHR$(175);:COLOR C\r |
| 209 | M = MENU\r |
| 210 | LOOP\r |
| 211 | I=MENU\r |
| 212 | W=1:C=0:GOSUB MENU\r |
| 213 | MENU = I : COLOR 15\r |
| 214 | RETURN\r |
| 215 | '-----------------------------------------------------------------------------\r |
| 216 | SUB CLWD\r |
| 217 | 'Clear window\r |
| 218 | FOR A=120 TO 190\r |
| 219 | LINE (8,A)-(632,A),0\r |
| 220 | NEXT A\r |
| 221 | END SUB\r |
| 222 | '-----------------------------------------------------------------------------\r |
| 223 | SUB ANYKEY\r |
| 224 | DO\r |
| 225 | IF INKEY$<>"" THEN EXIT LOOP\r |
| 226 | C=C+1:IF C>15 THEN C=1\r |
| 227 | COLOR C : LOCATE 24,55:PRINT "STLAC LIBOVOLNOU KLAVESU";\r |
| 228 | LOOP\r |
| 229 | END SUB\r |
| 230 | '-----------------------------------------------------------------------------\r |
| 231 | \r |
| 232 | \1a |