Ketik Yang Anda Cari...

Wednesday 5 February 2014

Coding lambang Nazi pada pascal




Langsung aja ne dia coding lambang Nazi pada pascal

HARAP JANGAN DI SALAH GUNAKAN

here is the code:
program nazi;
uses crt;
label
awal,mulai;
procedure create;
          begin
          textcolor(red);
          writeln('********************************************************************************');
          textcolor(black);
          writeln('---------------------------NAZI KDP6 ILHAM RIFKY--------------------------------');
          textcolor(red);
          writeln('********************************************************************************');
          end;
procedure tambah(var de:integer);
          begin
          de:=de+1;
          end;

var
a,b,c,d,e:integer;

begin
textbackground(white);
clrscr;
awal:
clrscr;
create;
d:=0;

textcolor(white);
writeln;writeln;writeln;writeln;writeln;writeln;
write('                     Masukkan angka antara ');textcolor(yellow);write('3');textcolor(white);write(' sampai ');textcolor(yellow);write('25');textcolor(white);write(' = ');readln(a);
if (a>2) and (a<26) then
     begin
     goto mulai;
     end
     else
     begin
     clrscr;
     create;
     writeln;writeln;writeln;writeln;writeln;writeln;
     textcolor(white);
     write('               !!!!!!!!!!!!!!!!');textcolor(red);write(' 3 ');textcolor(white);write('sampai ');textcolor(red);write('25');textcolor(white);write(' only !!!!!!!!!!!!!!!');
     readkey;
     clrscr;
     goto awal;
     end;

mulai:
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;
     tambah(d);
     gotoxy(32,10+d);
     end;
readkey;
goto awal;
end.

Gimana manteb wkwkwk ?

Ditulis Oleh : Ilham Rifky // 01:33
Kategori:

0 komentar:

Post a Comment