Added script to find files not owned by pacman package manager (ArchLinux)
[mirrors/Programs.git] / turbobasic / 1998 / PROGRAM2.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 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
30LOOP\r
31\r
32'-----------------------------------------------------------------------------\r
33TEXT :\r
34SOUND RND*10000+12,13\r
35SOUND RND*100+99,80\r
36print "ahoj"\r
37RETURN\r
38'-----------------------------------------------------------------------------\r
39NASOB :\r
40SCREEN 0\r
41CLS\r
42SOUND RND*1000+20,70\r
43COLOR 14,1\r
44N=0\r
45S=0\r
46V=0\r
47SOUND RND*300+12,13\r
48SOUND RND*10000+12,13\r
49OPET:\r
50N=N+1\r
51CLS\r
52LOCATE 4,23\r
53PRINT "PROGRAM PRO ZKOUSENI MALE NASOBILKY"\r
54A=INT(RND(5)*10+1)\r
55B=INT(RND(4)*10+1)\r
56LOCATE 10,5\r
57PRINT "NAPIS VYSLEDEK" A "x" B "="\r
58INPUT " STISKNI ENTER";C\r
59D=A*B\r
60IF D=C THEN ANO\r
61SOUND RND*10000+90,90\r
62PRINT " SPATNY VYSLEDEK"\r
63SOUND RND*10000+12,13\r
64S=S+1\r
65GOTO VOLBA\r
66SOUND RND*100+12,13\r
67ANO:\r
68SOUND RND*100+90,90\r
69PRINT " SPRAVNE"\r
70V=V+1\r
71VOLBA:\r
72LOCATE 18,10\r
73SOUND RND* 10000+55,55\r
74SOUND RND* 100+55,55\r
75PRINT "Z" N "POKUSU MAS" S "SPATNYCH A" V "DOBRYCH"\r
76LOCATE 20,10\r
77PRINT "POKUD CHCES POKRACOVAT ZMACKNI ENTER"\r
78LOCATE 21,10\r
79INPUT "POKUD CHCES SKONCIT NAPIS 1 A ZMACKNI 2 x ENTER";E\r
80IF E<>1 THEN OPET\r
81REM pise chybu sound rnd*100+12,13\r
82RETURN\r
83'-----------------------------------------------------------------------------\r
84KONEC :\r
85SOUND RND*100+55,100\r
86print "stlac klavesu Enter"\r
87end\r
88'-----------------------------------------------------------------------------\r
89NIC1 :\r
90SOUND RND*100+55,55\r
91A$="Zdravi Vas Tomas Mudrunka"\r
92CALL ECHO (5,16,A$,13)\r
93A$="Jak se mate?"\r
94CALL ECHO (7,17,A$,13)\r
95A$="Jak se Vam libi tento program?"\r
96CALL ECHO (7,18,A$,13)\r
97stop\r
98\r
99CALL ANYKEY\r
100CALL CLWD\r
101RETURN\r
102'-----------------------------------------------------------------------------\r
103NASOB2 :\r
104\r
105SCREEN 0\r
106CLS\r
107rem SOUND RND*1000+20,70\r
108COLOR 4,15\r
109S=0\r
110V=0\r
111rem SOUND RND*300+12,13\r
112rem SOUND RND*10000+12,13\r
113\r
114FOR 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
148NEXT I\r
149\r
150LOCATE 18,10\r
151PRINT "Z" S+V "POKUSU MAS" S "SPATNYCH A" V "DOBRYCH"\r
152\r
153IF S=>4 THEN T=5\r
154IF S=3 THEN T=4\r
155IF S=2 THEN T=3\r
156IF S=1 THEN T=2\r
157IF S=0 THEN T=1\r
158LOCATE 20,10\r
159PRINT "VYSLEDNA ZNAMKA" T\r
160\r
161Input "Ukonci stiskem klavesy ENTER";A\r
162RETURN\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
169SUB 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
180END SUB\r
181\r
182'--------------------------------------------------------------------------\r
183\r
184MENU :\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
222RETURN\r
223'-----------------------------------------------------------------------------\r
224SUB 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
229END SUB\r
230'-----------------------------------------------------------------------------\r
231SUB 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
237END SUB\r
238'-----------------------------------------------------------------------------\r
239\r
240\1a
This page took 0.726257 seconds and 4 git commands to generate.