PENGEMBANGAN PERMAINAN FIG-JIG PUZZLE DENGAN IMPLEMENTASI ALGORITMA DEPTH FIRST SEARCH (DFS) TUGAS AKHIR Oleh : Mukti Handayani NIM. 08560345 JURUSAN TEKNIK INFORMATIKA FAKULTAS TEKNIK UNIVERSITAS MUHAMMADIYAH MALANG 2015 PENGEMBANGAN PERMAINAN FIG-JIG PUZZLE DENGAN IMPLEMENTASI ALGORITMA DEPTH FIRST SEARCH (DFS) TUGAS AKHIR Sebagai Persyaratan Guna Meraih Gelar Sarjana Strata 1 Teknik Informatika Universitas Muhammadiyah Malang Oleh : Mukti Handayani NIM. 08560345 JURUSAN TEKNIK INFORMATIKA FAKULTAS TEKNIK UNIVERSITAS MUHAMMADIYAH MALANG 2015 KATA PENGANTAR Alhamdulillah, segala puji bagi Allah SWT yang telah memberi petunjuk dan serta melancarkan jalan sehingga penulis dapat menyelesaikan penelitian yang berjudul “Pengembangan Permainan Fig-Jig Puzzle dengan Algoritma Depth First Search (DFS)” ini. Pada penelitian ini dibuat suatu aplikasi permainan puzzle yaitu Fig-Jig Puzzle. Fig-Jig Puzzle merupakan pengembangan dari suatu teka-teki silang yang berbasiskan angka. Hasil analisa dari aplikasi ini dibuat menggunakan bahasa pemrograman Java dan menggunakan NetBeans sebagai pengembangan aplikasinya. Penulis berharap apa yang telah dibuat ini menjadi suatu aplikasi permainan puzzle yang menarik dan bermanfaat untuk dimainkan. Penulis menyadari bahwa penelitian ini masih jauh dari kesempurnaan. Oleh karena itu penulis mengaharapkan saran dan kritik membangun untuk pengembangan kedepannya. Perangkat lunak ini juga masih membutuhkan pengembangan lebih lanjut sehingga dapat lebih bermanfaat. Akhir kata penulis mengucapkan terima kasih kepada semua pihak yang telah membantu hingga tugas akhir ini terselesaikan. Malang, Juli 2015 Penulis iii DAFTAR ISI ABSTRAK .................................................................................................................i ABSTRACT .................................................................................................................ii KATA PENGANTAR ...............................................................................................iii DAFTAR ISI ….. .......................................................................................................iv DAFTAR GAMBAR ................................................................................................vii DAFTAR TABEL .....................................................................................................ix BAB I PENDAHULUAN ..........................................................................................1 1.1. Latar Belakang ...........................................................................................1 1.2. Rumusan Masalah......................................................................................3 1.3. Batasan Masalah ........................................................................................3 1.4. Tujuan Penelitian .......................................................................................3 1.5. Metodologi.................................................................................................3 1.6. Sistematika Penulisan ................................................................................4 BAB II LANDASAN TEORI ....................................................................................6 2.1. Game Puzzle ..............................................................................................6 2.1.1. Manfaat Bermain Game Puzzle .....................................................6 2.2. Fig-Jig Puzzle ............................................................................................6 2.3. Algoritma ...................................................................................................7 2.3.1. Struktur Dasar Algoritma ..............................................................7 2.4. Algoritma Depth First Search (DFS) ........................................................8 2.4.1. Fungsi dari Algoritma Depth First Search (DFS) .........................8 2.4.2. Keuntungan dan Kerugian Algoritma Depth First Search (DFS).8 2.4.3. Pseudo-code dari Algoritma Depth First Search (DFS) ...............9 2.4.4. Aturan Pada Algoritma Depth First Search (DFS) .......................9 2.4.5. Cara Kerja Algoritma Depth First Search (DFS) .........................11 2.5. Bahasa Pemrograman Java ........................................................................15 2.5.1. Perkembangan Teknologi Java .....................................................15 2.5.2. Pemrograman dengan Java ...........................................................16 iv 2.5.3. Kelebihan dan Kekurangan Java...................................................17 2.6. NetBeans ....................................................................................................19 BAB III ANALISIS DAN PERANCANGAN SISTEM ...........................................21 3.1. Analisis ......................................................................................................21 3.1.1. Analisis Permasalahan...................................................................21 3.1.2. Analisis Algoritma Depth First Search (DFS) ..............................22 3.2. Perancangan ...............................................................................................25 3.2.1 Perancangan Sistem........................................................................25 3.2.1.1. Flowchart Program Utama ...............................................25 3.2.1.2. Flowchart Menu Play .......................................................26 3.2.1.3. Flowchart Menu Tutorial .................................................27 3.2.1.4. Flowchart Menu About .....................................................27 3.2.1.5. Flowchart Menu Level ......................................................28 3.2.2. Perancangan UML (Unified Modeling Language) Diagram.........29 3.2.2.1. Use Case Diagram ............................................................29 3.2.2.2. Activity Diagram ...............................................................30 3.2.2.3. Sequence Diagram ............................................................31 3.2.2.4. Class Diagram ..................................................................32 3.2.3. Perancangan Interface ...................................................................32 3.2.4. Rancangan Perangkat Lunak .........................................................34 BAB IV IMPLEMENTASI DAN PENGUJIAN .......................................................35 4.1. Implementasi Sistem..................................................................................35 4.2. Kebutuhan Sistem ......................................................................................35 4.2.1. Kebutuhan Sistem Perangkat Keras ................................................35 4.2.2. Kebutuhan Sistem Perangkat Lunak................................................35 4.3. Implementasi Antar Muka (Interface) .......................................................36 4.3.1. Interface Menu Utama .....................................................................36 4.3.2. Interface Menu Play ........................................................................37 4.3.3. Interface Menu Level .......................................................................38 4.3.4. Interface Menu Tutorial ..................................................................39 v 4.3.5. Interface Menu About ......................................................................39 4.4. Pengujian ...................................................................................................40 4.4.1. Pengujian Aplikasi ...........................................................................40 4.4.2. Pengujian Kompleksitas Algoritma .................................................42 BAB V KESIMPULAN DAN SARAN .....................................................................46 5.1. Kesimpulan ...............................................................................................46 5.2. Saran …… .................................................................................................46 DAFTAR PUSTAKA ...............................................................................................47 vi DAFTAR GAMBAR Gambar 2.1. Contoh Fig-Jig Sederhana.....................................................................7 Gambar 2.2. Lintasan DFS .........................................................................................10 Gambar 2.3. Langkah awal ........................................................................................12 Gambar 2.4. Langkah 1 ..............................................................................................12 Gambar 2.5. Langkah 2 ..............................................................................................13 Gambar 2.6. Langkah 4 ..............................................................................................14 Gambar 2.7. Langkah 5 ..............................................................................................14 Gambar 2.8. Tahap-tahap Pemrograman Java ...........................................................16 Gambar 3.1. Kondisi Awal Keadaan Game ...............................................................23 Gambar 3.2. Kondisi Akhir Keadaan Game ..............................................................23 Gambar 3.3. Struktur Ruang Pohon yang Ditelurusi .................................................24 Gambar 3.4. Flowchart Program Utama ....................................................................25 Gambar 3.5. Flowchart Menu Play............................................................................26 Gambar 3.6. Flowchart Menu Tutorial ......................................................................27 Gambar 3.7. Flowchart Menu About .........................................................................27 Gambar 3.8. Flowchart Pilih Level Game .................................................................28 Gambar 3.9. Use Case Diagram Aplikasi..................................................................29 Gambar 3.10. Activity Diagram Aplikasi ...................................................................30 Gambar 3.11. Sequence Diagram Aplikasi ................................................................31 Gambar 3.12. Class Diagram Aplikasi ......................................................................32 Gambar 3.13. Rancangan Interface Dari Aplikasi .....................................................32 Gambar 3.14. Rancangan Interface Pemilihan Level .................................................33 Gambar 3.15. Rancangan Interface Aplikasi Fig-Jig ................................................34 Gambar 4.1. Interface Menu Utama Dari Aplikasi ....................................................36 Gambar 4.2. Interface Menu Play Pada Level 1 ........................................................37 Gambar 4.3. Interface Menu Play Pada Level 2 ........................................................37 Gambar 4.4. Interface Menu Play Pada Level 3 ........................................................38 Gambar 4.3. Interface Menu Memilih Level..............................................................38 vii Gambar 4.4. Interface Menu Tutorial ........................................................................39 Gambar 4.5. Interface Menu About............................................................................39 Gambar 4.6. Level 1 yang Telah Terisi ......................................................................40 Gambar 4.7. Level 2 yang Telah Terisi ......................................................................41 Gambar 4.8. Level 3 yang Telah Terisi ......................................................................41 viii DAFTAR TABEL Tabel 2.1 Isi Stack Dalam DFS ..................................................................................10 ix DAFTAR PUSTAKA Supardi, Yuniar. 2010. Semua Bisa Menjadi Programmer Java (Basic Programming). Jakarta: Elex Media Komputindo Hakim, Rachmad., Sutarto. 2009. Mastering Java. Jakarta: Elex Media Komputindo Lukmana, Lukas. 2010. The 40 Best Java Applications. Jakarta: Elex Media Komputindo Hendrata, Edward. 2007. Pencarian Solusi Permainan Fig-Jig Menggunakan Algoritma Runut-Balik. Makalah IF2251 Strategi Algoritmik. Program Studi Teknik Informatika. Institut Teknologi Bandung. Aprialdi, Dani. 2012. Implementasi Algoritma Depth-First Search Pada Game Puzzle Angka. Bandung: Universitas Komputer Indonesia. Rouf, Abdul. 2012. Pengujian Perangkat Lunak Dengan Menggunakan Metode White Box dan Black Box. Sistem Informasi - STMIK HIMSYA Semarang. Setiadi, Robert. 2008. Algoritma Itu Mudah. Jakarta: PT Prima Infosarana Media https://www.wikipedia.org/Cross-figure https://www.wikipedia.org/Depth-first_search https://id.wikipedia.org/wiki/Permainan https://id.wikipedia.org/wiki/Teka-teki_silang 47