program segitigawarna;
uses crt;
procedure
proces;
var x, y, i,
j, n, direction : byte;
begin
Randomize;
x:=
40; y := 12; direction := 1;
for
i := 1 to 15 do
begin
for
j := 1 to i do
begin
repeat
n
:= random(100);
until
n in [1..15];
TextColor(n);
GotoXY(x,y); write('*');
delay(15);
Case
direction of
1
: begin
dec(y); inc(x);
end;
end;
2
: begin
inc(y);
inc(x);
end;
end;
end;
inc
(direction);
if
direction = 4 then direction := 1;
end;
end;
begin
ClrScr;
repeat
proces;
until
KeyPressed;
end.
Berikut merupakan hasilnya .
semoga dapat bermanfaat
Tidak ada komentar:
Posting Komentar