![]() The three factors are determined as numeric values and totaled as a floating-point number representing the evaluation score. Penalty for pieces remaining in their own starting zone.Number of pieces in the opponent's starting zone.Distance between each player's pieces and the opposing starting zone.While I tried out different factors such as central control of the board, and blocking opposing pieces, I eventually settled on evaluation based on three factors: The other main challenge I faced was writing an evaluation function that properly informed the AI's movements based on the current state of the game board. The solution came down to building a list of all valid moves into adjacent spaces with a helper function and adding all valid jumps to that list using a separate recursive function. Multiple jumps can be chained together in a single move as long as each jump is over a different piece and into an unvisited space. Players may also make a jump over any adjacent piece of any color into an empty space on the other side of that piece. In Halma, players may move a piece to any empty adjacent square in any of the eight directions surrounding their piece. While I ran into many challenges while working on this project, the two biggest ones were move validation and evaluating states of the game board to enable proper decision making by the AI.Įnforcing proper move validation was the biggest hurdle I had to overcome during this build. Working on this game pushed me to get my hands dirty with larger scale Object Oriented Programming, recursion, modules, and thorough documentation as well as the opportunity to learn more about AI. My motivation for the project was to apply some of the heavy concepts I've learned so far in my coursework towards a tangible working product. I decided to build this project after finishing my second quarter as a CS student at Oregon State University. Game board displays valid potential moves for the player.Graphical user interface using the Pygame library for an enjoyable playing experience.AI opponent utilizes the minimax algorithm with alpha-beta pruning to make its moves.Single-player gameplay against an AI opponent.Similar to the game Chinese Checkers, gameplay involves players taking turns moving their pieces from their starting corner of the board into the opposite corner before their opponent. This version of the game is played on an 8x8 square board between a player and the computer. Halma is a two-player strategy board game invented in the 19th century. This is a Python implementation of the board game Halma, using the Pygame library for the graphical user interface. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |