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
000 | 001 | 002 | 003 | 004 | 005 | 006 | 007 | 008 | 009 | 010 | 011 | 012 | 013 | 014 | 015 |
016 > | 017 < | 018 c | 019 !! | 020 | 021 | 022 - | 023 c | 024 | 025 | 026 | 027 | 028 | 029 | 030 | 031 |
032 | 033 ! | 034 " | 035 # | 036 $ | 037 % | 038 & | 039 ' | 040 ( | 041 ) | 042 | 043 + | 044 , | 045 | 046 . | 047 / |
048 0 | 049 1 | 050 2 | 051 3 | 052 4 | 053 5 | 054 6 | 055 7 | 056 8 | 057 9 | 058 : | 059 ; | 060 < | 061 = | 062 > | 063 ? |
064 @ | 065 A | 066 B | 067 C | 068 D | 069 E | 070 F | 071 G | 072 H | 073 I | 074 J | 075 K | 076 L | 077 M | 078 N | 079 O |
080 P | 081 Q | 082 R | 083 S | 084 T | 085 U | 086 V | 087 W | 088 X | 089 Y | 090 Z | 091 [ | 092 \ | 093 ] | 094 ^ | 095 _ |
096 ` | 097 a | 098 b | 099 c | 100 d | 101 e | 102 f | 103 g | 104 h | 105 i | 106 j | 107 k | 108 l | 109 m | 110 n | 111 o |
112 p | 113 q | 114 r | 115 s | 116 t | 117 u | 118 v | 119 w | 120 x | 121 y | 122 z | 123 { | 124 : | 125 } | 126 ~ | 127 |
Розширена таблиця ASCII (альтернативне кодування)
128 А | 129 Б | 130 В | 131 Г | 132 Д | 133 Е | 134 Ж | 135 З | 136 И | 137 Й | 138 К | 139 Л | 140 М | 141 Н | 142 О | 143 П |
144 Р | 145 С | 146 Т | 147 У | 148 Ф | 149 Х | 150 Ц | 151 Ч | 152 Ш | 153 Щ | 154 | 155 | 156 Ь | 157 | 158 Ю | 159 Я |
160 а | 161 б | 162 в | 163 г | 164 д | 165 е | 166 ж | 167 з | 168 и | 169 й | 170 к | 171 л | 172 м | 173 н | 174 о | 175 п |
176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 |
192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 |
208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 |
224 р | 225 с | 226 т | 227 у | 228 ф | 229 х | 230 ц | 231 ч | 232 ш | 233 щ | 234 | 235 | 236 ь | 237 | 238 ю | 239 я |
240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 |