. , , ,

,,,

,

.

I. .

. - . .

II. .

. . .

.

.

. , .

-, . - - , , , , , , , .

-, .

- ( - , ) . , .

. , . , .

, - . , , , , .

, , , (, ) .

:

1. - , .

2. .

" ". .

. .., .., .., .., .., .., ..

.., B.C., . ., .., .., .., O.K., .. .

.., .., .., .., O.K. .

, , , .. (), .. (), . (), .. ( ).

: (1990), ( III ) (1993--1994.) .

, .

, P.Norton, Bork A., Williams R., Rich ., Maclean ., . , .

- ( ) . , , PC Magasin, Scientific American, Fortune, Byte, High Technology, Popular Computing, Science, Personal Computing, Psychology Today, Infoworld, , , ʔ, -, , , , .

. , .

, , , , , , , , , ,

1 .

2 , , .

, . .

I. . § 1. .

- . , . . , , , , , , . , . .

, . , , , . . , . , , , , .

, , . , , "" , , - , . , , , . - . .

. . , , . , . , , . , , -.

- - - . , . . , , , . . . - .

. , , , . , , . . . - - , , , . .

, , . . , .

- , , . .

, , , - , , :

; ; , ; .

, ( ). ( ) ().

, , . :

- ;

- , , , ;

- , , , ;

- ;

- , , ;

- ;

- .

, - -. , , . , , - . , , . . - .

, . , , . , , , . , , , .. , , - , , , , , . , . , , , . , . . . , . , , , .

, , . : ) ; ) ; ) " " ( , ); ) .

. , . , , , , , .

- . , . . .

, . .

1. . , , .

2. . () , , .

3. . , . - .

. . , ( , , ..). - , . . , , , .

, , , . . , . , , , , . , ߔ.

. , . , . , - . , , . , . .

. . - . , - .

, , - , . , . .

§ 2. - .

. . : . , . . , , , , , , . , , ( , ). , . ( , , , ). , , , , , - . , , , . , , , .

. , , . .

, . ( , , , ). , ( ), . , , . , . , - , - ,

, , . , , .

, , . : . , , .

, , , , , . - , () . , , , , . , (, ). , , , , . : , , . , , .

, ( ). , , , , , .

, .

1. . , .

2. . , - , . , , . , , (, , , .), .

3. . , , .

4. .

5. .

6. . , (, ).

, 1-3 , 4-6 , . 1, 2, 5 4 - " " - , , , .

, , , , , .. , , , .

, . , , , , , ( , ) ( ). , , - .

§ 3. .

- : , , , .

. , - . . , , , , . - .

, () . .

.

, , .

. , . . , , . , , , - - - . , , . , .

, , , . , , .

- , , , , , , , , , . , . , , .

, , , - ( ) ( ).

: .

() . , . , , , , , (, , ) .. , , , , , ( ) (). , , , , .

II. . § 1. .

. ( , ), , , . 10-11 , , 5 6 , , .

. :

.

ñ ò , <ENTER>.

1 ( ) ( ). § 2. II.

2 ( ) , . - <Esc>.

3 ().

, <F3>. , , EXE, COM, BAT, QBASIC BAS.

.

§ 2.

, . . , .

.

, , . , - , , , .

, :

- , , ;

, .

. , .

(), , - .

, , . , .

, , .

:

- , : < = > < = > ;

- ;

- , , , ;

- ;

- ;

- .

( ). . , , , .

. .

:

. , . . . , . . . , . .

10 .

.

. . 10 , . , , 1 , 2 - , 3 - , 4 - .

( ). -. , <>, . . , . .

. .

<Esc>.

, , . . , .

<F1> .

Qbasic. IBM PC 386 . .

§ 3.

1

- modul.bas

REM

CLS

FILEHLP$ = "GLMENU.HLP"

menuha:

'

baz$ = "menu.dat"

dlin = 30

m = 1

GOSUB menu

IF rez1$ = " " THEN GOTO rmp

IF cur = 2 THEN GOSUB reklama

IF rez1$ = "" THEN CLS : SYSTEM

GOTO menuha

rmp:

REM

baz$ = "prog.dat"

baz$ = parh$ + baz$

dlin = 30

GOSUB menu

finalshow:

OPEN "bat.bat" FOR OUTPUT AS #1

FOR i = 1 TO LEN(rez2$)

IF MID$(rez2$, i, 1) = "." THEN rash$ = MID$(rez2$, i + 1, 3)

NEXT i

PRINT #1, "@echo off "

IF rash$ = "bas" THEN PRINT #1, "@qbasic.exe /run "; rez2$

IF rash$ = "com" OR rash$ = "exe" OR rash$ = "bat" THEN PRINT #1, rez2$

PRINT #1, "@del bat.bat"

CLOSE #1

CLS

SYSTEM

reklama:

OPEN FILEHLP$ FOR INPUT AS #1

S = 0

DO

ON ERROR GOTO 0

LINE INPUT #1, stran$

S = S + 1

LOOP UNTIL EOF(1)

CLOSE #1

IF FIX(S / 18) >= (S / 18) THEN KS = FIX(S / 18) ELSE KS = FIX(S / 18) + 1

DIM stran$(S)

OPEN FILEHLP$ FOR INPUT AS #1

FOR i = 1 TO S

ON ERROR GOTO 0

LINE INPUT #1, stran$(i)

NEXT i

CLOSE #1

NS = 1

GOSUB stran

obrabotka:

A$ = INKEY$

IF A$ = CHR$(0) + CHR$(73) THEN NS = NS - 1: GOSUB stran

IF A$ = CHR$(0) + CHR$(81) THEN NS = NS + 1: GOSUB stran

IF A$ = CHR$(27) THEN ERASE stran$: RETURN

GOTO obrabotka

stran:

IF NS < 1 THEN NS = 1: RETURN

IF NS > KS THEN NS = KS: RETURN

n = 18 * NS

'SLC:

LOCATE 1, 1

PRINT ""; STRING$(64, "="); "T============="

PRINT ""; STRING$(15, " "); : COLOR 15, 0: PRINT " - "; : COLOR 7, 0: PRINT STRING$(15, " ");

IF NS < 10 THEN PRINT " "; NS; "" ELSE PRINT " "; NS; ""

PRINT ""; STRING$(64, " "); "L============="

FOR i = n - 17 TO n

IF i > S THEN PRINT ""; STRING$(78, " "); "" ELSE PRINT " "; stran$(i); STRING$((76 - LEN(stran$(i))), " "); ""

NEXT i

PRINT "L"; STRING$(78, "="); "-"

COLOR 1, 7: PRINT " - Esc ";

IF NS = 1 THEN COLOR 8, 7 ELSE COLOR 1, 7

PRINT " - PageUp ";

IF NS = KS THEN COLOR 8, 7 ELSE COLOR 1, 7

PRINT " - PageDown "

COLOR 7, 0

RETURN

menu:

COLOR 7, 0

CLS

OPEN baz$ FOR INPUT AS #2

DIM mas$(150, 2)

INPUT #2, R$

i = 0

DO

i = i + 1

INPUT #2, mas$(i, 1)

INPUT #2, mas$(i, 2)

LOOP UNTIL EOF(2)

CLOSE #2

m = i

IF m > 10 THEN m = 10

R = INT((25 - m) / 2)

nashalo:

u = 1: cur = 1: cur1 = 1

uold = LEN(R$): uold = dlin - uold: uuold = INT(uold / 2): uuuold = uold - uuold

R1$ = STRING$(uuuold, "=") + R$ + STRING$(uuold, "=") '

tablisha:

LOCATE R, 1

PRINT STRING$(21, " "); ""; R1$; ""

PRINT STRING$(21, " "); ""; STRING$(dlin, " "); ""

schet = 0

FOR t = u TO u + m - 1

schet = schet + 1

COLOR 7, 0: PRINT STRING$(21, " "); "";

IF cur1 = schet THEN COLOR 0, 7

'

uold = LEN(mas$(t, 1)): uold = dlin - uold: uuold = INT(uold / 2): uuuold = uold - uuold

