Ðåôåðàò: Îáó÷àþùàÿ ïðîãðàììà Ãðàôèêà ïðîãðàììèðîâàíèþ â ãðàôè÷åñêîì ðåæèìå íà ÿçûêå turbo-pascal 7.x
readkey;
ClearDevice;
Randomize; {Âûáîð ÷åòûðåõ íîìåðîâ âîïðîñîâ}
For J:=0 to 3
do
begin
1:I:=Random(10);
If I=0 then
GOTO 1;
For K:=0 to
J-1 do
begin
If M[k]=I
then GOTO 1;
end;
M[J]:=I;
end;
M[1]:=1;
repeat
OKNO;
begin
Read(F32,At);
R1:=StrPas(At.P2);{Ïðåîáðàçîâàíèå ASCIIZ-ñòðîêè At.P2 â
ñòðîêó òèïà string}
Val(R1,Z1,Code); {Ïðåîáðàçîâàíèå ñèìâîëüíîãî ïðåäñòàâëåíèÿ
íîìåðà âîïðîñà â äâîè÷íóþ ôîðìó}
Y:=20;
If(Z1=M[0]) or
(Z1=M[1]) or (Z1=M[2]) or (Z1=M[3]) then
begin
repeat
S:=StrPas(At.P3); {Ïðåîáðàçîâàíèå ASCIIZ-ñòðîêè At.P3 â
ñòðîêó òèïà string}
OutTextXY(20,Y,S); {Âûâîä òåêñòà âîïðîñà}
case At.P1
of
'
':begin
end;
end;
Y:=Y+10;
Read(F32,At);
until
At.P1='*';
OutTextXY(50,330,'ÂÂÅÄÈÒÅ ÍÎÌÅÐ ÏÐÀÂÈËÜÍÎÃÎ ÎÒÂÅÒÀ ___');
2:CH:=ReadKey;
SetColor(4);
OutTextXY(320,325,CH);
SetColor(1);
readkey;
If(CH<>'1') and (CH<>'2') and (CH<>'3') and (CH<>'4')
then
begin
SetFillStyle(1,11);
Bar(318,320,327,340);
GoTo
2;
end
else
repeat
Read(F33,Atr);
R2:=StrPas(Atr.P2); {Ïðåîáðàçîâàíèå ASCIIZ-ñòðîêè Atr.P2 â
ñòðîêó òèïà string}
Val(R2,Z2,Code); {Ïðåîáðàçîâàíèå ñèìâîëüíîãî ïðåäñòàâëåíèÿ
íîìåðà âîïðîñà â äâîè÷íóþ ôîðìó}
If Z2=Z1
then
begin
repeat
If Atr.P3=CH
then
begin
Y:=100;
OKNO;
repeat
Stt:=StrPas(Atr.P4); {Ïðåîáðàçîâàíèå ASCIIZ-ñòðîêè Atr.P4 â
ñòðîêó òèïà string}
R5:=StrPas(Atr.P5); {Ïðåîáðàçîâàíèå ASCIIZ-ñòðîêè Atr.P5 â
ñòðîêó òèïà string}
Val(R5,Z5,Code); {Ïðåîáðàçîâàíèå ñèìâîëüíîãî ïðåäñòàâëåíèÿ
îöåíêè â äâîè÷íóþ ôîðìó}
REZ4:=Round((REZ4+Z5)/2); {Ôîðìèðîâàíèå îöåíêè }
OutTextXY(20,Y,Stt);
Y:=Y+10;
case
Atr.P1 of
'
':begin
end;
end;
Read(F33,Atr);
until
Atr.P3='*';
readkey;
GOTO
3;
end
else
Read(F33,Atr);
until
Atr.P1='*';
end
until
Atr.P1='0';
end
else
3:end;
until
At.P1='0';
Close(F32);
Close(F33);
CloseGraph;
end;
begin
end.
Unit
RAZDEL5;
interface
uses
Crt,Graph,Dos,Strings,MYBOOK;
type An =
record
P1:Char;
P2:array[0..69] of char;
end;
type
Ant=record {Òåêñò âîïðîñîâ}
P1:Char;
P2:array[0..1] of Char;
P3:array[0..69] of Char;
end;
type
Antr=record { Ñïðàâêè }
P1:Char;
P2:array[0..1] of Char;
P3:array[0..0] of Char;
P4:array[0..69] of Char;
P5:array[0..2] of Char;
end;
var F5: file
of An ;
A:An;
N,Y:integer;
St:string[68];
var F52:file
of Ant; { ïåðåìåííûå âîïðîñîâ}
At:Ant;
R1:string[2];
Z1:integer;
S:string[68];
V:char;
var F53:file
of Antr; {ïåðåìåííûå ñïðàâîê}
Atr:Antr;
R2:string[2]; {ïîëå Ant.P1-íîìåð âîïðîñà}
R3:string[1]; {ïîëå Ant.P2-íîìåð âàðèàíòà îòâåòà}
Stt:string[68];{ïîëå Ant.P3-òåêñò ñïðàâêè}
R4:string[2]; {ïîëå Ant.P4- îöåíêà}
Z2,Z3,Z4:integer;
CH:
Char; {íîìåð âàðèàíòà îòâåòà}
K,J,I:integer;
M:
array[0..3] of integer;
Nom:Longint;
Code:integer;
var
R5:string[1]; {ïåðåìåííûå âûâîäà ðåçóëüòàòîâ}
Z5:integer;
REZ5:Longint;
procedure
RAZDEL50;
implementation
procedure
RAZDEL50;
Label
0,1,2,3;
begin
REZ5:=0;
GraphRegim;
Assign(F5,'RAZTEX5.pas');
{SI-}
Reset(F5);
{SI+}
If IOResult
<> 0 then Writeln ('Íåò ôàéëà RAZTEX5.pas');
repeat
ClearDevice;
OKNO;
Y:=10;
For N:=0 to 31
do
begin
Read(F5,A);
St:=StrPas(A.P2);
case A.P1
of
'
':OutTextXY(20,Y*N+10,St);
'*':begin
SetColor(4);
OutTextXY(20,Y*N+10,St);
SetColor(1);
end;
'1':begin
SetColor(4);
Arc(500,150,0,278,30);
OutTextXY(490,140,'(X,Y)');
OutTextXY(500,150,'.');
SetColor(1);
end;
'2':begin
SetColor(4);
Circle(500,300,30);
OutTextXY(475,290,'(X,Y)');
OutTextXY(500,300,'.');
SetColor(1);
end;
'3':begin
SetBKColor(15);
SetColor(4);
Ellipse(500,100,0,278,50,25);
OutTextXY(490,90,'(X,Y)');
OutTextXY(500,100,'.');
SetColor(1);
end;
'4':
begin
SetColor(2);
Ellipse(500,180,10,270,50,30);
Line(500,135,460,225);
SetFillStyle(4,14);
FloodFill(455,180,2);
end;
'5':
begin
SetColor(4);
Ellipse(500,300,0,361,50,30);
FillEllipse(500,300,50,30);
SetFillStyle(1,15);
SetColor(1);
end;
'6':
begin
SetFillStyle(7,13);
PieSlice(500,120,0,120,50);
end;
'7':
begin
SetFillStyle(9,13);
Sector(500,200,0,270,50,30);
SetFillStyle(1,15);
end;
'8':begin
SetFillStyle(1,9);
Bar(250,100,600,200);
SetViewPort(250,100,600,200,true);
FloodFill(260,110, 1);
Randomize;
repeat
PutPixel(Random(GetMaxX),Random(GetMaxY),15);
Delay(15);
until
KeyPressed;
SetFillStyle(1,15);
SetViewPort(5,5,635,345,true);
end;
'9':
begin
Diogramma;
end;
'0':GoTo
0
end;
end;
0:readkey;
until
A.P1='0';
Close(F5);
Assign(F52,'Join.pas'); {ñâÿçü ñ ôàéëîì âîïðîñîâ}
{SI-}
Reset(F52);
{SI+}
If
IOResult<>0 then Writeln('Íåò ôàéëà Join.pas');
Assign(F53,'Iodin.pas');
{SI-}
Reset(F53);
{ñâÿçü ñ ôàéëîì ñïðàâîê}
{SI+}
If
IOResult<>0 then Writeln('Íåò ôàéëà Iodin.pas');
OKNO1; {"Êîíòðîëüíûå âîïðîñû"}
readkey;
ClearDevice;
Randomize; {Âûáîð ÷åòûðåõ íîìåðîâ âîïðîñîâ}
For J:=0 to 3
do
begin
1:I:=Random(6);
If I=0 then GOTO
1;
For K:=0 to
J-1 do
begin
If M[k]=I
then GOTO 1;
end;
M[J]:=I;
Ñòðàíèöû: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19
|