{"id":22783817,"url":"https://github.com/greg-kennedy/perlchess","last_synced_at":"2025-03-30T15:16:51.882Z","repository":{"id":86779668,"uuid":"318389395","full_name":"greg-kennedy/PerlChess","owner":"greg-kennedy","description":"Chess engine in Perl","archived":false,"fork":false,"pushed_at":"2020-12-04T03:40:55.000Z","size":15,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-05T16:47:50.637Z","etag":null,"topics":["chess","chess-engine","perl"],"latest_commit_sha":null,"homepage":"","language":"Perl","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/greg-kennedy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-04T03:16:31.000Z","updated_at":"2023-12-31T06:31:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"f9083d2c-48d7-4771-a502-a895d9b2b24a","html_url":"https://github.com/greg-kennedy/PerlChess","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greg-kennedy%2FPerlChess","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greg-kennedy%2FPerlChess/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greg-kennedy%2FPerlChess/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greg-kennedy%2FPerlChess/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/greg-kennedy","download_url":"https://codeload.github.com/greg-kennedy/PerlChess/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246334455,"owners_count":20760646,"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","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":["chess","chess-engine","perl"],"created_at":"2024-12-11T22:09:33.481Z","updated_at":"2025-03-30T15:16:51.876Z","avatar_url":"https://github.com/greg-kennedy.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PerlChess\nChess engine in Perl\n\n## Overview\nThis is a simple Chess Engine written in Perl. Originally, I had created it for my NaNoGenMo 2017 entry, [\"White to Play and Win\"](https://github.com/greg-kennedy/ChessBook). I wanted to continue development on the engine, but had no place for it within the novel repository. Instead, I have split it into a standalone project.\n\nIt is still not very good, for a number of reasons:\n* opening book is extremely limited\n* static evaluator lacks heuristics beyond raw piece value\n* no endgame intelligence\n* and it's too slow to use beyond 5 or 6 ply\n\nSome of this may be improved in the future, or not.\n\n## Usage\nThe engine code itself is stored in the `Chess` folder as a set of related Perl modules:\n\n* `Constant.pm` - definitions of constants used by the other modules\n* `State.pm` - holds the board representation and game history, generates move lists and verifies moves\n* `Engine.pm` - implements the Negamax algorithm with Alpha-Beta pruning to determine the best next move\n* `Book.pm` - opening book for the engine\n\nTo interact with the engine from other programs, simply `use` (or `require`) the desired components. There are POD comments at the top of each module file to help explain the methods.\n\n## Examples\nA few example programs are included in the main repository:\n\n* `perft.pl` - the Perft move-testing program. Exercises the move generation in Chess::Board and returns how many nodes were visited. Used to verify correctness of move generation.\n* `play.pl` - console-based version of the game which lets a user play against the computer\n* `uci.pl` - a UCI (Universal Chess Interface) adapter, which allows the program to be linked to a Chess GUI like Arena or WinBoard. Using a remote SSH connection with e.g. `plink` (part of the PuTTY suite) it can even run on a networked machine.\n\n## Notes\nInternally the board is treated as a flattened 10x12 array (120 elements) with move generation using offsets. Also, the board is stored \"flipped\" for Black, which makes things easier on the engine - it simply acts as though it is always playing White (a \"monochrome\" chess engine).\n\nDevelopment of this engine would have been much more difficult without the tremendous resource of the [Chess Programming Wiki](https://www.chessprogramming.org/), which covers a range of topics relating to creating and testing chess engines.\n\n## License\nReleased under the Perl Artistic 2.0 license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreg-kennedy%2Fperlchess","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgreg-kennedy%2Fperlchess","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreg-kennedy%2Fperlchess/lists"}