t$ = STRING$(uuuold, " ") + mas$(t, 1) + STRING$(uuold, " ")

PRINT t$;

COLOR 7, 0: PRINT ""

NEXT t

PRINT STRING$(21, " "); "L"; STRING$(dlin, "="); "-"

GOSUB smotr

chetire:

kbd$ = INKEY$

flag = 0

SELECT CASE kbd$

CASE CHR$(0) + "H": cur = cur - 1: cur1 = cur1 - 1: flag = 1

CASE CHR$(0) + "P": cur = cur + 1: cur1 = cur1 + 1: flag = 1

CASE CHR$(0) + CHR$(61): GOTO dopoln

CASE CHR$(13): GOTO final

CASE CHR$(27): CLS : SYSTEM

END SELECT

IF flag = 0 THEN GOTO chetire

IF cur = 0 THEN u = i - m + 1: cur = i: cur1 = m: GOTO tablisha

IF cur = i + 1 THEN GOTO nashalo

IF cur1 = 0 THEN u = u - 1: cur1 = 1

IF cur1 = m + 1 THEN : u = u + 1: cur1 = m

GOTO tablisha

smotr:

LOCATE 1, 1: COLOR 15, 3: PRINT STRING$(80, " ")

ddl = (80 - LEN(mas$(cur, 2))) / 2

LOCATE 1, 1: COLOR 15, 3: PRINT STRING$(ddl, " "); mas$(cur, 2)

COLOR 7, 0

RETURN

final:

rez1$ = mas$(cur, 1)

rez2$ = mas$(cur, 2)

ERASE mas$

RETURN

dopoln:

CLS

LOCATE 10, 20: COLOR 7, 0: PRINT " "

LOCATE 12, 10: COLOR 7, 0: PRINT " <Esc> <F3> "

mmm:

kbd$ = INKEY$

SELECT CASE kbd$

CASE CHR$(0) + CHR$(61): GOSUB pop

CASE CHR$(27): CLS : GOTO rmp

END SELECT

GOTO mmm

pop:

CLS

LOCATE 10, 10: COLOR 7, 0

PRINT " "

LOCATE 12, 10

PRINT " "

COLOR 0, 7

LOCATE 10, 40: PRINT STRING$(31, " ")

LOCATE 12, 40: PRINT STRING$(31, " ")

LOCATE 10, 40: INPUT "", a1$

LOCATE 12, 40: INPUT "", a2$

ERASE mas$

CLS

OPEN baz$ FOR APPEND AS #1

PRINT #1, a1$

PRINT #1, a2$

CLOSE #1

GOTO rmp

2

- vector1.bas

REM

'

speed = 800 '

FILEHLP$ = "vector.hlp"

filerez$ = "vector.rez"

oshibka = 0 '

k = 10 '

k1 = 3 '

radius = 2 '

zakr = 1 '

zakrstr = 1 '

c = 12 ' -

curx = 0: cury = 0 '

DIM colora(10)

DIM slovo$(5)

DIM zapusk$(18)

SCREEN 9, , 0, 0

OPEN filerez$ FOR APPEND AS #3

PRINT #3, DATE$; " < > - "; TIME$;

GOSUB coord '

GOSUB zapusk '

FOR shag = 1 TO 10

PRINT #3, : PRINT #3, " - "; shag

glupo = 0

GOSUB coord '

p = 1: GOSUB slov

FOR ccc = 10 TO 13 STEP 3

GOSUB telo

IF ccc = 10 THEN abx = curx - curoldx: aby = cury - curoldy ELSE cdx = curx - curoldx: cdy = cury - curoldy

NEXT ccc

PRINT #3, "AB("; abx; ","; aby; ")"; TAB(15); "; CD("; cdx; ","; cdy; ")"; " ;"; TAB(34); "m("; cdx + abx; ", "; cdy + aby; ")";

GOSUB analis

NEXT shag

GOSUB coord

LOCATE 10, 53: PRINT " "; oshibka; " "

PRINT #3,

PRINT #3, " - "; oshibka

PRINT #3,

CLOSE #3

DO WHILE INKEY$ = "": LOOP

GOTO alis

telo:

GOSUB preobr:

GOSUB zapomin '

GOSUB strelka '

GOSUB vibor '

GOSUB oldstrelka ' ,

IF fl = 2 THEN fl = 0: RETURN

GOTO telo

vibor:

flag = 0

kbd$ = INKEY$

SELECT CASE kbd$

CASE CHR$(0) + "H": IF cury < 10 THEN cury = cury + 1: flag = 1

CASE CHR$(0) + "P": IF cury > -10 THEN cury = cury - 1: flag = 1

CASE CHR$(0) + "K": IF curx > -11 THEN curx = curx - 1: flag = 1

CASE CHR$(0) + "M": IF curx < 11 THEN curx = curx + 1: flag = 1

CASE CHR$(0) + CHR$(59): GOSUB reklama

CASE CHR$(32): GOSUB final: IF fl = 2 THEN RETURN

CASE CHR$(27): GOSUB vihod

END SELECT

IF flag = 0 THEN GOTO vibor

kx = x: ky = y

GOSUB preobr

RETURN

strelka:

'==== x y c ============ ========

PSET (x, y), c

DRAW "r6g2f4g2h4g2u6"

PAINT (x + 1, y + 1), c

PSET (x, y), 15

DRAW "r6g2f4g2"

RETURN

zapomin:

'==== x y ============ zap(9,9) ========

DIM zap(9, 9)

FOR i = 1 TO 9

FOR j = 1 TO 9

zap(i, j) = POINT(i + x - 1, j + y - 1)

NEXT j

NEXT i

RETURN

oldstrelka:

'==== kx ky zap(9,9) ==== ====

FOR i = 1 TO 9

FOR j = 1 TO 9

PSET (i + kx - 1, j + ky - 1), zap(i, j)

NEXT j

NEXT i

ERASE zap

RETURN

preobr:

x = curx * 16 + 203

y = 160 - cury * 14

RETURN

final:

kx = x: ky = y: GOSUB oldstrelka

IF fl = 1 THEN x2 = x: y2 = y: GOSUB strvect: IF ccc = 10 THEN p = 2: GOSUB slov ELSE p = 5: GOSUB slov

IF fl = 0 THEN curoldx = curx: curoldy = cury: x1 = x: y1 = y: CIRCLE (x, y), radius, ccc: IF zakr = 1 THEN PAINT (x, y), ccc

IF ccc = 10 AND fl = 0 THEN p = 3: GOSUB slov

IF ccc = 13 AND fl = 0 THEN p = 4: GOSUB slov

IF ccc = 14 AND fl = 0 THEN p = 6: GOSUB slov

fl = fl + 1

GOSUB zapomin: GOSUB strelka: RETURN

coord:

COLOR 15: CLS

'LINE (0, 0)-(639, 349), 15, B

LINE (10, 10)-(395, 311), 15, B

LINE (10, 10)-(394, 310), 7, B

LINE (400, 10)-(629, 311), 15, B

LINE (400, 10)-(628, 310), 7, B

FOR g = 27 TO 380 STEP 16

LINE (g, 15)-(g, 305), 8, B

NEXT g

FOR g = 20 TO 300 STEP 14

LINE (19, g)-(387, g), 8, B

NEXT g

FOR g = -10 TO 10 STEP 2

LOCATE 13, g * 2 + 25

IF g <> 0 THEN PRINT g

NEXT g

FOR g = -10 TO 10 STEP 2

LOCATE 12 - g, 24

PRINT g

NEXT g

LINE (19, 160)-(387, 160), 7, B

LINE (384, 158)-(387, 160), 7

LINE (384, 162)-(387, 160), 7

LINE (203, 15)-(203, 305), 7, B

LINE (200, 18)-(203, 15), 7

LINE (206, 18)-(203, 15), 7

LOCATE 2, 28

PRINT "y"

LOCATE 11, 49

PRINT "x"

shar:

FOR c = 1 TO 10

CIRCLE (405 + c * 20, 41), 7, 15

LINE (405 + c * 20, 38)-(410 + c * 20, 31), 15

