{"id":26218114,"url":"https://github.com/parham1998/pentago_mini-max","last_synced_at":"2026-04-22T15:37:45.772Z","repository":{"id":46108086,"uuid":"379704372","full_name":"parham1998/Pentago_mini-max","owner":"parham1998","description":"Implementation of Pentago game using mini-max algorithm and alpha-beta pruning with JavaFX","archived":false,"fork":false,"pushed_at":"2021-11-14T09:14:04.000Z","size":388,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-12T13:15:31.986Z","etag":null,"topics":["alpha-beta-pruning","java","javafx","minimax-algorithm","pentago"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/parham1998.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-23T19:05:11.000Z","updated_at":"2024-12-16T03:17:53.000Z","dependencies_parsed_at":"2022-08-30T19:22:34.360Z","dependency_job_id":null,"html_url":"https://github.com/parham1998/Pentago_mini-max","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/parham1998/Pentago_mini-max","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parham1998%2FPentago_mini-max","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parham1998%2FPentago_mini-max/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parham1998%2FPentago_mini-max/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parham1998%2FPentago_mini-max/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/parham1998","download_url":"https://codeload.github.com/parham1998/Pentago_mini-max/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parham1998%2FPentago_mini-max/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28004518,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-24T02:00:07.193Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alpha-beta-pruning","java","javafx","minimax-algorithm","pentago"],"created_at":"2025-03-12T13:15:34.065Z","updated_at":"2025-12-24T16:03:54.124Z","avatar_url":"https://github.com/parham1998.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pentago_mini-max (warm-up project!)\nImplementation of the Pentago game using mini-max algorithm and alpha-beta pruning with JavaFX\n\nThe game Pentago is played on a 6x6 board, which is divided into four 3x3 sub-boards. \u003cbr /\u003e\nYou play first, and your move consists of placing a marble of black color onto an empty field on the board and turning one of the sub-boards by 90 degrees. The computer plays after your move and tries to find the best move at each step! \u003cbr /\u003e\nThe game finishes, when you or the computer puts five marble in a row at first. five in a row can occur vertical, horizontal, or diagonal before the sub-board rotation. \u003cbr /\u003e\nIf neither you nor the computer achieves five in a row, the game ends after the 36th move with a draw. \n\n### mini-max algorithm and alpha-beta pruning\nmini-max algorithm tries to find the best move in every step by evaluating all the available moves.\n\nalpha-Beta pruning is not a new algorithm, rather an optimization technique for the minimax algorithm. \u003cbr /\u003e\nIt reduces the computation time by a huge factor. This allows us to search much faster and even go into deeper levels in the game tree. \u003cbr /\u003e\nIt cuts off branches in the game tree that need not be searched because a better move is already available. \u003cbr /\u003e\nIt is called Alpha-Beta pruning because it passes 2 extra parameters in the minimax function, namely alpha and beta.\n\nAlpha is the best value that the maximizer currently can guarantee at that level or above. \u003cbr /\u003e\nBeta is the best value that the minimizer currently can guarantee at that level or above.\n    \n### implementation details\nGame-tree complexity: The most meaningful full parameters to estimate the game-tree size is the number of moves until a game finishes, called game depth, and the number of possible moves per state. for the game Pentago, there are 36 possible places at first, then reduced by 1 at each step. there are also 8 possible rotating at each step which makes the game complexity very much! (worst case: (36 * 8) * (35 * 8) * (34 * 8) * ... * (1 * 8) = 36! * 8^36) \u003cbr /\u003e\nTo solve a game with the minimax search algorithm, the whole game tree has to be evaluated. This results in a complexity of Θ(moves ^ depth). But alpha-beta Search can reduce the exponent by half if perfect move ordering is given: Θ(moves ^ depth/2) \u003cbr /\u003e\nEven with random move ordering the complexity shrinks to Θ(moves ^ (3/4 * depth)). \n\nI used random move order in this project. I considered one of the empty places at the center of sub-boards for the computer's first two moves, for the next 10 moves, I reduced the depth of the tree to 4, and then I set the depth to 5 until the end.\n\n### the following animation shows the performance of the mini-max algorithm in the Pentago game: (animation speed has been doubled)\n\n![pentago](https://user-images.githubusercontent.com/85555218/123473179-732a4100-d60d-11eb-885a-aed27e214637.gif)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparham1998%2Fpentago_mini-max","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparham1998%2Fpentago_mini-max","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparham1998%2Fpentago_mini-max/lists"}