Код программы
- Код: Выделить всё
uses Graph,Crt;
var gd,gm:integer;
begin
ClrScr;
gd:=detect;
initGraph(gd,gm,'');
if graphresult <> grok then halt(1);
setcolor (random(15));
bar (40,40,50,60);
readln;
closeGraph;
end.
В чем дело?
Модератор: Модераторы
uses Graph,Crt;
var gd,gm:integer;
begin
ClrScr;
gd:=detect;
initGraph(gd,gm,'');
if graphresult <> grok then halt(1);
setcolor (random(15));
bar (40,40,50,60);
readln;
closeGraph;
end.
Var
...
grResult: Integer;
...
Begin
...
grResult:=GraphResult;
If grResult<>grOk Then
Begin
WriteLn('Ошибка - ', GraphErrorMsg(grResult));
ReadLn;
Halt(1);
End;
End.
gd:=detect;
...
setcolor (random(15));
...
uses Graph,Crt;
var
gd,gm: smallint;
begin
Randomize;
ClrScr;
gd:=D4bit;
gm:=m800x600;
initGraph(gd,gm,'');
if graphresult <> grok then halt(1);
setcolor (random(15));
bar (40,40,500,400);
readln;
closeGraph;
end.
uses Graph, Windows;
var
gd,gm: smallint;
i: Integer;
s: ShortString;
begin
gd:=D4bit;
gm:=m800x600;
initGraph(gd,gm,'');
if graphresult <> grok then halt(1);
For i:=15 DownTo 0 Do
Begin
SetFillStyle(SolidFill, i);
MoveTo(700, 20);
Str(i, s);
OutText('Color N '+s);
bar(40,40,500,400);
Sleep(750);
ClearDevice;
Sleep(100);
End;
closeGraph;
end.
Вернуться в Free Pascal Compiler
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 1