PAINT (405 + c * 20, 39), colora(c), 15

NEXT c

RETURN

strvect:

dx = SQR((x2 - x1) ^ 2)

dy = SQR((y2 - y1) ^ 2)

df = SQR((dx * dx) + (dy * dy))

IF df = 0 THEN df = 1

dsx = k * dx / df

dsy = k * dy / df

dxx = k1 * dy / df

dyy = k1 * dx / df

IF x1 < x2 THEN x3 = x2 - dsx: x4 = x2 - dsx / 2 ELSE x3 = x2 + dsx: x4 = x2 + dsx / 2

IF y1 < y2 THEN y3 = y2 - dsy: y4 = y2 - dsy / 2 ELSE y3 = y2 + dsy: y4 = y2 + dsy / 2

IF SGN(x1 - x2) = SGN(y1 - y2) THEN x31 = x3 - dxx: y31 = y3 + dyy: x32 = x3 + dxx: y32 = y3 - dyy

IF SGN(x1 - x2) * (-1) = SGN(y1 - y2) THEN x31 = x3 + dxx: y31 = y3 + dyy: x32 = x3 - dxx: y32 = y3 - dyy

IF SGN(x1 - x2) = 0 OR SGN(y1 - y2) = 0 THEN x31 = x3 - dxx: y31 = y3 - dyy: x32 = x3 + dxx: y32 = y3 + dyy

LINE (x31, y31)-(x2, y2), ccc

LINE (x32, y32)-(x2, y2), ccc

IF zakrstr = 1 THEN LINE (x32, y32)-(x31, y31), ccc: PAINT (x4, y4), ccc

LINE (x1, y1)-(x2, y2), ccc

RETURN

reklama:

SCREEN 9, , 1, 1

COLOR 7, 0

OPEN FILEHLP$ FOR INPUT AS #1

S = 0

DO

ON ERROR GOTO 0

LINE INPUT #1, stran$

S = S + 1

LOOP UNTIL EOF(1)

CLOSE #1

IF FIX(S / 18) >= (S / 18) THEN KS = FIX(S / 18) ELSE KS = FIX(S / 18) + 1

DIM stran$(S)

OPEN FILEHLP$ FOR INPUT AS #1

FOR i = 1 TO S

ON ERROR GOTO 0

LINE INPUT #1, stran$(i)

NEXT i

CLOSE #1

NS = 1

GOSUB stran

obrabotka:

a$ = INKEY$

IF a$ = CHR$(0) + CHR$(73) THEN NS = NS - 1: GOSUB stran

IF a$ = CHR$(0) + CHR$(81) THEN NS = NS + 1: GOSUB stran

IF a$ = CHR$(27) THEN ERASE stran$: SCREEN 9, , 0, 0: RETURN

GOTO obrabotka

stran:

IF NS < 1 THEN NS = 1: RETURN

IF NS > KS THEN NS = KS: RETURN

n = 18 * NS

LOCATE 1, 1

PRINT ""; STRING$(64, "="); "T============="

PRINT ""; STRING$(15, " "); : COLOR 15, 0: PRINT " - "; : COLOR 7, 0: PRINT STRING$(15, " ");

IF NS < 10 THEN PRINT " "; NS; "" ELSE PRINT " "; NS; ""

PRINT ""; STRING$(64, " "); "L============="

FOR i = n - 17 TO n

IF i > S THEN PRINT ""; STRING$(78, " "); "" ELSE PRINT " "; stran$(i); STRING$((76 - LEN(stran$(i))), " "); ""

NEXT i

PRINT "L"; STRING$(78, "="); "-"

'COLOR 1, 7:

PRINT " - Esc ";

'IF NS = 1 THEN COLOR 8, 7 ELSE COLOR 1, 7

PRINT " - PageUp ";

'IF NS = KS THEN COLOR 8, 7 ELSE COLOR 1, 7

PRINT " - PageDown "

COLOR 7, 0

RETURN

analis:

PRINT #3,

PRINT #3, " :";

ccc = 10

COLOR ccc

LOCATE 9, 58: PRINT "__"

LOCATE 10, 58: PRINT "AB ( ; )"

PRINT #3,

PRINT #3, " x AB ";

vectx1:

p = 11: GOSUB slov

mm = 3: nx = 10: ny = 63

l$ = "+-1234567890"

m$ = "": m = 0

GOSUB napis

PRINT #3, VAL(m$);

IF abx <> VAL(m$) THEN GOSUB glupo: GOTO vectx1

PRINT #3,

PRINT #3, " y AB ";

vecty1:

p = 12: GOSUB slov

mm = 3: nx = 10: ny = 69

l$ = "+-1234567890"

m$ = "": m = 0

GOSUB napis

PRINT #3, VAL(m$);

IF aby <> VAL(m$) THEN GOSUB glupo: GOTO vecty1

ccc = 13

COLOR ccc

LOCATE 11, 58: PRINT "__"

LOCATE 12, 58: PRINT "CD ( ; )"

PRINT #3,

PRINT #3, " x CD ";

vectx2:

p = 13: GOSUB slov

mm = 3: nx = 12: ny = 63

l$ = "+-1234567890"

m$ = "": m = 0

GOSUB napis

PRINT #3, VAL(m$);

IF cdx <> VAL(m$) THEN GOSUB glupo: GOTO vectx2

PRINT #3,

PRINT #3, " y CD ";

vecty2:

p = 14: GOSUB slov

mm = 3: nx = 12: ny = 69

l$ = "+-1234567890"

m$ = "": m = 0

GOSUB napis

PRINT #3, VAL(m$);

IF cdy <> VAL(m$) THEN GOSUB glupo: GOTO vecty2

ccc = 14

COLOR ccc

LOCATE 13, 53: PRINT "__ __ _"

LOCATE 14, 53: PRINT "AB+CD=m ( ; )"

PRINT #3,

PRINT #3, " x m ";

vectx3:

p = 15: GOSUB slov

mm = 3: nx = 14: ny = 63

l$ = "+-1234567890"

m$ = "": m = 0

GOSUB napis

PRINT #3, VAL(m$);

IF cdx + abx <> VAL(m$) THEN GOSUB glupo: GOTO vectx3

PRINT #3,

PRINT #3, " y m ";

vecty3:

p = 16: GOSUB slov

mm = 3: nx = 14: ny = 69

l$ = "+-1234567890"

m$ = "": m = 0

GOSUB napis

PRINT #3, VAL(m$);

IF cdy + aby <> VAL(m$) THEN GOSUB glupo: GOTO vecty3

ccc = 14: p = 5: GOSUB slov

vectm:

GOSUB telo

' m

mmx = curx - curoldx: mmy = cury - curoldy

IF mmx <> abx + cdx OR mmy <> aby + cdy THEN GOSUB glupo: PRINT #3, : PRINT #3, " m("; mmx; ","; mmy; ")"; : CIRCLE (x1, y1), radius, 12: ccccc = ccc: ccc = 12: GOSUB strvect: ccc = ccccc: GOTO vectm

p = 20: GOSUB slov

IF glupo = 0 THEN colora(shag) = 4: coob$ = " ": GOSUB shar

IF glupo = 1 THEN colora(shag) = 14: coob$ = " ": GOSUB shar

IF glupo = 2 THEN colora(shag) = 2: coob$ = " ! ": GOSUB shar

IF glupo = 3 THEN colora(shag) = 9: coob$ = " ! ": GOSUB shar

IF glupo > 3 THEN colora(shag) = 15: coob$ = " !!! ": GOSUB shar

oshibka = oshibka + glupo

glupo = 0

COLOR colora(shag): LOCATE 20, 52: PRINT coob$: COLOR ccc

DO WHILE INKEY$ = "": LOOP

RETURN

napis:

LOCATE nx, ny: PRINT STRING$(mm, " ")

napis1:

k$ = ""

DO WHILE k$ = ""

LOCATE nx, ny: PRINT CHR$(95)

k$ = INKEY$

IF k$ = CHR$(0) + CHR$(59) THEN GOSUB reklama

LOOP

k = ASC(k$)

