|
Обучающая программа Графика программированию в графическом режиме на языке turbo-pascal 7.x
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); {Преобразование символьного
представления оценки в двоичную форму}
REZ3:=Round((REZ3+Z5)/2); {Формирование оценки}
OutTextXY(20,Y,Stt); {Вывод текста справки}
Y:=Y+10;
case Atr.P1 of {иллюстрации к тексту справок}
'1':begin
Line(380,150,550,190);
MoveRel(380,190);
Line(380,190,550,190);
LineTo(550,190);
OutTextXY(555,190,'(X1,Y1)');
OutTextXY(370,140,'(X,Y)');
OutTextXY(390,200,'(X,Y+dY)');
end;
'2':begin
GOTOXY(100,190);
LineTo(100,190);
LineRel(30,40);
LineRel(0,80);
end;
'3':begin
GOTOXY(100,190);
LineTo(380,150);
LineRel(30,40);
LineRel(0,80);
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 RAZDEL4;
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 F4: file of An ; {Переменные теории}
A:An;
N,Y:integer;
St:string[68];
var F32:file of Ant; { Переменные вопросов}
At:Ant;
R1:string[2];
Z1:integer;
S:string[68];
var F33:file of Antr; {Переменные справок}
Atr:Antr;
R2:string[2];
R3:string[1];
Stt:string[68];
R4:string[2];
Z2,Z3,Z4:integer;
CH: Char;{Переменная для принятия символа с клвиатуры}
K,J,I:integer; {Переменные циклов}
M: array[0..3] of integer; {Массив для хранения черырех
выбранных номеров вопросов}
Code:integer;
var R5:string[1]; {переменные вывода результатов}
Z5:integer;
REZ4:Longint; {переменная оценки}
procedure RAZDEL40;
implementation
procedure RAZDEL40;
Label 0,1,2,3;
begin
REZ4:=6;
GraphRegim;
Assign(F4,'RAZTEX4.pas'); {Связь с файлом текста теории}
{SI-}
Reset(F4);
{SI+}
If IOResult <> 0 then Writeln ('Нет файла RAZTEX4.pas');
repeat
ClearDevice;
OKNO;
Y:=10;
For N:=0 to 31 do {Вывод текста теории}
begin
Read(F4,A);
St:=StrPas(A.P2); {Преобразование ASCIIZ-строки A.P2 в строку
типа string}
OutTextXY(20,Y*N+10,St);
case A.P1 of
'*':begin
SetColor(4);
OutTextXY(20,Y*N+10,St);
SetColor(1);
end;
'1':begin SetFillStyle(1,15);
Bar(350,45,600,340);
SetFillStyle(1,0);
Bar(350,45,600,65);
SetFillStyle(1,1);
Bar(350,65,600,85);
SetFillStyle(1,2);
Bar(350,85,600,105);
SetFillStyle(1,3);
Bar(350,105,600,120);
SetFillStyle(1,4);
Bar(350,120,600,135);
SetFillStyle(1,5);
Bar(350,135,600,150);
SetFillStyle(1,6);
Bar(350,150,600,165);
SetFillStyle(1,7);
Bar(350,165,600,185);
SetFillStyle(1,8);
Bar(350,185,600,200);
SetFillStyle(1,9);
Bar(350,200,600,215);
SetFillStyle(1,10);
Bar(350,215,600,235);
SetFillStyle(1,11);
Bar(350,235,600,255);
SetFillStyle(1,12);
Bar(350,255,600,275);
SetFillStyle(1,13);
Bar(350,275,600,295);
SetFillStyle(1,14);
Bar(350,295,600,315);
SetFillStyle(1,15);
Bar(350,315,600,340);
end;
'2':begin
SetBKColor(15);
SetFillStyle(1,15);
Bar(200,100,600,300);
SetFillStyle(2,2);
Bar(200,100,600,120);
SetFillStyle(3,2);
Bar(200,120,600,145);
SetFillStyle(4,2);
Bar(200,145,600,168);
SetFillStyle(5,2);
Bar(200,168,600,190);
SetFillStyle(6,2);
Bar(200,190,600,210);
SetFillStyle(7,2);
Bar(200,210,600,228);
SetFillStyle(8,2);
Bar(200,228,600,246);
SetFillStyle(9,2);
Bar(200,246,600,264);
SetFillStyle(10,2);
Bar(200,264,600,282);
SetFillStyle(11,2);
Bar(200,282,600,300);
SetFillStyle(1,0);
end;
'0':GoTo 0
end;
end;
readkey;
0:until A.P1='0' ;
readkey;
Close(F4);
Assign(F32,'Joi.pas'); {связь с файлом вопросов}
{SI-}
Reset(F32);
{SI+}
If IOResult<>0 then Writeln('Нет файла Joi.pas');
Assign(F33,'Iodi.pas');
{SI-}
Reset(F33); {связь с файлом справок}
{SI+}
If IOResult<>0 then Writeln('Нет файла Iodi.pas');
OKNO1; {"Контрольные вопросы"}
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;
end;
repeat
OKNO;
begin
Read(F52,At); { вывод текста вопросов и справок }
R1:=StrPas(At.P2);
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);
OutTextXY(20,Y,S);
case At.P1 of
'2':begin
end
end;
Y:=Y+10;
Read(F52,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(F53,Atr);
R2:=StrPas(Atr.P2);
Val(R2,Z2,Code);
If Z2=Z1 then
begin
repeat
If Atr.P3=CH then
begin
Y:=100;
OKNO;
repeat
Stt:=StrPas(Atr.P4);
R5:=StrPas(Atr.P5); {формирование оценки}
Val(R5,Z5,Code);
REZ5:=Round((REZ5+Z5)/2);
OutTextXY(20,Y,Stt);
Y:=Y+10;
case Atr.P1 of
'1':begin
end;
'0':GoTo 3;
end;
Read(F53,Atr);
until Atr.P3='*';
readkey;
GOTO 3;
end
else Read(F53,Atr);
until Atr.P1='*';
end
until Atr.P1='0';
end
else
3: end;
until At.P1='0';
Close(F52);
Close(F53);
CloseGraph;
end;
begin
end.
Unit RAZDEL6;
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 F6: file of An ; {Переменные теории}
A:An;
Y,N,T1,T2,T3,T4:integer;
Страницы: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14
|
Приглашения
09.12.2013 - 16.12.2013
09.12.2013 - 16.12.2013
|