MTDf Algorithm Implementasi Algoritma MTD (F) Untuk Menentukan Solusi Pad Board Game 2048

Jurnal Ilmiah Komputer dan Informatika KOMPUTA Edisi. .. Volume. .., Bulan 20.. ISSN : 2089-9033 Then look for the next step by using an algorithm MTDf to obtain an evaluation value of each step. Each step has been sought can be seen in the following table: Table 1 Left Step Search Results Iteration G Beta Lowerbound Upperbound 1 - ∞ +∞ 1170,5 1170,5 +∞ 2 1170,5 1171,5 1170,5 +∞ 1172 1171,5 1172 +∞ 3 1172 1172,5 1172 +∞ 1172 1172,5 1172,5 1172 Table 2 Right Step Search Results Iteration G Beta Lowerbound Upperbound 1 - ∞ +∞ 1170,5 1170,5 +∞ 2 1170,5 1171,5 1170,5 +∞ 1172 1171,5 1172 +∞ 3 1172 1172,5 1172 +∞ 1172 1172,5 1172,5 1172 Table 3 Up Step Search Results Iteration G Beta Lowerbound Upperbound 1 - ∞ +∞ 1184 1184 +∞ 2 1184 1185 1184 +∞ 1184 1185 1184 1184 Table 4 Down Step Search Results Iteration G Beta Lowerbound Upperbound 1 - ∞ +∞ 1025 1025 +∞ 2 1025 1026 1025 +∞ 1172 1026 1172 +∞ 3 1172 1173 1172 +∞ 1172 1173 1172 1172 In the above table have been searching algorithms using MTDf. Variable G is the value of a function call Alphabeta search, variable beta beta value at the MTD f to the value upperbound on the function of the alphabet, while lowerbound and upperbound is the upper limit and lower limit of the algorithm MTD f in the search. Then each displacement value obtained as follows: Left = 1172, 1172 = Right, Up and Down = 1184 = 1172. From the results obtained that the next step is to up.

2.5 Testing System Testing algorithm is performed to test the accuracy

and speed of the algorithm MTD f which has been implemented in 2048. The game 2048 game will be played by the algorithm MTD f as many as 10 times each search depth level. Then count the number of games that could be reached in 2048 at each level of the depth of the search. So as to get the accuracy of the algorithm MTD f by comparing the number of games that could be reached in 2048 with the number of games that have been made. Search will be made until a greater degree of accuracy equal to 50. As for the speed is calculated based on the time required to complete the game in 2048. Table 5 Results of Testing Depth Level 0 Trial Status Largest Tile Time HH:mm:ss.SSS Skor 1 Failed 256 00:00:05.627 3368 2 Failed 256 00:00:05.452 3236 3 Failed 128 00:00:04.053 1932 4 Failed 256 00:00:04.695 2632 5 Failed 512 00:00:07.212 5184 6 Failed 64 00:00:01.734 668 7 Failed 256 00:00:05.787 3472 8 Failed 256 00:00:05.761 3364 9 Failed 256 00:00:06.370 3884 10 Failed 128 00:00:03.698 1796 Table 6 Results of Testing Depth Level 1 Trial Status Largest Tile Time HH:mm:ss.SSS Score 1 Failed 512 00:00:10.845 8548 2 Failed 256 00:00:04.725 2928 3 Failed 256 00:00:05.151 3140 4 Failed 512 00:00:09.751 7108 5 Failed 256 00:00:06.577 4200 6 Failed 512 00:00:08.955 6580 7 Failed 128 00:00:02.640 1292 8 Failed 512 00:00:08.136 5728 9 Failed 256 00:00:07.661 5012 10 Failed 128 00:00:02.824 1380 Table 7 Results of Testing Depth Level 2 Trial Status Largest Tile Time HH:mm:ss.SSS Score 1 Failed 1024 00:07:50.290 16404 2 Failed 1024 00:06:03.666 12588 3 Failed 512 00:01:45.126 9352 4 Failed 1024 00:04:01.744 14824 5 Failed 512 00:00:46.471 7272 6 Failed 512 00:01:18.127 8092 7 Failed 1024 00:06:11.310 16848 8 Failed 1024 00:08:14.355 18380 9 Failed 512 00:01:49.780 9204 10 Failed 512 00:01:10.856 7464 Table 8 Results of Testing Depth Level 3 Trial Status Largest Tile Time HH:mm:ss.SSS Score 1 Succeed 2048 00:15:20.262 24508 2 Failed 1024 00:10:42.021 17788 3 Failed 1024 00:11:36.187 16476 4 Failed 1024 00:15:19.595 9552 5 Succeed 2048 00:26:19.731 20176 6 Failed 1024 00:09:35.158 15620 7 Failed 512 00:07:35.641 8780 8 Failed 1024 00:12:23.831 12456 9 Failed 1024 00:12:21.244 12492 10 Failed 512 00:09:37.873 7968 Table 9 Results of Testing Depth Level 4 Trial Status Largest Tile Time HH:mm:ss.SSS Score 1 Failed 1024 00:31:49.967 16160 2 Failed 1024 00:28:05.387 17748 3 Failed 1024 00:39:40.811 12252 4 Succeed 2048 00:43:53.370 20168 5 Failed 1024 00:36:10.246 14040 6 Succeed 2048 00:33:54.834 20256 Jurnal Ilmiah Komputer dan Informatika KOMPUTA Edisi. .. Volume. .., Bulan 20.. ISSN : 2089-9033 7 Succeed 2048 00:29:55.392 21124 8 Failed 1024 00:34:29.883 15448 9 Failed 1024 00:37:18.236 15640 10 Failed 1024 00:42:23.269 10260 Table 10 Results of Testing Depth Level 5 Trial Status Largest Tile Time HH:mm:ss.SSS Score 1 Succeed 2048 00:57:05.272 20472 2 Succeed 2048 01:11:45.322 21220 3 Failed 1024 01:08:59.489 15804 4 Succeed 2048 01:27:40.496 20516 5 Succeed 2048 01:13:29.821 20304 6 Failed 1024 01:19:01.814 18708 7 Failed 1024 01:25:12.240 19948 8 Failed 1024 01:23:10.546 18412 9 Succeed 2048 01:32:27.933 20572 10 Succeed 2048 01:21:23.320 20344

