1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
| program expression;
uses crt, graph;
var
f, b, Pos : Integer;
pilotgraphiq, modegraphiq : Smallint;
x : string[50];
let : shortstring;
procedure lettreA(i, j : Integer; Color : Word; var Position : Integer);
var
k, h : Integer;
begin
setcolor(Color);
setfillstyle(1,Color);
setbkcolor(black);
h := j;
for k := 1 to 7 do
begin
pieslice(i, j + 14,0,360,3);
j := j + 7;
end;
j := h;
pieslice(i + 7,j + 7,0,360,3);
pieslice(i + 14,j, 0,360,3);
pieslice(i + 21,j + 7,0,360,3);
i := i + 28;
Position := i;
for k := 1 to 7 do
begin
pieslice(i, j + 14,0,360,3);
j := j + 7;
end;
j := h + 28;
for k := 1 to 4 do
begin
pieslice(i, j, 0,360,3);
i := i - 7;
end;
Readln;
end;
procedure lettreB(i, j : Integer; Color : Word; var Position : Integer);
var
l, h, k : Integer;
begin
setbkcolor(black);
setcolor(Color);
setfillstyle(1,Color);
h := j;
l := i;
for k := 1 to 9 do
begin
pieslice(i, j, 0,360,3);
j := j + 7;
end;
j := h;
for k := 1 to 3 do
begin
i := i + 7;
pieslice(i, j, 0,360,3);
end;
i := i + 7;
Position := i;
for k := 1 to 3 do
begin
j := j + 7;
pieslice(i, j, 0,360,3);
end;
for k := 1 to 3 do
begin
i := i - 7;
pieslice(i, j + 7, 0,360,3);
end;
i := l + 4 * 7;
j := j + 14;
for k := 1 to 3 do
begin
pieslice(i, j, 0,360,3);
j := j + 7;
end;
for k := 1 to 3 do
begin
i := i - 7;
pieslice(i, j, 0,360,3);
end;
Readln;
end;
begin
Write ('entrez votre expression');
Read(x);
f := 400;
pilotgraphiq := detect;
initgraph(pilotgraphiq, modegraphiq, 'C:\Program Files\TP\BGI\');
if graphresult = 0 then
begin
setgraphmode(modegraphiq);
for b := 1 to Length(x) do;
begin
let := Copy(x, b, 1);
if let = 'A' then
begin
Pos := f;
lettreA(f, 400,red, f);
delay(10);
lettreA(Pos, 400,black, f);
lettreA(Pos - 1,400,red, f);
end;
if let = 'B' then
begin
Pos := f;
lettreB(f, 400,red, f);
delay(10);
lettreB(Pos, 400,black, f);
lettreB(Pos - 1,400,red, f);
end;
end;
f := f - 1;
Readln;
Readln;
closegraph;
end;
Readln;
Readln;
end. |