here is the code:
program nazi;
uses crt;
label
begining,start;
procedure create;
begin
textcolor(red);
writeln('********************************************************************************');
textcolor(black);
writeln('-------------------------[HELLO-CODE.blogspot.com]------------------------------');
textcolor(red);
writeln('********************************************************************************');
end;
procedure plus(var de:integer);
begin
de:=de+1;
end;
var
a,b,c,d,e:integer;
begin
textbackground(white);
clrscr;
begining:
clrscr;
create;
d:=0;
textcolor(white);
writeln;writeln;writeln;writeln;writeln;writeln;
write(' Put a number beetween ');textcolor(yellow);write('3');textcolor(white);write(' and ');textcolor(yellow);write('25');textcolor(white);write(' = ');readln(a);
if (a>2) and (a<26) then
begin
goto start;
end
else
begin
clrscr;
create;
writeln;writeln;writeln;writeln;writeln;writeln;
textcolor(white);
write(' !!!!!!!!!!!!!!!!');textcolor(red);write(' 3 ');textcolor(white);write('till ');textcolor(red);write('25');textcolor(white);write(' only !!!!!!!!!!!!!!!');
readkey;
clrscr;
goto begining;
end;
start:
clrscr;
create;
gotoxy(32,10+d);
for b:=1 to (a+(a-1)) do
begin
textcolor(green);
for c:= 1 to (a+(a-1)) do
begin
if (b<((a+(a-1)-(a-1)))) and (c=1) then
begin
write('*');
end
else if (b=a) then
write('*')
else if(c=a) then
write('*')
else if (c>a) and (b=1) then
write('*')
else if (b>a) and (c=a+(a-1)) then
write('*')
else if (b=a+a-1) and (c<a+1) then
write('*')
else
write(' ');
end;
plus(d);
gotoxy(32,10+d);
end;
readkey;
goto begining;
end.
0 komentar:
Posting Komentar