Assalamu'alaikum Warahmatullahi Wabarakatuh
Salam hangat untuk semua pecinta blogger diseluruh dunia (gayane seluruh dunia), Alhamdulillah saya masih dikasih kesempatan untuk menulis sedikit yang saya tahu di media online ini.
Kali ini saya mau share tentang program sederhana yang dibuat dengan Pascal 7.0, dimana program ini saya buat untuk memenuhi tugas dari dosen saya.
Langsung saja saya kasih liah penampakan dari program tersebut setelah finish dijalankan adalah sebagai berikut :
Nantinya ketika di RUN, program akan jalan dimulai dari titik 1,1 yaitu sudut kiri atas ke sudut kanan atas kebawah ke kiri ke atas sampai ketemu di titik 2,2 yaitu baris kedua. Begitu seterusnya sampai ke titik dimana semua di blok satu layak dengan objek yang kita tentukan.
Berikut coding yang saya buat, saya memilih menggunakan Repeat Until karena ingin sesuatu yang berbeda dari contoh yang diberikan oleh dosen saya, dimana dosen saya memberikan contoh dengan For To Do.
Program ObatNyamukKotak;
Uses Crt;
Var
x, y : Byte;
Begin
ClrScr;
TextColor(15);
TextBackground(6);
Begin
x:=1;
y:=1;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('*');
x:=x+1;
Until(x>80);
x:=80;
y:=1;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('*');
y:=y+1;
Until(y>24);
x:=80;
y:=24;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('*');
x:=x-1;
Until(x=1);
x:=1;
y:=24;
Repeat
Delay(10);
Gotoxy(x,y+1);Write('');
Gotoxy(x,y);Write('*');
y:=y-1;
Until(y>24);
End;
Begin
x:=2;
y:=2;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('%');
x:=x+1;
Until(x>79);
x:=79;
y:=2;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('%');
y:=y+1;
Until(y>23);
x:=78;
y:=23;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('%');
x:=x-1;
Until(x=2);
x:=2;
y:=23;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('%');
y:=y-1;
Until(y=2);
End;
Begin
x:=3;
y:=3;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('-');
x:=x+1;
Until(x>78);
x:=78;
y:=3;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('-');
y:=y+1;
Until(y>22);
x:=77;
y:=22;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('-');
x:=x-1;
Until(x=3);
x:=3;
y:=22;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('-');
y:=y-1;
Until(y=3);
End;
Begin
x:=4;
y:=4;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('%');
x:=x+1;
Until(x>77);
x:=77;
y:=4;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('%');
y:=y+1;
Until(y>21);
x:=76;
y:=21;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('%');
x:=x-1;
Until(x=4);
x:=4;
y:=21;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('%');
y:=y-1;
Until(y=4);
End;
Begin
x:=5;
y:=5;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('~');
x:=x+1;
Until(x>76);
x:=76;
y:=5;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('~');
y:=y+1;
Until(y>20);
x:=75;
y:=20;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('~');
x:=x-1;
Until(x=5);
x:=5;
y:=20;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('~');
y:=y-1;
Until(y=5);
End;
Begin
x:=6;
y:=6;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('&');
x:=x+1;
Until(x>75);
x:=75;
y:=6;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('&');
y:=y+1;
Until(y>19);
x:=74;
y:=19;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('&');
x:=x-1;
Until(x=6);
x:=6;
y:=19;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('&');
y:=y-1;
Until(y=6);
End;
Begin
x:=7;
y:=7;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('+');
x:=x+1;
Until(x>74);
x:=74;
y:=7;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('+');
y:=y+1;
Until(y>18);
x:=74;
y:=18;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('+');
x:=x-1;
Until(x=7);
x:=7;
y:=18;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('+');
y:=y-1;
Until(y=7);
End;
Begin
x:=8;
y:=8;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('0');
x:=x+1;
Until(x>73);
x:=73;
y:=8;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('0');
y:=y+1;
Until(y>17);
x:=73;
y:=17;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('0');
x:=x-1;
Until(x=8);
x:=8;
y:=17;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('0');
y:=y-1;
Until(y=8);
End;
Begin
x:=9;
y:=9;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('^');
x:=x+1;
Until(x>72);
x:=72;
y:=9;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('^');
y:=y+1;
Until(y>16);
x:=72;
y:=16;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('^');
x:=x-1;
Until(x=9);
x:=9;
y:=16;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('^');
y:=y-1;
Until(y=9);
End;
Begin
x:=10;
y:=10;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('#');
x:=x+1;
Until(x>71);
x:=71;
y:=10;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('#');
y:=y+1;
Until(y>15);
x:=71;
y:=15;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('#');
x:=x-1;
Until(x=10);
x:=10;
y:=15;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('#');
y:=y-1;
Until(y=10);
End;
Begin
x:=11;
y:=11;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('`');
x:=x+1;
Until(x>70);
x:=70;
y:=11;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('`');
y:=y+1;
Until(y>14);
x:=70;
y:=14;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('`');
x:=x-1;
Until(x=11);
x:=11;
y:=14;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('`');
y:=y-1;
Until(y=11);
End;
Begin
x:=12;
y:=12;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('0');
x:=x+1;
Until(x>69);
x:=69;
y:=12;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('0');
y:=y+1;
Until(y>13);
x:=69;
y:=13;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('0');
x:=x-1;
Until(x=12);
x:=12;
y:=13;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('0');
y:=y-1;
Until(y=12);
ReadLn;
End;
End.
Baiklah kalau begitu sepertinya udah selesai saya nulisnya untuk artikel ini. Insya Allah di artikel yang berikutnya bisa lebih menarik lagi dan semoga artikel ini bisa membantu teman-teman semua, Amin....
Wassalamu'alaikum Warahmatullahi Wabarakatuh
Salam hangat untuk semua pecinta blogger diseluruh dunia (gayane seluruh dunia), Alhamdulillah saya masih dikasih kesempatan untuk menulis sedikit yang saya tahu di media online ini.
Kali ini saya mau share tentang program sederhana yang dibuat dengan Pascal 7.0, dimana program ini saya buat untuk memenuhi tugas dari dosen saya.
Langsung saja saya kasih liah penampakan dari program tersebut setelah finish dijalankan adalah sebagai berikut :
Program Selesai Di Run |
Berikut coding yang saya buat, saya memilih menggunakan Repeat Until karena ingin sesuatu yang berbeda dari contoh yang diberikan oleh dosen saya, dimana dosen saya memberikan contoh dengan For To Do.
Program ObatNyamukKotak;
Uses Crt;
Var
x, y : Byte;
Begin
ClrScr;
TextColor(15);
TextBackground(6);
Begin
x:=1;
y:=1;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('*');
x:=x+1;
Until(x>80);
x:=80;
y:=1;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('*');
y:=y+1;
Until(y>24);
x:=80;
y:=24;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('*');
x:=x-1;
Until(x=1);
x:=1;
y:=24;
Repeat
Delay(10);
Gotoxy(x,y+1);Write('');
Gotoxy(x,y);Write('*');
y:=y-1;
Until(y>24);
End;
Begin
x:=2;
y:=2;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('%');
x:=x+1;
Until(x>79);
x:=79;
y:=2;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('%');
y:=y+1;
Until(y>23);
x:=78;
y:=23;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('%');
x:=x-1;
Until(x=2);
x:=2;
y:=23;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('%');
y:=y-1;
Until(y=2);
End;
Begin
x:=3;
y:=3;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('-');
x:=x+1;
Until(x>78);
x:=78;
y:=3;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('-');
y:=y+1;
Until(y>22);
x:=77;
y:=22;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('-');
x:=x-1;
Until(x=3);
x:=3;
y:=22;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('-');
y:=y-1;
Until(y=3);
End;
Begin
x:=4;
y:=4;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('%');
x:=x+1;
Until(x>77);
x:=77;
y:=4;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('%');
y:=y+1;
Until(y>21);
x:=76;
y:=21;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('%');
x:=x-1;
Until(x=4);
x:=4;
y:=21;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('%');
y:=y-1;
Until(y=4);
End;
Begin
x:=5;
y:=5;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('~');
x:=x+1;
Until(x>76);
x:=76;
y:=5;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('~');
y:=y+1;
Until(y>20);
x:=75;
y:=20;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('~');
x:=x-1;
Until(x=5);
x:=5;
y:=20;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('~');
y:=y-1;
Until(y=5);
End;
Begin
x:=6;
y:=6;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('&');
x:=x+1;
Until(x>75);
x:=75;
y:=6;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('&');
y:=y+1;
Until(y>19);
x:=74;
y:=19;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('&');
x:=x-1;
Until(x=6);
x:=6;
y:=19;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('&');
y:=y-1;
Until(y=6);
End;
Begin
x:=7;
y:=7;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('+');
x:=x+1;
Until(x>74);
x:=74;
y:=7;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('+');
y:=y+1;
Until(y>18);
x:=74;
y:=18;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('+');
x:=x-1;
Until(x=7);
x:=7;
y:=18;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('+');
y:=y-1;
Until(y=7);
End;
Begin
x:=8;
y:=8;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('0');
x:=x+1;
Until(x>73);
x:=73;
y:=8;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('0');
y:=y+1;
Until(y>17);
x:=73;
y:=17;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('0');
x:=x-1;
Until(x=8);
x:=8;
y:=17;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('0');
y:=y-1;
Until(y=8);
End;
Begin
x:=9;
y:=9;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('^');
x:=x+1;
Until(x>72);
x:=72;
y:=9;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('^');
y:=y+1;
Until(y>16);
x:=72;
y:=16;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('^');
x:=x-1;
Until(x=9);
x:=9;
y:=16;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('^');
y:=y-1;
Until(y=9);
End;
Begin
x:=10;
y:=10;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('#');
x:=x+1;
Until(x>71);
x:=71;
y:=10;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('#');
y:=y+1;
Until(y>15);
x:=71;
y:=15;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('#');
x:=x-1;
Until(x=10);
x:=10;
y:=15;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('#');
y:=y-1;
Until(y=10);
End;
Begin
x:=11;
y:=11;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('`');
x:=x+1;
Until(x>70);
x:=70;
y:=11;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('`');
y:=y+1;
Until(y>14);
x:=70;
y:=14;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('`');
x:=x-1;
Until(x=11);
x:=11;
y:=14;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('`');
y:=y-1;
Until(y=11);
End;
Begin
x:=12;
y:=12;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('0');
x:=x+1;
Until(x>69);
x:=69;
y:=12;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('0');
y:=y+1;
Until(y>13);
x:=69;
y:=13;
Repeat
Delay(10);
Gotoxy(x-1,y);Write('');
Gotoxy(x,y);Write('0');
x:=x-1;
Until(x=12);
x:=12;
y:=13;
Repeat
Delay(10);
Gotoxy(x,y-1);Write('');
Gotoxy(x,y);Write('0');
y:=y-1;
Until(y=12);
ReadLn;
End;
End.
Baiklah kalau begitu sepertinya udah selesai saya nulisnya untuk artikel ini. Insya Allah di artikel yang berikutnya bisa lebih menarik lagi dan semoga artikel ini bisa membantu teman-teman semua, Amin....
Wassalamu'alaikum Warahmatullahi Wabarakatuh
Kalau ada yang kurang, tolong dikoreksi aja gan
ReplyDelete