Title: ???????????????? ?? ????? Q BASIC
1???????????????? ?? ?????Q BASIC
- ??? ????????????????? ??????? ?????
- ????????? ??????? 11 ??????
- ??????? ????????
- ???????????? ????????? ?.?.
2????????.
- ????? ???????????? ????????? ? ????????
?????? ?????????, ?????????? ????????? ???????? ?
??? ?? ???????? ??? ?????. ????? ?? ????????
???????, ??????? ? ?????? ????????????????
??????????????? ??????, ?????????????? ????????
???????????, ???????? ?????????? ???? QBASI?.
3????
- ?????? ??????? ? ???????? ??????????
???????????????? ?? ????? QBasic. - ?? ?????????? ??????????????? ????????????
???????? ???????? ? ???????? ???????????????? ??
????? QBasic. - ???????? ??????????? ??????????????? ???????.
QBasic
4??????????
- ????????.
- ??? ?????? ????????.
- ?????? ? ??????? ??????????.
- ??????? ?????.
- ?????? ?????????.
- ??? ??????? ??????????? ?????.
- ?????????? ?????????.
- ?????????????? ???????.
- ?????????? ??????.
- ?????????.
- ?????.
- ???????.
5???????? ????????.
- ???? QBASIC ????? ??? ???????? ????? qbasic.exe
(195????????) ? qbasic.hl p(144?????????).????????
?? ????? ?????????????? ???? qbasic.ini (133
?????), ???????? ?? ??????? ???? ????, ? ???????
????????? ?????????. ???? qbasic.hlp ?????? ???
????????? ?????????? ?????????? ?? ????????
???????? ??????? ?????. - ??????? ????? QBASIC ???????? ??????? 250 ????.
- ???????? ?????? ????????? ?????, ???? ????? ???
????????? (INPUT, PRINT, GOTO) ? ???????????
?????????? ???????? ???????.
6?????? ?????? ? ??????.
- ?????? ? ?????? QBASIC ????? ??????? ? ????
??????? - ???????? ? ?????????????? ????????
- ?????????? ?????????? ? ????? ??????????????
???????????. - ??? ?????? ?????? ??????? ???????????????? ?????
? ????? QBASIC. ??????????????? ? MS DOS QBASIC
??????????? ?? ????????? ??????, ? ???????
????????? ????????? qbasic ? ?????????? ???????
Enter
7??? ??????????? ?????? ???????? ?????????
??????????
- ?????????? ?????? ? ??????? ?????? ?? ?????????
?? ??? ????? qbasic.???. - ?????? ??????? (????????????
???????? QBASI? ? ?????????? ?????? ????). - ?????? ??????? (?????????? ???????
?????? ? ??????????? ?????? ???? ??? ?????????
?????????). QBASI? ????? ??? ?????? ? ??????
???????? ?????????.
Enter
?sc
8??? ?????? ? ??????? ?????????? ??????????
?????????????
- ?????? ??????? (?????? ??????????
? ????? ???? ?? ?????? File ) - ?????? ??????? (???????????
??????????? ????) - ? ??????? ?????? ?? ????????? ?????????? ?????? ?
??????????? ???? ?? ????? Open - ?????? ??????? (???????????
?????????? ????) - ? ??????? ??????? ? ?????? ??
???????? ? ?????????? ?????? ?? ???????????????
????? ? ??????????????? ???? ?? ??? ????? ?
??????????? ?????????? - ?????? ??????? (?????????? ?????
? ???????? ?????????) - ?????? ??????? (???????????? ????
?????????).
Alt
Enter
Enter
Tab
Enter
F5
9???? ???? qbasic.??? ? ???? ? ??????????
????????? ? ????? ??????????,?? ????????? ?????
????????? ?????? ????????
- ? ??????? ?????? ?? ????????? ?????????? ??????
?? ??? ?????. e??. - ?????? ??????? ?, ?? ???????? ??,
?????? ??????? (? ?????????
?????? ?????????qbasic. exe) - ? ??????? ?????? ?? ????????? ?????????? ??????
?? ??? ????? ?????????. - ?????? ??????? ?, ?? ???????? ??,
?????? ??????? (? ?????????
?????? ????????????? ? ????????? qbasic.???"
????????? ??? ????? ?????????). - ?????? ??????? (??????????
????? ? ???????? ?????????). - ?????? ??????? (???????????? ????
????????? ?? ?????????? ??????????).
Ctrl
Enter
Ctrl
Enter
Enter
F5
10?????????? ??????? ????? QBASI?
??????? ?? QBASI? ?? ???????? ??????? ?? ??????? ?????
INPUT ??????????? ???????? ?????????? ????
PRINT ??????? ?? ????? ???????? ?????????? ?????
END ??????????? ?????????? ????????? ?????
REM ????????? ? ????????? ?????????
CLS ??????? ????? ?? ??????? ????????
11?????? ?????????.
- ??? ??????? ? ??????????? ?????????? ??????????
?????????? ???????. ????? ???? ??? ?????????
????????? ?????? ? ??????, ??????? ???????
(???? ?????????). ?? ?????? ??????? ????????
?????????????? ????. - ? ??????? ???? ???????? ???????? 1-??
??????????. ???? ??? ???????? ?????????? ??????,
?? ?????? ??????? ?? ?????? ????????? ?????. - ??????? ???????, ??????????
?????? ?????????. - ?? ?????? ????? ???????? ?????????????? ????,
??????? ???????? ??????? ?????????? ? ???????
??????? - ?? ?????? ???????? ?????, ??????? ?????????????
??????? ?, ?? ???? ???????? ?????.
F5
Enter
Enter
12???????? ????????? ?????????? ????? ???? ?????.
- ????? ?????? ?????????.
- ???? ???????? ??????? ??????????
- ???? ???????? ??????? ??????????
- ???????? ?????????? ?????
- ????? ?????????? ?? ?????
- ????? ?????????
- START
- INPUT A
- INPUT B
- C A B
- PRINT C
- ?ND
13???????? ??????.
- ??????????, ??????? ????? ????? ????? ??????
?????????, ????? ????????? ????????, ???????
??????? ???? ?? ??????, ???????? ?? ? ?????
?????? ????????? ? ????? ???????? ?????. ?
?????????????? ????????? ????????? ????? ????
???????? ??????? ?????? ?????
START INPUT A INPUT B C A B PRINT C ?ND
- ????????? ????? ???? ??? ????? ???????? ?? ????
????????????? ?????? ?????? ?????? ????? ??????
?????????, ? ????? ?????????? ???????? ???????? ?
?????????? PRINT ????? ?????? ?????? ????????? ??
????????. - 10 INPUT A INPUT B PRINT AB END
- ???? ???????? PRINT ???????? ?? ????????
LPRINT,?? ????????? ?????????? ????? ??????????
?? ???????.
14???????? ?????????.
- ??? ?????? ?? ????? QBASIC ??????????
- 1. ?????? ??????? (?????????? ???????
?????? File) - 2. ?????? ??????? (???????????
???????? ????) - 3. ? ??????? ?????? ?? ????????? ???????? ?????
??it (?????) - 4. ?????? ??????? (??????????????
????? ? ??????????, ? ??????? ??????? ????
qbasic.???).
Alt
Enter
Enter
15 ?????????? ?????????.
- ??? ?????????? ????????? ???? ?????????
- ???????? ???????? ??????? File
??????? ??????? - ? ????, ??????? ??????? Save ??? Save as
- ??????? ? ??????? ?????? ?? ?????????
??????????????? ??????? ???? - ??????? ??????? . ?
?????????? ?? ?????? ??????? ???????? ??????????
???? ? ???????????? ????? ????? ????? ?????????.
??? ????????? ?????? ???? ??????? ??????????
??????? ? ?? ?????? ????????? ????? 8 ??????.
??????????? ????????????? ? ????? ????????? ????
? ????????? ??????? - ????? ?????? ????? ????? ????????? ? ???????
??????? ????? ?????? ??????????????? ????
? ????????????? ??????????? ??????????? ??S,
?????????? ?? ????? ????? ?????? ? ????????????
??, ??? ?????? ????????? ??????????? ?? ?????
BASIC. ???? ????? ????? ?? ? ????????
-
???? ???????? ??????? New ?
??????? ??????? ,?? ?????
??????? ????????? ? ?? ??????? ?????????? ?
???????? ????????? ?????????.
Alt
Enter
Enter
Enter
Enter
16?????????????? ??????? ????? QBASI?
- SQR(?)-?????????? ??????????? ????? ?? ?????.(???
????????? ?? ????????? ????? ????????????? ?????.
??? ????? ?????????????? ????? ??? ?????????
????????? ?? ??????.) - ?????? 10 INPUT A BSQR(A) PRINT B
- ABS(?)-??????????? ??????????? ????????(??????)
?????. - SGN(?)-??????? ??????????? ????? ?????(???
????????????? ?????? ?????????? -1. ???
????????????? 1, ? ??? ???? ?????????? 0 - INT(?)-??????????? ??????????? ?????? ????????
??? ??????? ????????? ?????????.
17?????????????? ??????? ????? QBASI?
- CINT(?)- ?????????? ?????.
- FIX(?)- ??????????? ????? ????? ?????.
- EXP(?)-??????????? ?????????? ?????.
- LOG(?)-??????????? ???????????? ????????? ?????.
- SIN(?)- ??????????? ???????? ?????? ????????? ?
???????? ????. - COS(?)-??????????? ???????? ???????? ????????? ?
???????? ????. - TAN(?)- ??????????? ???????? ???????? ????????? ?
???????? ????. - ATAN(?)- ??????????? ???????? ???? ( ? ????????)
?? ????????? ???????? ????????.
18??????.
- ????????? ??????? ???????????? ?? ????????? ?
??????.
INPUT A,H S1/2AH PRINT S
19????? ????????? ???? ??????? ??
?????????????????? ?? ?????? ?????, ?? ? ??????
????? ????????????. ?? ?????? ???????? ??????????
??????.
INPUT ??????? ????? ????????? ? ??????
????????????A,H S1/2AH PRINT ???????
???????????? ?????S END
20????????? ? ????? QBasic.
?????? ????? ?????????
- ???? (???????)
- ?? ????? ?????? 1
- ????? ????? ?????? 2
- ???
IF (???????) THEN ????? ??????1 ELSE ????? ??????2
21??????.
- ????? ?? ???? ????? ??????????.
REM ?????????? ??????????? INPUT ??????? ???
?????A,B IF AltB THEN CA ELSE C B PRINT
?????????? ????? ????? C END
22???????? ????? ?????????
- ???? (???????)
- ?? ????? ?????? 1
- ???
IF (???????) THEN ????? ??????1
23??????.
- ??????? ?? ????? ?????, ???? ??? ?????? 0.
REM ?????????? ?????????????? ????? INPUT
??????? ?????A IF Alt0 THEN PRINT
????????????? ????? ????? A END
24????? ? ????? QBasic.
???? ? ????????
- ???? (???????)
- ?????? ????? ??????
- ??
IF (???????) THEN ????? ?????? GOTO n
25??????.
- ????? ????? ??????????? ????? ,??????? 9, ??
??????? 34.
REM ????? ????? CLS A9 S0 1 AA1 IF Alt33
THEN SSA GOTO 1 PRINT ????? ????? ?? 10 ?? 33
????? S
26???? ?? ?????????
- ??? i ?? 1 ?? n c ????? m
- ????? ??????
- ????? ?????
FOR i1 TO n STEP m ????? ?????? NEXT i
27??????.
- ????? ????? ????????????? ????? ?? -23 ?? -1.
REM ????? CLS S0 FOR i-23 TO -1 STEP
1 SIS NEXT i
28???????? ???????.
- ???????? ??????? ???????????? ????? ????????
?????????? ? ??????????? ??????? ??? ????????,
????????, ????????? ? ?????????? ?????????????
??????????? ?????????? ? ??????? ??. ????? ?
????? ??????? ??????? ?????????? ??? ????????????
????. ?? ??? ????? ????? ????? ??????????
??????????? ?????????.
29??????? ????????? ??????.
- ????? ?? ????? ????????????? ??? ?????????????,
??????????? ??????? ?????????. ?????? ?????
??????? ?? ?????????? ??????. ??????? ???
?????????? ???????, ??????? ????? ??????????
??????? ? ?????? ??????????? ??????. - ? ??????? ??????? ??????? ?????????.
??????? ?????? ????? ??????????? ?? ????????????
??? ??, ????? ??????? ?? ??? ??. ????? ???????,
??????? ????? ????? ?????? ???????? ???????
??????? ?????????, ?.?. ?????? ? ????????????
(0,0). ?????????? ?????? ?????? ????? (?, ?)
??????? ?? ?????????? ??????.
30???????? SCREEN.
- ? ??????? ?? ????????? ???????????? ?????????
?????. ??? ???????? ? ??????????? ????? ????
???????????? ???????? SCREEN ? ???????????????
??????????. ? ??????????? ?? ???????? ?????
????????? ???????? ?????????? ?????? (??????????
????? ?? ??????????? ? ?????????) ?,
??????????????, ?????????? ? ? ? ???, ???? ???
??????? SCREEN9 640?350 ????? ??? ??????
SCREEN 12 - 640?480 ????? . ???????? SCREEN ?
?????????? 0 ?????????? ??????? ? ??????????
?????? ??????.
31 ??????????? ????? ????????? QBASIC.
- ??? ?????? ? ??????????? ?????? ???? ?????
??????????? ?? ????????? ????? ???????.
????????? ??????? ???????? ????? ???????????? X
? Y. ?????????? X ????????????? ????? ???????, ?
?????????? Y ?????? ????. ?????????? ????????
?? ?????? ??????? ?? ???? ???????????? ???????? ?
??? ????????????????? ???????? VGA ???
??????SCREEN 12 ?????????? 640 ? 480 ?????.
32??????? ? ????? QBasic.
- ???????? COLOR ????????? ?????? ????????? ??
????? ??????????. ? ?????? SCREEN 12 ???????
????? ????????????? ????? ?? 0 ?? 15.
0-?????? 4-??????? 8-????? 12-???????
1-????? 5-????????? 9-??????-????? 13-??????-?????????
2-??????? 6-?????????? 10-??????-??????? 14-??????
3-??????? 7-????? 11-??????-??????? 15-????-?????
33??????.
REM ?????????? ??????????? SCREEN 12 COLOR
9 INPUT ??????? ??? ?????A,B IF AltB THEN CA
ELSE C B COLOR 2 PRINT ?????????? ????? ?????
C END
??????? ?? ????? ????? ???????? ?
?????. ??????? ??? ????? ?????????? ?????
?????
34????????? ???????????? ?????? ????? QBASIC .
- PCLS-??????? ????? ??? ????.
- PSET (X,Y),C- ??????? ?? ????? ?????, ,C-????
???? ????? - PRSET(X,Y),C-??????? ?????.
35???????? LINE.
- LINE (X1, Y1)-(X2, Y2) - ?????? ??????? ?? ?????
X1, Y1 ?? ????? X2,Y2. - LINE (X1,Y1)-(X2,Y2),n,B-?????? ??????
??????????????, ????????? ???????? ????. X1, Y1
?????????? ?????? ???????? ???? ??????????????,
X2, Y2 ?????????? ??????? ??????? ????
?????????????? n-???? ??????? ??????????????. - LINE (X1,Y1)-(X2,Y2),n,BF-?????? ?????????????,
??????????? ??????? ?????? .X1, Y1, X2, Y2
?????????? ?????? ???????? ? ??????? ???????
????? ?????????????? n-???? ??????????????. - STYLE ???????? ??? ??????????? ????????? ?????
(?????? ??? ??????????????
36???????? CIRCLE.
- CIRCLE(X, Y),R,C - ?????? ???????? ??????
?????????? ??????? R c ??????? ? ????? (X,Y),?-
???? ??????????. - CIRCLE (X, Y) ),R,C,,, ? - ?????? ?????? ????????
?????? X, Y ?????????? ?????? ???????
?-??????????? ?????? ?????????? ?? ??? ??(????
?lt1, ?? ?????????? ????????????? ???? ? 1 ,??
?????????? ?????????,C-???? ???????. - CIRCLE (X,Y),R,C,U1,U2 -?????? ???? ??????????
??????? ??????. X, Y ?????????? ?????? ????, U1
???? ?? ????????? ????? ????, ?????????????
?????? ??????? ??????? ?? ?????????????? ???,
???????????? ????? ???????, U2 ???? ?? ????????
????? ????, ????????????? ??? ??, ??? U1,????????
? ????????, R ?????? ????,C-???? ????. - PAINT (X,Y),N -??????????? ????? ????????????
??????????? (X,Y)-???????? ?????????? ?????,
????????? ?????? ?????? ???????. N-????, ???????
????? ????????????? ???????. ?? ?????? ?????????
? ?????? ??????? ???????.
37??????? ????????? DRAW. DRAW (?????? ??????)
??? ????????? ?????????, ?????????? ???? ???
????????? ??????, ???????? ??????????? ???????
- Un ????? ?? n ?????
- Dn ???? ?? n ?????
- Rn ?????? ?? n ?????
- Ln ????? ?? n ?????
- ?n ?????? ????? ?? n ?????
- Fn ?????? ???? ?? n ?????
- Gn ????? ???? ?? n ?????
- ?n ????? ????? ?? n ?????
- ??,? ? ????? ? ???????????? (?. ?),
- ? ?????????????? ????????, ???????????, ???
??????????? ??????? ?? ?????? ??????????????
?????????? ?????, - ?n ???????? ????? ??? ????????? ?????
38???????
- ?????????? ? ??????????? ??????
- QBASIC
- ???????
- ?????????????
- ??????????? ?????????????
- ??????????? ??????????
- ??????(?1 lt1,?2 gt 1 )
- ???? (U1/3,U2/2)
- ??????????? ??????????.
- ???? ? ??????? ????????? DRAW
-
39???????
- REM 1 SCREEN 12 COLOR 2LINE (30, 400)-(30,
220) - REM 2 SCREEN 12 LINE (50, 400)-(150, 220),1,B
- REM 3 SCREEN 12 LINE (80, 400)-(180, 220),4,BF
- REM 4 SCREEN 12 CIRCLE(460,200),75,11
- REM 5 SCREEN 12 CIRCLE(300,200),105,5,,, 2/3
CIRCLE(300,200),105,15,,, 3/2 - REM 6 SCREEN 12 CIRCLE(200, 350),
250,14,3.14/3,3.14/2 - REM 7 SCREEN 12 CIRCLE(300,200),75,12 PAINT
(300,200),12 - SCREEN 12
- DRAW C2 BM250,50 F 40 L 20 F 60 L 30 F
80 L 110 D 40 L 40 U 40 L 110 E 80 L30 E 60 L
20 E 40
40?????? .
- ?????????? ???????? ??????, ???, ????????, ?????
- ?????? ?????????
- CIRCLE(460,200),25,11
- PAINT (460,200),11
- CIRCLE(460,275),50,11
- PAINT (460,275),11
- CIRCLE (450,195),3,8
- PAINT (450,195),8
- CIRCLE(470,195),3,8
- PAINT (470,195),8
- CIRCLE(460,210),8,5,3.14,23.14 ?????? ???
????????? - ?????? ?????
- CIRCLE(550,35),45,14,33.14/2,3.14/2
- CIRCLE(565,41.3),41.5,14,53.14/3.75,3.14/2
- PAINT (597,37),14
- REM RIS
- SCREEN 12
- ?????? ??????
- LINE(30,400)-(90,220),6,BF
- CIRCLE (60,150),90,2,,,3/2
- PAINT (60,150),2
- ?????? ?????
- LINE(250,150)-(350,150), 8,
- LINE (150,150)-(250,15),8
- LINE(350,150)-(150,150),8
- PAINT(250,20),8
- ?????? ???
- LINE(170,150)-(330,300),4,BF
- LINE (230,175)-(270,220),15,BF
- LINE(250,185)-(230,185),9
- LINE(250,175)-(250,220),9
- ?????? ?????
- LINE(200,35)-(200,83),12
- LINE(30,35)-(220,35),12
41?????? .
- ?????????? ???????? ???????.
- REM TARELKA
- SCREEN12
- CIRCLE (150,150),65,5,0,3.14
- CIRCLE (150,170),105,14,,,2/8
- PAINT (150,170),14
- CIRCLE (150,170),10,1
- PAINT (150,170),1
- CIRCLE (100,170),10,1
- PAINT (100,170),1
- CIRCLE (200,170),10,1
- PAINT (200,170),1
- DRAW C6 BM100,193 F45
- BM100,193 G 45 BM200,193
- F 45 BM200,193 G 45
8,9
10,11
3
6,7
5
4
12
42??????????.
- ?.?.????? ???????????????? ?? ????? QBasic.
???????????? ??????????? ??? ??????????., ?????,
1998 ? - ?.?.???????? ????????? ?????. ????????????
?????? ???????????,?20 2005 ?, ???.11 - 1.???????? ?.?. ???????? ???????? ???????
???????????????? ?? ?????? ???????????, ??????
???????????, ?17, 2005 ?, ? 22 - 2.???? ?.?. ???????????.??????? ??????? ??? 10-11
??????? ??????????????????? ??????????. ?.169. - 3. ????? ?.?.? ??.?????? ??????????? ?
?????????????? ???????. ?.???????????, 1998, 207
?