IF k = 13 AND m <> 0 THEN LOCATE nx, ny: PRINT " ": RETURN

IF k = 27 THEN GOSUB vihod

IF k = 8 AND m <> 0 THEN m = m - 1: m$ = LEFT$(m$, m): LOCATE nx, ny: ny = ny - 1: PRINT " ": GOTO napis1

IF INSTR(1, l$, k$) = 0 OR m = mm THEN GOTO napis1

m = m + 1:

m$ = m$ + k$: LOCATE nx, ny: PRINT k$: ny = ny + 1

GOTO napis1

vihod:

vih$ = ""

SCREEN 9, , 1, 1

CLS

LOCATE 10, 10

PRINT " - <Esc>"

DO WHILE vih$ = ""

vih$ = INKEY$

IF vih$ = CHR$(27) THEN CLS : PRINT #3, " - "; TIME$: PRINT #3, : CLOSE #3: GOTO alis

LOOP

SCREEN 9, , 0, 0

RETURN

alis:

CLS

LOCATE 10, 30: PRINT "GOOD BYE !!!"

DO WHILE INKEY$ = "": LOOP

FOR i = 1 TO 120

LINE (i + 200, 140)-(i + 240, 120), 0

SOUND i * 3 + 1100, .05

FOR j = 1 TO speed: NEXT j

NEXT i

SYSTEM

slov:

COLOR 15

IF p < 10 THEN slovo$(1) = " ": slovo$(2) = " ": slovo$(3) = " " + CHR$(27) + CHR$(24) + CHR$(25) + "->": slovo$(4) = " <> "

IF p = 1 THEN slovo$(5) = " AB "

IF p = 2 THEN slovo$(5) = " CD "

IF p = 3 THEN slovo$(5) = " AB "

IF p = 4 THEN slovo$(5) = " CD "

IF p = 5 THEN slovo$(5) = " m "

IF p = 6 THEN slovo$(5) = " m "

IF p > 10 THEN slovo$(1) = " ": slovo$(3) = " <Enter> ": slovo$(4) = " ": slovo$(5) = " <== "

IF p = 11 THEN slovo$(2) = " x AB "

IF p = 12 THEN slovo$(2) = " y AB "

IF p = 13 THEN slovo$(2) = " x CD "

IF p = 14 THEN slovo$(2) = " y CD "

IF p = 15 THEN slovo$(2) = " x m "

IF p = 16 THEN slovo$(2) = " y m "

IF p = 20 THEN FOR cl = 1 TO 5: slovo$(cl) = " ": NEXT cl

LINE (403, 235)-(626, 309), 15, B

LINE (403, 235)-(625, 308), 7, B

PAINT (450, 240), 0, 7

FOR lo = 18 TO 22

LOCATE lo, 52: PRINT slovo$(lo - 17)

NEXT lo

LOCATE 6, 52: PRINT "<F1>- <Esc>-"

LINE (403, 65)-(626, 89), 15, B

LINE (403, 65)-(625, 88), 7, B

COLOR ccc

RETURN

zapusk:

zapusk$(1) = " "

zapusk$(2) = " "

zapusk$(3) = " : "

zapusk$(4) = " 10 "

zapusk$(5) = " "

zapusk$(6) = " : "

zapusk$(7) = "1 - "

zapusk$(8) = " "

zapusk$(9) = " , "

zapusk$(10) = " "

zapusk$(11) = "2 - "

zapusk$(12) = "3 - "

zapusk$(13) = " "

zapusk$(14) = " "

zapusk$(15) = "4 - "

zapusk$(16) = " "

zapusk$(17) = " "

zapusk$(18) = " "

FOR ii = 1 TO 26

FOR ki = speed TO speed * 2: BEEP: NEXT ki

FOR ji = 1 TO 18

LOCATE ji + 4, 51 + ii

PRINT MID$(zapusk$(ji), ii, 1)

NEXT ji

NEXT ii

DO WHILE INKEY$ = "": LOOP

FOR ii = 26 TO 1 STEP -1

FOR ki = speed TO speed * 2: BEEP: NEXT ki

FOR ji = 1 TO 18

LOCATE ji + 4, 51 + ii

PRINT " "

NEXT ji

NEXT ii

RETURN

glupo:

glupo = glupo + 1

FOR clor = 15 TO 0 STEP -1

PLAY "n60l20"

COLOR clor

LOCATE 16, 53: PRINT "! "

NEXT clor

COLOR ccc

RETURN

3

- vector2.bas

REM

'

speed = 800 '

FILEHLP$ = "vector.hlp"

filerez$ = "vector.rez"

oshibka = 0 '

k = 10 '

k1 = 3 '

radius = 2 '

zakr = 1 '

zakrstr = 1 '

c = 12 ' -

curx = 0: cury = 0 '

DIM colora(10)

DIM slovo$(5)

DIM zapusk$(18)

SCREEN 9, , 0, 0

OPEN filerez$ FOR APPEND AS #3

PRINT #3, DATE$; " < > - "; TIME$;

GOSUB coord '

GOSUB zapusk '

FOR shag = 1 TO 10

PRINT #3, : PRINT #3, " - "; shag

glupo = 0

GOSUB coord '

p = 1: GOSUB slov

FOR ccc = 10 TO 13 STEP 3

GOSUB telo

IF ccc = 10 THEN abx = curx - curoldx: aby = cury - curoldy ELSE cdx = curx - curoldx: cdy = cury - curoldy

NEXT ccc

PRINT #3, "AB("; abx; ","; aby; ")"; TAB(15); "; CD("; cdx; ","; cdy; ")"; " ;"; TAB(34); "m("; cdx - abx; ", "; cdy - aby; ")";

GOSUB analis

NEXT shag

GOSUB coord

LOCATE 10, 53: PRINT " "; oshibka; " "

PRINT #3,

PRINT #3, " - "; oshibka

PRINT #3,

CLOSE #3

DO WHILE INKEY$ = "": LOOP

GOTO alis

telo:

GOSUB preobr:

GOSUB zapomin '

GOSUB strelka '

GOSUB vibor '

GOSUB oldstrelka ' ,

IF fl = 2 THEN fl = 0: RETURN

GOTO telo

vibor:

flag = 0

kbd$ = INKEY$

SELECT CASE kbd$

CASE CHR$(0) + "H": IF cury < 10 THEN cury = cury + 1: flag = 1

CASE CHR$(0) + "P": IF cury > -10 THEN cury = cury - 1: flag = 1

CASE CHR$(0) + "K": IF curx > -11 THEN curx = curx - 1: flag = 1

CASE CHR$(0) + "M": IF curx < 11 THEN curx = curx + 1: flag = 1

CASE CHR$(0) + CHR$(59): GOSUB reklama

CASE CHR$(32): GOSUB final: IF fl = 2 THEN RETURN

CASE CHR$(27): GOSUB vihod

END SELECT

IF flag = 0 THEN GOTO vibor

kx = x: ky = y

GOSUB preobr

RETURN

strelka:

'==== x y c ============ ========

PSET (x, y), c

DRAW "r6g2f4g2h4g2u6"

PAINT (x + 1, y + 1), c

PSET (x, y), 15

DRAW "r6g2f4g2"

RETURN

zapomin:

'==== x y ============ zap(9,9) ========

DIM zap(9, 9)

FOR i = 1 TO 9

FOR j = 1 TO 9

zap(i, j) = POINT(i + x - 1, j + y - 1)

NEXT j

NEXT i

RETURN

oldstrelka:

'==== kx ky zap(9,9) ==== ====

FOR i = 1 TO 9

FOR j = 1 TO 9

PSET (i + kx - 1, j + ky - 1), zap(i, j)

NEXT j

NEXT i

ERASE zap

RETURN

preobr:

x = curx * 16 + 203

y = 160 - cury * 14

RETURN

final:

kx = x: ky = y: GOSUB oldstrelka

IF fl = 1 THEN x2 = x: y2 = y: GOSUB strvect: IF ccc = 10 THEN p = 2: GOSUB slov ELSE p = 5: GOSUB slov

