extra yield
[mirrors/Programs.git] / turbobasic / 1998 / LINE.BAS
CommitLineData
0f95cc4b
H
1 GOTO POKR\r
2\r
3POKR :\r
4SCREEN 0 : CLS\r
5COLOR 14,1\r
6RESTORE BARVY\r
7BARVY :\r
8\r
9 DATA 8,7,15,15,7,8\r
10FOR 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
20NEXT A\r
21\r
22REM zadani polozek adresare\r
23DO\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
28LOOP\r
29\r
30'-----------------------------------------------------------------------------\r
31TEXT :\r
32print "ahoj"\r
33RETURN\r
34'-----------------------------------------------------------------------------\r
35NASOB :\r
36SCREEN 0\r
37CLS\r
38SOUND RND*1000+20,70\r
39COLOR 4,15\r
40N=0\r
41S=0\r
42V=0\r
43SOUND RND*300+12,13\r
44SOUND RND*10000+12,13\r
45OPET:\r
46N=N+1\r
47CLS\r
48LOCATE 4,23\r
49PRINT "PROGRAM PRO ZKOUSENI MALE NASOBILKY"\r
50A=INT(RND(5)*10+1)\r
51B=INT(RND(4)*10+1)\r
52LOCATE 10,5\r
53PRINT "NAPIS VYSLEDEK" A "x" B "="\r
54INPUT " STISKNI ENTER";C\r
55D=A*B\r
56IF D=C THEN ANO\r
57PRINT " SPATNY VYSLEDEK"\r
58SOUND RND*10000+12,13\r
59S=S+1\r
60GOTO VOLBA\r
61SOUND RND*100+12,13\r
62ANO:\r
63PRINT " SPRAVNE"\r
64V=V+1\r
65VOLBA:\r
66LOCATE 18,10\r
67PRINT "Z" N "POKUSU MAS" S "SPATNYCH A" V "DOBRYCH"\r
68LOCATE 20,10\r
69PRINT "POKUD CHCES POKRACOVAT ZMACKNI ENTER"\r
70LOCATE 21,10\r
71INPUT "POKUD CHCES SKONCIT NAPIS 1 A ZMACKNI 2 x ENTER";E\r
72IF E<>1 THEN OPET\r
73REM pise chybu sound rnd*100+12,13\r
74RETURN\r
75'-----------------------------------------------------------------------------\r
76KONEC :\r
77print "stlac klavesu Enter"\r
78end\r
79'-----------------------------------------------------------------------------\r
80NIC1 :\r
81A$="Zdravi Vas Tomas Mudrunka"\r
82CALL ECHO (5,16,A$,13)\r
83A$="Jak se mate?"\r
84CALL ECHO (7,17,A$,13)\r
85A$="Jak se Vam libi tento program?"\r
86CALL ECHO (7,18,A$,13)\r
87\r
88\r
89CALL ANYKEY\r
90CALL CLWD\r
91RETURN\r
92'-----------------------------------------------------------------------------\r
93NASOB2 :\r
94\r
95SCREEN 0\r
96CLS\r
97rem SOUND RND*1000+20,70\r
98COLOR 4,15\r
99S=0\r
100V=0\r
101rem SOUND RND*300+12,13\r
102rem SOUND RND*10000+12,13\r
103\r
104FOR 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
136NEXT I\r
137\r
138LOCATE 18,10\r
139PRINT "Z" S+V "POKUSU MAS" S "SPATNYCH A" V "DOBRYCH"\r
140\r
141IF S=>4 THEN T=5\r
142IF S=3 THEN T=4\r
143IF S=2 THEN T=3\r
144IF S=1 THEN T=2\r
145IF S=0 THEN T=1\r
146LOCATE 20,10\r
147PRINT "VYSLEDNA ZNAMKA" T\r
148\r
149Input "Ukonci stiskem klavesy ENTER";A\r
150RETURN\r
151'-----------------------------------------------------------------------------\r
152\r
153\r
154END\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
161SUB 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
172END SUB\r
173\r
174'--------------------------------------------------------------------------\r
175\r
176MENU :\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
214RETURN\r
215'-----------------------------------------------------------------------------\r
216SUB 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
221END SUB\r
222'-----------------------------------------------------------------------------\r
223SUB 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
229END SUB\r
230'-----------------------------------------------------------------------------\r
231\r
232\1a
This page took 1.050653 seconds and 4 git commands to generate.