REFERATUA.ORG.UA — База українських рефератів




-10) - (110, 110)

FOR I = 1 TO 100

X = 100 * RND(1) : Y = 100 * RND(1) : R = 5 * RND(1)

CIRCLE (X, Y), R

NEXT I

END

'НОТИ

'----------

5 CLS

LOCATE 1, 1: PRINT "--------- СI (B)"

LOCATE 2, 1: PRINT "--------- ЛЯ (A)"

LOCATE 3, 1: PRINT "--------- СОЛЬ (G)"

LOCATE 4, 1: PRINT "--------- ФА (F)"

LOCATE 5, 1: PRINT "--------- МI (E)"

LOCATE 6, 1: PRINT "--------- РЕ (D)"

LOCATE 7, 1: PRINT "--------- ДО (C)"

LOCATE 9, 1: PRINT " Вихiд (Q)"

PLAY "O2"

10 W$ = INKEY$: IF W$ = "" THEN GOTO 10

IF W$="B" OR W$="b" THEN LOCATE 1,5: PRINT "O": PLAY "B2": GOTO 5

IF W$="A" OR W$="a" THEN LOCATE 2,5: PRINT "O": PLAY "A2": GOTO 5

IF W$="G" OR W$="g" THEN LOCATE 3,5: PRINT "O": PLAY "G2": GOTO 5

IF W$="F" OR W$="f" THEN LOCATE 4,5: PRINT "O": PLAY "F2": GOTO 5

IF W$="E" OR W$="e" THEN LOCATE 5,5: PRINT "O": PLAY "E2": GOTO 5

IF W$="D" OR W$="d" THEN LOCATE 6,5: PRINT "O": PLAY "D2": GOTO 5

IF W$="C" OR W$="c" THEN LOCATE 7,5: PRINT "O": PLAY "C2": GOTO 5

IF W$="Q" OR W$="q" THEN END

BEEP: GOTO 10

'МУЗИКАЛЬНI МЕЛОДIЇ

'----------------------------------

CLS : WIDTH 40

PRINT "---Варшав'янка---"

PLAY "t100 l8 o3 mn a4 ml a. mn g16 f4 ml f. mn c+16 d4 ml d."

PLAY "mn c16 d4 f4 e4 a. a16 ml a g f mn e ml d e f mn g a2 p2"

PRINT "---Окрасился месяц багрянцем---"

PLAY "t100 l8 mn o3 g c4 c e- g4 f e- ml g4. f16 mn e-16 d4."

PLAY "c o2 b-4 o3 d f b-4 o4 c o3 a- ml g2 mn g p p o4"

PLAY "d c4 o3 g g o4 ml e- mn d c o3 g ml b-4. a-16 mn g16"

PLAY "ml f e- mn d c g4 f g ml b- mn a- d e- c2 p2"

PRINT "---Засвистали козаченьки---"

PLAY "t100 l4 mn o3 g o4 g ml g f8 mn e-8 d g c c f f f g4 ml"

PLAY "d2 f8 e-8 d8 mn c8 d d d e- ml d8 c8 o3 b-8 mn a8 g o4 g"

PLAY "ml f8 e-8 d8 mn c8 o3 b- a g2 ml g8 p2"

PRINT "---заспіваймо пісню веселеньку---"

PLAY "t140 l4 mn o3 e a o4 c. o3 a8 b8 o4 d8 c8 o3 b8 a e"

PLAY "o4 c o3a ml o4 d8 c8 o3 mn b8 a8 ml g+8 mn g+8 ml b8"

PLAY "mn a8 e e4o4 e e g. e8 d ml g8 mn f8 e d c. o3 a8"

PLAY "o4 d8 c8 o3 b8 a8 o4 e2 d2"

END

'HAPPY BIRTHDAY

'----------------------------

RESTORE Happy

READ Frequensy, Duration

WHILE Frequensy <> -1

SOUND Frequensy, Duration * 1.33

READ Frequensy, Duration

WEND

END

Happy:

DATA 784, 3, 659, 2, 523, 6, 659, 6, 784, 6, 1047, 15, 1329, 3

DATA 1175, 2, 1047, 6, 659, 6, 740, 6, 784, 15, -1, -1

'ЗВУКОВI ЕФЕКТИ

'---------------------------

WHILE Q$ <> "Q"

CLS

PRINT "Sound effects": PRINT

COLOR 15, 0: PRINT " B"; : COLOR 7, 0: PRINT "ouncing"

COLOR 15, 0: PRINT " F"; : COLOR 7, 0: PRINT "alling"

COLOR 15, 0: PRINT " K"; : COLOR 7, 0: PRINT "laxon"

COLOR 15, 0: PRINT " S"; : COLOR 7, 0: PRINT "iren"

COLOR 15, 0: PRINT " Q"; : COLOR 7, 0: PRINT "uit"

PRINT : PRINT "Select: ";

Q$ = " "

WHILE INSTR("BFKSQbfksq", Q$) = 0

Q$ = INPUT$(1)

WEND

CLS

IF Q$ = "B" OR Q$ = "b" THEN

PRINT "Bouncing . . . "

CALL Bounce(32767, 246)