IF fl = 0 THEN curoldx = curx: curoldy = cury: x1 = x: y1 = y: CIRCLE (x, y), radius, ccc: IF zakr = 1 THEN PAINT (x, y), ccc

IF ccc = 10 AND fl = 0 THEN p = 3: GOSUB slov

IF ccc = 13 AND fl = 0 THEN p = 4: GOSUB slov

IF ccc = 14 AND fl = 0 THEN p = 6: GOSUB slov

fl = fl + 1

GOSUB zapomin: GOSUB strelka: RETURN

coord:

COLOR 15: CLS

'LINE (0, 0)-(639, 349), 15, B

LINE (10, 10)-(395, 311), 15, B

LINE (10, 10)-(394, 310), 7, B

LINE (400, 10)-(629, 311), 15, B

LINE (400, 10)-(628, 310), 7, B

FOR g = 27 TO 380 STEP 16

LINE (g, 15)-(g, 305), 8, B

NEXT g

FOR g = 20 TO 300 STEP 14

LINE (19, g)-(387, g), 8, B

NEXT g

FOR g = -10 TO 10 STEP 2

LOCATE 13, g * 2 + 25

IF g <> 0 THEN PRINT g

NEXT g

FOR g = -10 TO 10 STEP 2

LOCATE 12 - g, 24

PRINT g

NEXT g

LINE (19, 160)-(387, 160), 7, B

LINE (384, 158)-(387, 160), 7

LINE (384, 162)-(387, 160), 7

LINE (203, 15)-(203, 305), 7, B

LINE (200, 18)-(203, 15), 7

LINE (206, 18)-(203, 15), 7

LOCATE 2, 28

PRINT "y"

LOCATE 11, 49

PRINT "x"

shar:

FOR c = 1 TO 10

CIRCLE (405 + c * 20, 41), 7, 15

LINE (405 + c * 20, 38)-(410 + c * 20, 31), 15

PAINT (405 + c * 20, 39), colora(c), 15

NEXT c

RETURN

strvect:

dx = SQR((x2 - x1) ^ 2)

dy = SQR((y2 - y1) ^ 2)

df = SQR((dx * dx) + (dy * dy))

IF df = 0 THEN df = 1

dsx = k * dx / df

dsy = k * dy / df

dxx = k1 * dy / df

dyy = k1 * dx / df

IF x1 < x2 THEN x3 = x2 - dsx: x4 = x2 - dsx / 2 ELSE x3 = x2 + dsx: x4 = x2 + dsx / 2

IF y1 < y2 THEN y3 = y2 - dsy: y4 = y2 - dsy / 2 ELSE y3 = y2 + dsy: y4 = y2 + dsy / 2

IF SGN(x1 - x2) = SGN(y1 - y2) THEN x31 = x3 - dxx: y31 = y3 + dyy: x32 = x3 + dxx: y32 = y3 - dyy

IF SGN(x1 - x2) * (-1) = SGN(y1 - y2) THEN x31 = x3 + dxx: y31 = y3 + dyy: x32 = x3 - dxx: y32 = y3 - dyy

IF SGN(x1 - x2) = 0 OR SGN(y1 - y2) = 0 THEN x31 = x3 - dxx: y31 = y3 - dyy: x32 = x3 + dxx: y32 = y3 + dyy

LINE (x31, y31)-(x2, y2), ccc

LINE (x32, y32)-(x2, y2), ccc

IF zakrstr = 1 THEN LINE (x32, y32)-(x31, y31), ccc: PAINT (x4, y4), ccc

LINE (x1, y1)-(x2, y2), ccc

RETURN

reklama:

SCREEN 9, , 1, 1

COLOR 7, 0

OPEN FILEHLP$ FOR INPUT AS #1

S = 0

DO

ON ERROR GOTO 0

LINE INPUT #1, stran$

S = S + 1

LOOP UNTIL EOF(1)

CLOSE #1

IF FIX(S / 18) >= (S / 18) THEN KS = FIX(S / 18) ELSE KS = FIX(S / 18) + 1

DIM stran$(S)

OPEN FILEHLP$ FOR INPUT AS #1

FOR i = 1 TO S

ON ERROR GOTO 0

LINE INPUT #1, stran$(i)

NEXT i

CLOSE #1

NS = 1

GOSUB stran

obrabotka:

a$ = INKEY$

IF a$ = CHR$(0) + CHR$(73) THEN NS = NS - 1: GOSUB stran

IF a$ = CHR$(0) + CHR$(81) THEN NS = NS + 1: GOSUB stran

IF a$ = CHR$(27) THEN ERASE stran$: SCREEN 9, , 0, 0: RETURN

GOTO obrabotka

stran:

IF NS < 1 THEN NS = 1: RETURN

IF NS > KS THEN NS = KS: RETURN

n = 18 * NS

LOCATE 1, 1

PRINT ""; STRING$(64, "="); "T============="

PRINT ""; STRING$(15, " "); : COLOR 15, 0: PRINT " - "; : COLOR 7, 0: PRINT STRING$(15, " ");

IF NS < 10 THEN PRINT " "; NS; "" ELSE PRINT " "; NS; ""

PRINT ""; STRING$(64, " "); "L============="

FOR i = n - 17 TO n

IF i > S THEN PRINT ""; STRING$(78, " "); "" ELSE PRINT " "; stran$(i); STRING$((76 - LEN(stran$(i))), " "); ""

NEXT i

PRINT "L"; STRING$(78, "="); "-"

'COLOR 1, 7:

PRINT " - Esc ";

'IF NS = 1 THEN COLOR 8, 7 ELSE COLOR 1, 7

PRINT " - PageUp ";

'IF NS = KS THEN COLOR 8, 7 ELSE COLOR 1, 7

PRINT " - PageDown "

COLOR 7, 0

RETURN

analis:

PRINT #3,

PRINT #3, " :";

ccc = 10

COLOR ccc

LOCATE 9, 58: PRINT "__"

LOCATE 10, 58: PRINT "AB ( ; )"

PRINT #3,

PRINT #3, " x AB ";

vectx1:

p = 11: GOSUB slov

mm = 3: nx = 10: ny = 63

l$ = "+-1234567890"

m$ = "": m = 0

GOSUB napis

PRINT #3, VAL(m$);

IF abx <> VAL(m$) THEN GOSUB glupo: GOTO vectx1

PRINT #3,

PRINT #3, " y AB ";

vecty1:

p = 12: GOSUB slov

mm = 3: nx = 10: ny = 69

l$ = "+-1234567890"

m$ = "": m = 0

GOSUB napis

PRINT #3, VAL(m$);

IF aby <> VAL(m$) THEN GOSUB glupo: GOTO vecty1

ccc = 13

COLOR ccc

LOCATE 11, 58: PRINT "__"

LOCATE 12, 58: PRINT "CD ( ; )"

PRINT #3,

PRINT #3, " x CD ";

vectx2:

p = 13: GOSUB slov

mm = 3: nx = 12: ny = 63

l$ = "+-1234567890"

m$ = "": m = 0

GOSUB napis

PRINT #3, VAL(m$);

IF cdx <> VAL(m$) THEN GOSUB glupo: GOTO vectx2

PRINT #3,

PRINT #3, " y CD ";

vecty2:

p = 14: GOSUB slov

mm = 3: nx = 12: ny = 69

l$ = "+-1234567890"

m$ = "": m = 0

GOSUB napis

PRINT #3, VAL(m$);

IF cdy <> VAL(m$) THEN GOSUB glupo: GOTO vecty2

ccc = 14

COLOR ccc

LOCATE 13, 53: PRINT " __ __ _"

LOCATE 14, 53: PRINT " CD-AB=m( ; )"

PRINT #3,

PRINT #3, " x m ";

vectx3:

p = 15: GOSUB slov

mm = 3: nx = 14: ny = 63

l$ = "+-1234567890"

m$ = "": m = 0

GOSUB napis

PRINT #3, VAL(m$);

IF cdx - abx <> VAL(m$) THEN GOSUB glupo: GOTO vectx3

PRINT #3,

PRINT #3, " y m ";

