Band Pendatang Baru yang akan meramaikan Blantika Musik Indonesia... Bismillah

Wednesday, January 4, 2012

listing program animasi dengan turbo pascal


MASIH DALAM RANGKA TAHUN BARU 2012 SAYA MASIH AKAN MEMBERIKAN POSTINGAN TENTANG PEMROGRAMAN DENGAN APLIKASI TURBO PASCAL
dan di bawah ini cntohnya listing program animasi menggunakan turbo pascal silahkan di copas listing programnya


uses wincrt;
type
point=^rec;
rec=record
isi:char;
next:point;
end;
queue=record
head:point;
tail:point;
end;
var
q:queue;
i,k:byte;


procedure selang;
var y:byte;
begin
gotoxy(37,8);write('\\         //');
for i:=1 to 10 do
begin
gotoxy(37,8+i);
if i=10 then write('|____   ____|')else write('|           |');
end;
gotoxy(39,19);write(' ');
gotoxy(59,21);write('\');
gotoxy(59,23);write('/');
end;

function empty:boolean;
begin
if q.head=nil then empty:=true
else
empty:=false;
end;

function full:boolean;
begin
if i=10 then
full:=true
else full:=false;
end;


procedure waktu;
var
i:longint;
begin
for i:=1 to 5000000 do
begin
i:=i;
end;
end;

procedure waktu2;
var
i:longint;
begin
for i:=1 to 90055000 do
begin
i:=i;
end;
end;

procedure create;
begin
q.head:=nil;
q.tail:=nil;
end;



procedure enqueue;
var
now:point;
begin
if full then
begin
gotoxy(1,6);write('queue wis penuh!!!');
waktu2;
gotoxy(1,6);clreol;
end else
begin
new(now);
gotoxy(1,6);clreol;write('Masukkan sembarang karakter = ');
now^.isi:=readkey;write(now^.isi);
now^.next:=nil;
for k:=1 to 12 do
begin
gotoxy(k+30,7);write(' ');
gotoxy(k+31,7);write(now^.isi);waktu;
end;
for k:=1 to 11 - i do
begin
gotoxy(43,k+6);write(' ');
gotoxy(43,k+7);write(now^.isi);waktu;
end;
inc(i);
gotoxy(1,7);clreol;
if empty then
begin
q.head:=now;
q.tail:=now;
end else
begin
q.tail^.next:=now;
q.tail:=now;
end;
end;
end;

procedure dequeue;
var u:byte;
now:point;
begin
if empty then
begin
gotoxy(1,6);write('queue kosong lo....');
waktu2;
gotoxy(1,6);clreol;
end else
begin
gotoxy(1,6);write('Hurup terbawah dikeluarkan....');
for k:=19 to 12 do
begin
gotoxy(43,k-1);write(' ');
gotoxy(43,k);write(q.head^.isi);waktu;
end;
for k:=43 to 53 do
begin
gotoxy(k,22);write(' ');
gotoxy(k+1,22);write(q.head^.isi);waktu;
end;
now:=q.head;
q.head:=q.head^.next;
dispose(now);
dec(i);
now:=q.head;
k:=18;
while now <> nil do
begin
gotoxy(43,k);write(now^.isi);
now:=now^.next;
dec(k);
end;
gotoxy(43,k);write(' ');
waktu;
end;
end;


{procedure create;
begin
q.head:=nil;
q.tail:=nil;
end; }

procedure clear;
begin
while not empty do dequeue;
end;



procedure menu;
var jawab:char;
begin
i:=0;
gotoxy(1,2);write('1. Enqueue');
gotoxy(1,3);write('3. Dequeue');
gotoxy(1,4);write('3. Quit');
create;
repeat
gotoxy(1,5);clreol;write('Pilihan[1/2/3]=');
jawab:=readkey;write(jawab);
case jawab of
'1':Enqueue;
'2':Dequeue;
end;
until jawab='3';
clrscr;
write('Program Selesai');
end;

BEGIN
clrscr;
selang;
menu;
end.



listing program animasi dengan turbo pascal Rating: 4.5 Diposkan Oleh: GUITAR CORD
Terima kasih sudah berkomentar