ELSEIF Q$ = "F" OR Q$ = "f" THEN

PRINT "Falling . . . "

CALL Fall(2000, 550, 500)

ELSEIF Q$ = "S" OR Q$ = "s" THEN

PRINT "Wailing . . ."

PRINT " . . . press any key to end."

CALL Siren(780, 650)

ELSEIF Q$ = "K" OR Q$ = "k" THEN

PRINT "Oscillating . . ."

PRINT " . . . press any key to end."

CALL Klaxon(987, 329)

ELSEIF Q$ = "q" THEN

Q$ = "Q"

END IF

WEND

END

SUB Bounce (Hi, Low) STATIC

FOR Count = 60 TO 1 STEP -2

SOUND Low - Count / 2, Count / 20

SOUND Hi, Count / 15

NEXT

END SUB

SUB Fall (Hi, Low, Del) STATIC

FOR Count = Hi TO Low STEP -10

SOUND Count, Del / Count

NEXT

END SUB

SUB Klaxon (Hi, Low) STATIC

WHILE INKEY$ = ""

SOUND Hi, 5

SOUND Low, 5

WEND

END SUB

SUB Siren (Hi, Rng) STATIC

WHILE INKEY$ = ""

FOR Count = Rng TO -Rng STEP -4

SOUND Hi - ABS(Count), .3

Count = Count - 2 / Rng

NEXT

WEND

END SUB

'ГРАФIЧHИЙ РЕДАКТОР

'-------------------------------------

ON KEY (1) SUB 500

KEY (1) ON

SCREEN 2

200 x$=input$(1)

IF X$="S" OR x$="s" THEN END

IF X$="A" OR X$="a" THEN DRAW "L5"

IF X$="D" OR X$="d" THEN DRAW "R5"

IF X$="W" OR X$="w" THEN DRAW "U5"

IF X$="X" OR x$="x" THEN DRAW "D5"

IF X$="E" OR x$="e" THEN DRAW "E5"

IF X$="C" OR x$="c" THEN DRAW "F5"

IF X$="Z" OR x$="z" THEN DRAW "G5"

IF X$="Q" OR x$="q" THEN DRAW "H5"

IF X$="F" OR x$="f" THEN DRAW "C0 U0 C1 BL5 U0"

IF X$="H" OR x$="h" THEN DRAW "C0 U0 C1 BR5 U0"

IF X$="B" OR x$="b" THEN DRAW "C0 U0 C1 BD5 U0"

IF X$="T" OR x$="t" THEN DRAW "C0 U0 C1 BU5 U0"

GOTO 200

500 END

'СОРТУВАHHЯ СЛIВ

'-------------------------------

CLS

LOCATE 10,25

INPUT "Кiлькiсть слів, що сортуються: ";N

DIM X$(N)

FOR I = 1 TO N

CLS

LOCATE 10, 20 : PRINT "Введiть ";i;" слово";

INPUT X$(I)

NEXT I

CLS

FOR I = 1 TO N - 1

FOR J = I + 1 TO N

IF X$(I) > X$(J) THEN SWAP X$(I), X$(J)

NEXT J, I

FOR I=1 TO N

LOCATE I+3,30

PRINT X$(I)

NEXT I

END

' IМIТАЦIЯ ОБЕРТАHHЯ РИСОЧКИ

'----------------------------------------------------

ON KEY (1) GOSUB 500

KEY (1) ON

CLS

50 LOCATE 12,40: PRINT "( )" : DELAY .1

LOCATE 12,40: PRINT "( / )" : DELAY .1

LOCATE 12,40: PRINT "( - )" : DELAY .1

LOCATE 12,40: PRINT "( )" : DELAY .1

GOTO 50

500 END

'ПОБУДОВА ДIАГРАМИ

'-----------------------------------

SUB GRAF(NX1,NY1,NX2,NY2,N,Y(1))

SCREEN 2

YMAX=Y(1): YMIN=Y(1)

FOR I = 1 TO N

IF Y(I) < YMIN THEN YMIN = Y(I)

IF Y(I) > YMAX THEN YMAX = Y(I)

NEXT I

DX1 = 8 : DX = FIX((NX2 - NX1 - (N - 1) * DX1) / N)

X1 = NX1

Y1 = NY2 - FIX(((-YMIN) * (NY2 - NY1)) / (YMAX - YMIN))

FOR I = 1 TO N

X2 = X1 + DX

Y2 = NY2 - FIX(((Y(I) - YMIN) * (NY2 - NY1)) / (YMAX - YMIN))

LINE (X1,Y1) - (X2,Y2),,BF

X1 = X2 + DX1

NEXT I

LINE (nx1,Y1) - (nx2,Y1)

END SUB

CLS

INPUT "ЗАДАЙТЕ КІЛЬКІСТЬ ВУЗЛІВ ГРАФІКА"; M

DIM Z(M)

FOR I = 1 TO M

INPUT Z(I)

NEXT I :

CLS

X1 = 80: X2 = 500

Y1 = 50: Y2 = 150

CALL GRAF(X1,Y1,X2,Y2,M,Z())

END

Основна таблиця


 
Загрузка...