2.6 Testing Result

The results of testing that was done ten times at each depth level can be seen in the picture. Figure 8 Testing Results Based on Max Tile Figure 9 Testing Results Based on Score Figure 10 Testing Results Based on Time

3. FINAL

3.1 Conclusion

Based on the results of the study, analysis of system design and implementation as well as tests performed on the algorithms MTD f to finish the game in 2048, it could be concluded that the algorithm MTD f can be applied to the game in 2048, but to get the tile in 2048 in order to win the game in 2048 requires level searches search depth of at least three and takes about 13 minutes 59 seconds. The level of accuracy of the algorithm MTD f on a quest with a depth of level zero, one and two is 0, whereas on level three is 20, a level four was 30 and the level of five is 60. 3.2 Suggestion In the algorithm implementation MTDf on the game in 2048 is still far from perfect and there are still many shortcomings. Therefore it is necessary to do a deeper analysis. The advice can be given by the researchers in this study is to apply other algorithms that can be applied to the game in 2048 in order to more quickly and accurately to complete the game in 2048. REFERENCES [1] K. Lu, Game Theory of 2048, Math 89s: Game Theory and Democracy, 2014. [2] Stepen, Perbandingan Algoritma Greedy Bactracking Dalam Penyelesaian Permainan 2048, Makalah IF2211 Strategi Algoritma , 2014. [3] V. Vryniotis, Using Artificial Intelligence to solve the 2048 Game JAVA code | Datumbox, 14 November 2014. [Online]. Available: http:blog.datumbox.comusing- artificial-intelligence-to-solve-the-2048-game- java-code. [Accessed 20 September 2015]. [4] A. Plaat, MTD f A Minimax Algorithm faster than NegaScout, Erasmus University, Rotterdam, 1997. 500 1000 1500 2000 2500 1 2 3 4 5 6 7 8 9 10 MAX TILE LEVEL 0 LEVEL 1 LEVEL 2 LEVEL 3 LEVEL 4 LEVEL 5 5000 10000 15000 20000 25000 30000 1 2 3 4 5 6 7 8 9 10 Score LEVEL 0 LEVEL 1 LEVEL 2 LEVEL 3 LEVEL 4 LEVEL 5 1000 2000 3000 4000 5000 6000 1 2 3 4 5 6 7 8 9 10 Time LEVEL 0 LEVEL 1 LEVEL 2 LEVEL 3 LEVEL 4 LEVEL 5 s