vecty3:

p = 16: GOSUB slov

mm = 3: nx = 14: ny = 69

l$ = "+-1234567890"

m$ = "": m = 0

GOSUB napis

PRINT #3, VAL(m$);

IF cdy - aby <> VAL(m$) THEN GOSUB glupo: GOTO vecty3

ccc = 14: p = 5: GOSUB slov

vectm:

GOSUB telo

' m

mmx = curx - curoldx: mmy = cury - curoldy

IF mmx <> cdx - abx OR mmy <> cdy - aby THEN GOSUB glupo: PRINT #3, : PRINT #3, " m("; mmx; ","; mmy; ")"; : CIRCLE (x1, y1), radius, 12: ccccc = ccc: ccc = 12: GOSUB strvect: ccc = ccccc: GOTO vectm

p = 20: GOSUB slov

IF glupo = 0 THEN colora(shag) = 4: coob$ = " ": GOSUB shar

IF glupo = 1 THEN colora(shag) = 14: coob$ = " ": GOSUB shar

IF glupo = 2 THEN colora(shag) = 2: coob$ = " ! ": GOSUB shar

IF glupo = 3 THEN colora(shag) = 9: coob$ = " ! ": GOSUB shar

IF glupo > 3 THEN colora(shag) = 15: coob$ = " !!! ": GOSUB shar

oshibka = oshibka + glupo

glupo = 0

COLOR colora(shag): LOCATE 20, 52: PRINT coob$: COLOR ccc

DO WHILE INKEY$ = "": LOOP

RETURN

napis:

LOCATE nx, ny: PRINT STRING$(mm, " ")

napis1:

k$ = ""

DO WHILE k$ = ""

LOCATE nx, ny: PRINT CHR$(95)

k$ = INKEY$

IF k$ = CHR$(0) + CHR$(59) THEN GOSUB reklama

LOOP

k = ASC(k$)

IF k = 13 AND m <> 0 THEN LOCATE nx, ny: PRINT " ": RETURN

IF k = 27 THEN GOSUB vihod

IF k = 8 AND m <> 0 THEN m = m - 1: m$ = LEFT$(m$, m): LOCATE nx, ny: ny = ny - 1: PRINT " ": GOTO napis1

IF INSTR(1, l$, k$) = 0 OR m = mm THEN GOTO napis1

m = m + 1:

m$ = m$ + k$: LOCATE nx, ny: PRINT k$: ny = ny + 1

GOTO napis1

vihod:

vih$ = ""

SCREEN 9, , 1, 1

CLS

LOCATE 10, 10

PRINT " - <Esc>"

DO WHILE vih$ = ""

vih$ = INKEY$

IF vih$ = CHR$(27) THEN CLS : PRINT #3, " - "; TIME$: PRINT #3, : CLOSE #3: GOTO alis

LOOP

SCREEN 9, , 0, 0

RETURN

alis:

CLS

LOCATE 10, 30: PRINT "GOOD BYE !!!"

DO WHILE INKEY$ = "": LOOP

FOR i = 1 TO 120

LINE (i + 200, 140)-(i + 240, 120), 0

SOUND i * 3 + 1100, .05

FOR j = 1 TO speed: NEXT j

NEXT i

SYSTEM

slov:

COLOR 15

IF p < 10 THEN slovo$(1) = " ": slovo$(2) = " ": slovo$(3) = " " + CHR$(27) + CHR$(24) + CHR$(25) + "->": slovo$(4) = " <> "

IF p = 1 THEN slovo$(5) = " AB "

IF p = 2 THEN slovo$(5) = " CD "

IF p = 3 THEN slovo$(5) = " AB "

IF p = 4 THEN slovo$(5) = " CD "

IF p = 5 THEN slovo$(5) = " m "

IF p = 6 THEN slovo$(5) = " m "

IF p > 10 THEN slovo$(1) = " ": slovo$(3) = " <Enter> ": slovo$(4) = " ": slovo$(5) = " <== "

IF p = 11 THEN slovo$(2) = " x AB "

IF p = 12 THEN slovo$(2) = " y AB "

IF p = 13 THEN slovo$(2) = " x CD "

IF p = 14 THEN slovo$(2) = " y CD "

IF p = 15 THEN slovo$(2) = " x m "

IF p = 16 THEN slovo$(2) = " y m "

IF p = 20 THEN FOR cl = 1 TO 5: slovo$(cl) = " ": NEXT cl

LINE (403, 235)-(626, 309), 15, B

LINE (403, 235)-(625, 308), 7, B

PAINT (450, 240), 0, 7

FOR lo = 18 TO 22

LOCATE lo, 52: PRINT slovo$(lo - 17)

NEXT lo

LOCATE 6, 52: PRINT "<F1>- <Esc>-"

LINE (403, 65)-(626, 89), 15, B

LINE (403, 65)-(625, 88), 7, B

COLOR ccc

RETURN

zapusk:

zapusk$(1) = " "

zapusk$(2) = " "

zapusk$(3) = " : "

zapusk$(4) = " 10 "

zapusk$(5) = " : "

zapusk$(6) = "1 - "

zapusk$(7) = " "

zapusk$(8) = " , "

zapusk$(9) = " "

zapusk$(10) = "2 - "

zapusk$(11) = "3 - "

zapusk$(12) = " "

zapusk$(13) = " "

zapusk$(14) = " "

zapusk$(15) = "4 - "

zapusk$(16) = " "

zapusk$(17) = " "

zapusk$(18) = " "

FOR ii = 1 TO 26

FOR ki = speed TO speed * 2: BEEP: NEXT ki

FOR ji = 1 TO 18

LOCATE ji + 4, 51 + ii

PRINT MID$(zapusk$(ji), ii, 1)

NEXT ji

NEXT ii

DO WHILE INKEY$ = "": LOOP

FOR ii = 26 TO 1 STEP -1

FOR ki = speed TO speed * 2: BEEP: NEXT ki

FOR ji = 1 TO 18

LOCATE ji + 4, 51 + ii

PRINT " "

NEXT ji

NEXT ii

RETURN

glupo:

glupo = glupo + 1

FOR clor = 15 TO 0 STEP -1

PLAY "n60l20"

COLOR clor

LOCATE 16, 53: PRINT "! "

NEXT clor

COLOR ccc

RETURN

4

- vector3.rez

REM

'

speed = 800 '

FILEHLP$ = "vector.hlp"

filerez$ = "vector.rez"

oshibka = 0 '

k = 10 '

k1 = 3 '

radius = 2 '

zakr = 1 '

zakrstr = 1 '

c = 12 ' -

curx = 0: cury = 0 '

DIM colora(10)

DIM slovo$(5)

DIM zapusk$(18)

SCREEN 9, , 0, 0

OPEN filerez$ FOR APPEND AS #3

PRINT #3, DATE$; " < > - "; TIME$;

GOSUB coord '

GOSUB zapusk '

FOR shag = 1 TO 10

PRINT #3, : PRINT #3, " - "; shag

glupo = 0

GOSUB coord '

p = 1: GOSUB slov

ccc = 10

GOSUB telo

abx = curx - curoldx: aby = cury - curoldy

er: ' er

RANDOMIZE TIMER

er = INT(RND(1) * 19) - 9

IF ABS(er * abx) > 20 OR ABS(er * aby) > 22 THEN GOTO er

PRINT #3, "AB("; abx; ","; aby; ")"; TAB(15); " "; er

GOSUB analis

NEXT shag

GOSUB coord

LOCATE 10, 53: PRINT " "; oshibka; " "

PRINT #3,

PRINT #3, " - "; oshibka

PRINT #3,

CLOSE #3

DO WHILE INKEY$ = "": LOOP

GOTO alis

telo:

GOSUB preobr:

GOSUB zapomin '

GOSUB strelka '

GOSUB vibor '

GOSUB oldstrelka ' ,

IF fl = 2 THEN fl = 0: RETURN

GOTO telo

vibor:

flag = 0

kbd$ = INKEY$

SELECT CASE kbd$

CASE CHR$(0) + "H": IF cury < 10 THEN cury = cury + 1: flag = 1

