h Bermain sambil belajar: Antrian (TURBO PASCAL)

fian-switch ngeblogs!

External links - Jquery Semua yang tertuang diblog ini yaitu Informasi mengenai IT. Artikel dan software kita bisa download dengan gratis dan sepuasnya disini. Anda bisa mengomentari dari tulisan-tulisan ini dan memberikan masukkan, memberikan informasi mengenai IT diluar, dilingkungan kerja maupun di perkuliahan anda. Mari kita tingkatkan IT di Indonesia.

Indonesia Go Open Source ?

External links - Jquery Hari gini masih bayar?? sekarang udah zamannya gretongan hee..hee..alias gratisan.Hampir semua negara maju dan berkembang sekarang sedang menggalakkan Open Source, termasuk Indonesia. Kalau loe-loe semua punya cerita tentang Open source, kita bisa sharing di blog ini atau kalian juga bisa kunjungi http://opensource-indonesia.com. Mari kita dukung Indonesia Open Source.

Indonesia Go Open Source ?

External links - Jquery Want to get rid of the blogger toolbar in new blogger that just came out of beta ? If you have shifted your blogspot blog from old blogger to the new blogger beta, you may have noticed that the previous CSS code to remove the blogger navbar will no longer be effective. That's because Google now uses different CSS tags to display the blogger bar. [#navbar-iframe instead of #b-navbar] If you want to hide the navbar in your blogger blog, here's what you should do ! (these instructions refer to the "new" Blogger layouts templates) GO GET IT GUMGUM:)

Super Sexy Bookmarks Widget for Blogger !

Thumbnail image that says sleek button using photoshop that links to a Photoshop tutoril. Looking for professional Social Bookmark Buttons for your blog ! me too :) however, while i was searching the net too, I came across a post by Naeemnur, that had instructions for Blogger (BlogSpot.com) based blogs which was really good.If you have a blog on blogger you can definitely give this a try.

Its very attractive social bookmarking widget ! it can help you to let your visitors bookmark your page effectively .

for instructions about the use of this SEXY Social bookmarking widget ! you can go here and get it GUMGUM:)

Kamis, 24 Desember 2009

Antrian (TURBO PASCAL)

Program Queueku;
Uses Crt;
Const Loket = 55;
      Kanan = 75;
      UpBound = 11;
      LowBound = 1;
Type Orang = Object
     Badan : Array[1..3] Of String[6];
     X,Y,Mentok : Byte;
     Procedure init;
     Procedure gerak;
   End;
     Antrian = object
     Queue : Array[LowBound..UpBound] Of Orang;
     Noel : integer;
     Procedure Input(Var Out : Char);
     Procedure Create;
     Procedure insertion;
     Procedure deletion;
     Procedure doproses;
   End;

Procedure Orang.Init;
Begin
    X := 1; Y := 20; Mentok := Loket;
    Badan[1] := ('      ');
    Badan[2] := (' -( )- ');
    Badan[3] := ('__/^\__');
End;

Procedure Orang.Gerak;
Begin
     repeat
        GotoXY(X,Y); Write(Badan[1]);
        GotoXY(X,Y+1); Write(Badan[2]);
        GotoXY(X,Y+2); Write(Badan[3]);
        Inc(X); GotoXY(16,6); Delay(20);
        If X = 75 Then
           Begin
              GotoXY(X,Y); Clreol;
              GotoXY(X,Y+1); Clreol;
              GotoXY(X,Y+2); Write('______');
              Delay(20);
           End;
     Until X = Mentok;
End;

Procedure Antrian.input;
Var Pil : char;
Begin
     GotoXY(1,2); Write('1. Bikin Antrian');
     GotoXY(1,3); Write('2. Antrian Masuk');
     GotoXY(1,4); Write('3. Antrian Keluar');
     GotoXY(1,5); Write('4. Bye..Bye..');
     GotoXY(1,6); Write('        PILIHAN [1..4] ? ');
     Pil := Readkey; Write(Pil); Out := Pil;
End;

Procedure Antrian.create;
Var I : integer;
Begin
     For I := 18 To 22 Do
       Begin
         GotoXY(1,I); Clreol;
       end;
     For I := 1 To 80 Do Write('_');
     GotoXY(58,17); Write('  ANTRIAN KARCIS');
     GotoXY(60,18); Write('    _______');
     GotoXY(60,19); Write('   /_______\');
     GotoXY(60,20); Write(' /-| | | | |-\');
     GotoXY(60,21); Write('   | | | | |  ');
     GotoXY(60,22); Write(' __| LOKET |__');
     GotoXY(60,23); Noel := 0;
End;

Procedure Antrian.Insertion;
Begin
     If Noel >= upbound Then
       Begin
          Textcolor(12+Blink); GotoXY(3,23);
          Write('Antrian Penuh'); Textcolor(15);
          Noel := UpBound;
       End
     Else
       Begin
          Inc(Noel); Queue[Noel].Init;
          Queue[Noel].Mentok := (Loket - Noel * 5) + 5;
          Queue[Noel].Gerak;
       End;
End;

Procedure Antrian.Deletion;
Var I : integer;
    Front : Orang;
Begin
    If Noel < lowbound Then
      Begin
         Textcolor(12+Blink); GotoXY(59,23);
         Write('  Antrian kosong'); Textcolor(15); Noel := 0;
      End
    Else
      Begin
         Dec(Noel);
         GotoXY(55,20); Write('       ');
         GotoXY(55,21); Write('       ');
         GotoXY(55,22); Write('_______');
         Front := Queue[1];
         Front.Mentok := 75;
         Front.X := 72;
         Front.Gerak;
         For I := 1 To Noel Do Queue[I].X := Queue[I+1].X;
         For I := 1 To Noel Do Queue[I].Gerak;
      End;
End;

Procedure Antrian.DoProses;
Var Menu : char;

Begin
     Noel := 0;
       Repeat
         Textcolor(15); Input(Menu);
         GotoXY(1,23); Clreol;
         Case Menu Of
           '1' : Create;
           '2' : Insertion;
           '3' : Deletion;
         End;
       until Menu = '4';
End;

       {* PROGRAM UTAMA *}

Var Queue : Antrian;
Begin
  Clrscr;
  queue.doproses;
End.

0 komentar:

Posting Komentar | Feed

Posting Komentar



 

Pengikut

Bermain sambil belajar Copyright © 2009 REDHAT Dashboard Designed by SAER