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