CASE CHR$(0) + "P": IF cury > -10 THEN cury = cury - 1: flag = 1

CASE CHR$(0) + "K": IF curx > -11 THEN curx = curx - 1: flag = 1

CASE CHR$(0) + "M": IF curx < 11 THEN curx = curx + 1: flag = 1

CASE CHR$(0) + CHR$(59): GOSUB reklama

CASE CHR$(32): GOSUB final: IF fl = 2 THEN RETURN

CASE CHR$(27): GOSUB vihod

END SELECT

IF flag = 0 THEN GOTO vibor

kx = x: ky = y

GOSUB preobr

RETURN

strelka:

'==== x y c ============ ========

PSET (x, y), c

DRAW "r6g2f4g2h4g2u6"

PAINT (x + 1, y + 1), c

PSET (x, y), 15

DRAW "r6g2f4g2"

RETURN

zapomin:

'==== x y ============ zap(9,9) ========

DIM zap(9, 9)

FOR i = 1 TO 9

FOR j = 1 TO 9

zap(i, j) = POINT(i + x - 1, j + y - 1)

NEXT j

NEXT i

RETURN

oldstrelka:

'==== kx ky zap(9,9) ==== ====

FOR i = 1 TO 9

FOR j = 1 TO 9

PSET (i + kx - 1, j + ky - 1), zap(i, j)

NEXT j

NEXT i

ERASE zap

RETURN

preobr:

x = curx * 16 + 203

y = 160 - cury * 14

RETURN

final:

kx = x: ky = y: GOSUB oldstrelka

IF fl = 1 THEN x2 = x: y2 = y: GOSUB strvect: IF ccc = 10 THEN p = 2: GOSUB slov ELSE p = 5: GOSUB slov

IF fl = 0 THEN curoldx = curx: curoldy = cury: x1 = x: y1 = y: CIRCLE (x, y), radius, ccc: IF zakr = 1 THEN PAINT (x, y), ccc

IF ccc = 10 AND fl = 0 THEN p = 3: GOSUB slov

'IF ccc = 13 AND fl = 0 THEN p = 4: GOSUB slov

'IF ccc = 14 AND fl = 0 THEN p = 6: GOSUB slov

fl = fl + 1

GOSUB zapomin: GOSUB strelka: RETURN

coord:

COLOR 15: CLS

'LINE (0, 0)-(639, 349), 15, B

LINE (10, 10)-(395, 311), 15, B

LINE (10, 10)-(394, 310), 7, B

LINE (400, 10)-(629, 311), 15, B

LINE (400, 10)-(628, 310), 7, B

FOR g = 27 TO 380 STEP 16

LINE (g, 15)-(g, 305), 8, B

NEXT g

FOR g = 20 TO 300 STEP 14

LINE (19, g)-(387, g), 8, B

NEXT g

FOR g = -10 TO 10 STEP 2

LOCATE 13, g * 2 + 25

IF g <> 0 THEN PRINT g

NEXT g

FOR g = -10 TO 10 STEP 2

LOCATE 12 - g, 24

PRINT g

NEXT g

LINE (19, 160)-(387, 160), 7, B

LINE (384, 158)-(387, 160), 7

LINE (384, 162)-(387, 160), 7

LINE (203, 15)-(203, 305), 7, B

LINE (200, 18)-(203, 15), 7

LINE (206, 18)-(203, 15), 7

LOCATE 2, 28

PRINT "y"

LOCATE 11, 49

PRINT "x"

shar:

FOR c = 1 TO 10

CIRCLE (405 + c * 20, 41), 7, 15

LINE (405 + c * 20, 38)-(410 + c * 20, 31), 15

PAINT (405 + c * 20, 39), colora(c), 15

NEXT c

RETURN

strvect:

dx = SQR((x2 - x1) ^ 2)

dy = SQR((y2 - y1) ^ 2)

df = SQR((dx * dx) + (dy * dy))

IF df = 0 THEN df = 1

dsx = k * dx / df

dsy = k * dy / df

dxx = k1 * dy / df

dyy = k1 * dx / df

IF x1 < x2 THEN x3 = x2 - dsx: x4 = x2 - dsx / 2 ELSE x3 = x2 + dsx: x4 = x2 + dsx / 2

IF y1 < y2 THEN y3 = y2 - dsy: y4 = y2 - dsy / 2 ELSE y3 = y2 + dsy: y4 = y2 + dsy / 2

IF SGN(x1 - x2) = SGN(y1 - y2) THEN x31 = x3 - dxx: y31 = y3 + dyy: x32 = x3 + dxx: y32 = y3 - dyy

IF SGN(x1 - x2) * (-1) = SGN(y1 - y2) THEN x31 = x3 + dxx: y31 = y3 + dyy: x32 = x3 - dxx: y32 = y3 - dyy

IF SGN(x1 - x2) = 0 OR SGN(y1 - y2) = 0 THEN x31 = x3 - dxx: y31 = y3 - dyy: x32 = x3 + dxx: y32 = y3 + dyy

LINE (x31, y31)-(x2, y2), ccc

LINE (x32, y32)-(x2, y2), ccc

IF zakrstr = 1 THEN LINE (x32, y32)-(x31, y31), ccc: PAINT (x4, y4), ccc

LINE (x1, y1)-(x2, y2), ccc

RETURN

reklama:

SCREEN 9, , 1, 1

COLOR 7, 0

OPEN FILEHLP$ FOR INPUT AS #1

S = 0

DO

ON ERROR GOTO 0

LINE INPUT #1, stran$

S = S + 1

LOOP UNTIL EOF(1)

CLOSE #1

IF FIX(S / 18) >= (S / 18) THEN KS = FIX(S / 18) ELSE KS = FIX(S / 18) + 1

DIM stran$(S)

OPEN FILEHLP$ FOR INPUT AS #1

FOR i = 1 TO S

ON ERROR GOTO 0

LINE INPUT #1, stran$(i)

NEXT i

CLOSE #1

NS = 1

GOSUB stran

obrabotka:

a$ = INKEY$

IF a$ = CHR$(0) + CHR$(73) THEN NS = NS - 1: GOSUB stran

IF a$ = CHR$(0) + CHR$(81) THEN NS = NS + 1: GOSUB stran

IF a$ = CHR$(27) THEN ERASE stran$: SCREEN 9, , 0, 0: RETURN

GOTO obrabotka

stran:

IF NS < 1 THEN NS = 1: RETURN

IF NS > KS THEN NS = KS: RETURN

n = 18 * NS

LOCATE 1, 1

PRINT ""; STRING$(64, "="); "T============="

PRINT ""; STRING$(15, " "); : COLOR 15, 0: PRINT " - "; : COLOR 7, 0: PRINT STRING$(15, " ");

IF NS < 10 THEN PRINT " "; NS; "" ELSE PRINT " "; NS; ""

PRINT ""; STRING$(64, " "); "L============="

FOR i = n - 17 TO n

IF i > S THEN PRINT ""; STRING$(78, " "); "" ELSE PRINT " "; stran$(i); STRING$((76 - LEN(stran$(i))), " "); ""

NEXT i

PRINT "L"; STRING$(78, "="); "-"

'COLOR 1, 7:

PRINT " - Esc ";

'IF NS = 1 THEN COLOR 8, 7 ELSE COLOR 1, 7

PRINT " - PageUp ";

'IF NS = KS THEN COLOR 8, 7 ELSE COLOR 1, 7

PRINT " - PageDown "

COLOR 7, 0

RETURN

analis:

PRINT #3, " :";

ccc = 10

COLOR ccc

LOCATE 9, 58: PRINT "__"

LOCATE 10, 58: PRINT "AB ( ; )"

PRINT #3,

PRINT #3, " x AB ";

vectx1:

p = 11: GOSUB slov

mm = 3: nx = 10: ny = 63

l$ = "+-1234567890"

m$ = "": m = 0

GOSUB napis

PRINT #3, VAL(m$);

IF abx <> VAL(m$) THEN GOSUB glupo: GOTO vectx1

PRINT #3,

