![]() Each player starts with 19 game pieces clustered in diagonally opposite corners of the board. The game uses a 16x16 checkered gameboard. Halma Editor Gameboard: For visualizing the gameboard and to make AI play against another AI / player.A C++11 programmed AI will play the game of Halma, an adversarial game with some similarities to checkers.The contents of "input.txt" should strictly follow the format mentioned above, otherwise you may run into an unexpected error.The program will overwrite the "output.txt" file if one already exists.The "input.txt" file has to be on the same directory level as that of "halma_ai.cpp".Works on a file named "input.txt", NOT "input9.txt" or "inputXYZ.txt".End Game: All pieces are nearing to the opposite destination camps, these moves take 3s to 6s.Mid Game: All pieces are out of their respective camps, these moves take 5s to 30s.Initial Game: All pieces are in their respective camps, these moves take 0.002s to 3s.My observations on runtime (On an Intel i7 9th Gen CPU):.The visualization GIF displayed above is a fast forwarded game of our AI agent VS our AI agent, the actual duration was total 6 minutes (3 minutes per side).The agent could take anywhere from 0.002s to 30s, it highly depends on the gameboard and the CPU.In order to avoid deadlock in a game, "playdata.txt" stores the previous move's starting and ending X Y co-ordinates.We could make several such jumps using the same piece, as explained above, and should write out one jump per line in output.txt. J FROM_X,FROM_Y TO_X,TO_Y – agent moves one of the pieces from location FROM_X,FROM_Y to empty location TO_X,TO_Y by jumping over a piece in between. If we make such a move, we can only make one per turn. As explained above, TO_X,TO_Y should be adjacent to FROM_X,FROM_Y (8-connected) and should be empty. So, location 0,0 is the top-left corner of the board location 15,0 of the top-right corner location 0,15 is the bottom-left corner, and location 15,15 the bottom-right corner. We will again use zero-based, horizontal-first, start at the top-left indexing in the board. B for a grid cell occupied by a black pieceġ or more lines: There are two possible types of moves (Empty E, Jump J):Į FROM_X,FROM_Y TO_X,TO_Y – your agent moves one of your pieces from location FROM_X, FROM_Y to adjacent empty location TO_X, TO_Y.W for a grid cell occupied by a white piece.Next 16 lines: Description of the game board, with 16 lines of 16 symbols each:.Third line: A strictly positive floating point number indicating the amount of total play time remaining for the agent.Second line: A string BLACK or WHITE indicating which color the agent will play.First line: A string SINGLE or GAME to let the AI know whether we are playing a single move (and can use all of the available time for it) of playing a full game with potentially many moves.The program will auto-generate an "output.txt" file with the results inside the text file.Download this folder containin the executable file (Windows Only).This was homework #2 of CSCI 561 - Fall 2019 - Foundations of Artificial Intelligence - under Professor Laurent Itti. There have been added rules to prevent spoiling of the game by an agent.Įssentially, our agent will evaluate the gameboard and output the best / optimal move by using Alpha Beta Pruning Minimax algorithm upto 3-ply. Read this article for further details on Halma and its rules. To win the game, a player needs to transfer all of their pieces from their starting corner to the opposite corner, into the positions that were initially occupied by the opponent. ![]() A Java programmed AI will play the game of Halma, an adversarial game with some similarities to checkers.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |