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