PRINT #3, " y AB ";

vecty1:

p = 12: GOSUB slov

mm = 3: nx = 10: ny = 69

l$ = "+-1234567890"

m$ = "": m = 0

GOSUB napis

PRINT #3, VAL(m$);

IF aby <> VAL(m$) THEN GOSUB glupo: GOTO vecty1

ccc = 14

COLOR ccc

LOCATE 13, 53: PRINT TAB(56); " __ _"

LOCATE 14, 53: PRINT er; TAB(56); "*AB= m( ; )"

PRINT #3,

PRINT #3, " x m ";

vectx3:

p = 15: GOSUB slov

mm = 3: nx = 14: ny = 64

l$ = "+-1234567890"

m$ = "": m = 0

GOSUB napis

PRINT #3, VAL(m$);

IF er * abx <> VAL(m$) THEN GOSUB glupo: GOTO vectx3

PRINT #3,

PRINT #3, " y m ";

vecty3:

p = 16: GOSUB slov

mm = 3: nx = 14: ny = 70

l$ = "+-1234567890"

m$ = "": m = 0

GOSUB napis

PRINT #3, VAL(m$);

IF er * aby <> VAL(m$) THEN GOSUB glupo: GOTO vecty3

ccc = 14: p = 5: GOSUB slov

vectm:

GOSUB telo

' m

mmx = curx - curoldx: mmy = cury - curoldy

IF mmx <> abx * er OR mmy <> aby * er THEN GOSUB glupo: PRINT #3, : PRINT #3, " m("; mmx; ","; mmy; ")"; : CIRCLE (x1, y1), radius, 12: ccccc = ccc: ccc = 12: GOSUB strvect: ccc = ccccc: GOTO vectm

p = 20: GOSUB slov

IF glupo = 0 THEN colora(shag) = 4: coob$ = " ": GOSUB shar

IF glupo = 1 THEN colora(shag) = 14: coob$ = " ": GOSUB shar

IF glupo = 2 THEN colora(shag) = 2: coob$ = " ! ": GOSUB shar

IF glupo = 3 THEN colora(shag) = 9: coob$ = " ! ": GOSUB shar

IF glupo > 3 THEN colora(shag) = 15: coob$ = " !!! ": GOSUB shar

oshibka = oshibka + glupo

glupo = 0

COLOR colora(shag): LOCATE 20, 52: PRINT coob$: COLOR ccc

DO WHILE INKEY$ = "": LOOP

RETURN

napis:

LOCATE nx, ny: PRINT STRING$(mm, " ")

napis1:

k$ = ""

DO WHILE k$ = ""

LOCATE nx, ny: PRINT CHR$(95)

k$ = INKEY$

IF k$ = CHR$(0) + CHR$(59) THEN GOSUB reklama

LOOP

k = ASC(k$)

IF k = 13 AND m <> 0 THEN LOCATE nx, ny: PRINT " ": RETURN

IF k = 27 THEN GOSUB vihod

IF k = 8 AND m <> 0 THEN m = m - 1: m$ = LEFT$(m$, m): LOCATE nx, ny: ny = ny - 1: PRINT " ": GOTO napis1

IF INSTR(1, l$, k$) = 0 OR m = mm THEN GOTO napis1

m = m + 1:

m$ = m$ + k$: LOCATE nx, ny: PRINT k$: ny = ny + 1

GOTO napis1

vihod:

vih$ = ""

SCREEN 9, , 1, 1

CLS

LOCATE 10, 10

PRINT " - <Esc>"

DO WHILE vih$ = ""

vih$ = INKEY$

IF vih$ = CHR$(27) THEN CLS : PRINT #3, " - "; TIME$: PRINT #3, : CLOSE #3: GOTO alis

LOOP

SCREEN 9, , 0, 0

RETURN

alis:

CLS

LOCATE 10, 30: PRINT "GOOD BYE !!!"

DO WHILE INKEY$ = "": LOOP

FOR i = 1 TO 120

LINE (i + 200, 140)-(i + 240, 120), 0

SOUND i * 3 + 1100, .05

FOR j = 1 TO speed: NEXT j

NEXT i

SYSTEM

slov:

COLOR 15

IF p < 10 THEN slovo$(1) = " ": slovo$(2) = " ": slovo$(3) = " " + CHR$(27) + CHR$(24) + CHR$(25) + "->": slovo$(4) = " <> "

IF p = 1 THEN slovo$(5) = " AB "

IF p = 3 THEN slovo$(5) = " AB "

IF p = 5 THEN slovo$(5) = " m=" + STR$(er) + "*AB "

IF p = 6 THEN slovo$(5) = " m=" + STR$(er) + "*AB "

IF p > 10 THEN slovo$(1) = " ": slovo$(3) = " <Enter> ": slovo$(4) = " ": slovo$(5) = " <== "

IF p = 11 THEN slovo$(2) = " x AB "

IF p = 12 THEN slovo$(2) = " y AB "

IF p = 15 THEN slovo$(2) = " x m "

IF p = 16 THEN slovo$(2) = " y m "

IF p = 20 THEN FOR cl = 1 TO 5: slovo$(cl) = " ": NEXT cl

LINE (403, 235)-(626, 309), 15, B

LINE (403, 235)-(625, 308), 7, B

PAINT (450, 240), 0, 7

FOR lo = 18 TO 22

LOCATE lo, 52: PRINT slovo$(lo - 17)

NEXT lo

LOCATE 6, 52: PRINT "<F1>- <Esc>-"

LINE (403, 65)-(626, 89), 15, B

LINE (403, 65)-(625, 88), 7, B

COLOR ccc

RETURN

zapusk:

zapusk$(1) = " "

zapusk$(2) = " "

zapusk$(3) = " : "

zapusk$(4) = " 10 "

zapusk$(5) = " "

zapusk$(6) = " : "

zapusk$(7) = "1 - "

zapusk$(8) = " "

zapusk$(9) = " AB, "

zapusk$(10) = " "

zapusk$(11) = "2 - "

zapusk$(12) = "3 - "

zapusk$(13) = " a "

zapusk$(14) = " "

zapusk$(15) = "4 - "

zapusk$(16) = " AB * a "

zapusk$(17) = " "

zapusk$(18) = " "

FOR ii = 1 TO 26

FOR ki = speed TO speed * 2: BEEP: NEXT ki

FOR ji = 1 TO 18

LOCATE ji + 4, 51 + ii

PRINT MID$(zapusk$(ji), ii, 1)

NEXT ji

NEXT ii

DO WHILE INKEY$ = "": LOOP

FOR ii = 26 TO 1 STEP -1

FOR ki = speed TO speed * 2: BEEP: NEXT ki

FOR ji = 1 TO 18

LOCATE ji + 4, 51 + ii

PRINT " "

NEXT ji

NEXT ii

RETURN

glupo:

glupo = glupo + 1

FOR clor = 15 TO 0 STEP -1

PLAY "n60l20"

COLOR clor

LOCATE 16, 53: PRINT "! "

NEXT clor

COLOR ccc

RETURN

, .

, , .

.

. .

, .

.

, .

.

. , 11- . , .

, , . , .

Qbasic.

: .. : . "" 1986/1 . . . 1987 : ..../ .. ..; .-. , 1992. : ..../ .. ..; .-. , 1990. : ..../ .. ..; .-. , 1991. . 1991. . /. .. - : . , 1990. .. . , , , 1998. .. : . , , 1987. . - 1990. , - , 1990. .. . .:, 1998. : . -.:, 1989. .., .., .. . -.:, 1989. .., .. . , 1964. . - . -:, 1992. .. . : - , 1993. .. . : - , 1991. .. . : - , 1992. . -.:, 1990. .. : . , , 1990. . 1990-1997. . .:, 1988. - . .:,1987. .., .., .. . 1-4. -. , 1991. ., . -. -.:, 1987. . -.:, 1991. .. . -.:, 1977. .. -. -: , 1986. . . -.:,1991. .. . : , 1990. .., .. : . , , 1990.

. I. . . - . . II. .

 

 

 

! , , , .
. , :