- Back to Home »
- FREE PASCAL menggunakan gotoxy(x,y);
Posted by : Unknown
Jumat, 22 November 2013
uses crt;
var i,j,deret,jumlah:integer;
var user,pass:String;
procedure animasi1;
begin
for i:=1 to 25 do
begin
// Baris 1
gotoxy(25+i,8);
delay(100);
textcolor(i);
write(chr(178));
end;
for i:=1 to 25 do
begin
// Baris 2
gotoxy(25+i,13);
delay(100);
textcolor(i);
write(chr(178));
end;
delay(100);textcolor(4); gotoxy(25,9);write('|');
delay(100);textcolor(5); gotoxy(25,10);write('|');
delay(100);textcolor(6); gotoxy(25,11);write('|');
delay(100);textcolor(7); gotoxy(25,12);write('|');
delay(100);textcolor(4); gotoxy(51,9);write('|');
delay(100);textcolor(5); gotoxy(51,10);write('|');
delay(100);textcolor(6); gotoxy(51,11);write('|');
delay(100);textcolor(7); gotoxy(51,12);write('|');
end;
procedure animasi2;
begin
for i:=1 to 25 do
begin
// Baris 1
gotoxy(25+i,8);
textcolor(i);
write(chr(178));
end;
for i:=1 to 25 do
begin
// Baris 2
gotoxy(25+i,13);
textcolor(i);
write(chr(178));
end;
textcolor(4);gotoxy(25,9); write('|');
textcolor(5);gotoxy(25,10); write('|');
textcolor(6);gotoxy(25,11); write('|');
textcolor(7);gotoxy(25,12); write('|');
textcolor(4);gotoxy(51,9); write('|');
textcolor(5);gotoxy(51,10); write('|');
textcolor(6);gotoxy(51,11); write('|');
textcolor(7);gotoxy(51,12); write('|');
end;
procedure login;
begin
repeat
clrscr;
animasi2;
gotoxy(27,10);write('Username : ');readln(user);
until user='fti';
repeat
clrscr;
animasi2;
gotoxy(27,10);write('Username : ',user);
gotoxy(27,11);write('Password : ');readln(pass);
until pass='fti';
end;
procedure prima;
begin
clrscr;
writeln('Program Bilangan Prima!');
write('Masukkan panjang deret bilangan : ');readln(deret);
for i:=2 to deret do
begin
jumlah:=0;
for j:=1 to deret do
begin
if (i mod j)=0 then jumlah:=jumlah+1;
end;
if (jumlah=2) then
begin
textcolor(i);
write(i,' ');
end;
end;
end;
begin
clrscr;
animasi1;
login;
prima;
readkey;
end.