{"id":22654459,"url":"https://github.com/andrewjh271/chess","last_synced_at":"2025-09-02T19:33:32.851Z","repository":{"id":139233096,"uuid":"273336310","full_name":"andrewjh271/chess","owner":"andrewjh271","description":"Command line chess program written in Ruby","archived":false,"fork":false,"pushed_at":"2024-04-17T01:07:13.000Z","size":12688,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-31T22:26:34.314Z","etag":null,"topics":["alphabeta-minimax-search","alphabeta-pruning","chess","game","minimax-algorithm","regexp","rspec","ruby"],"latest_commit_sha":null,"homepage":"https://andrewjh271.github.io/chess/","language":"Ruby","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/andrewjh271.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-18T20:43:40.000Z","updated_at":"2023-11-30T11:20:59.000Z","dependencies_parsed_at":"2024-04-17T02:29:22.593Z","dependency_job_id":null,"html_url":"https://github.com/andrewjh271/chess","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/andrewjh271/chess","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewjh271%2Fchess","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewjh271%2Fchess/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewjh271%2Fchess/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewjh271%2Fchess/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrewjh271","download_url":"https://codeload.github.com/andrewjh271/chess/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewjh271%2Fchess/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268339882,"owners_count":24234612,"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-08-02T02:00:12.353Z","response_time":74,"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":["alphabeta-minimax-search","alphabeta-pruning","chess","game","minimax-algorithm","regexp","rspec","ruby"],"created_at":"2024-12-09T09:50:36.838Z","updated_at":"2025-08-02T06:07:38.220Z","avatar_url":"https://github.com/andrewjh271.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chess\n\nCommand line chess program written in Ruby.\n\n------\n\n[Standard Algebraic Notation](https://en.wikipedia.org/wiki/Algebraic_notation_(chess)) with [PGN](https://en.wikipedia.org/wiki/Portable_Game_Notation) standards is used for both display and input. A few clarifying notes regarding input:\n\n- A move that comes with check or checkmate should have + or #, respectively, appended to the end of the input, but this is not required. The move list will show the symbols regardless.\n- O-O and O-O-O are used for castling (the letter, not zero)\n- En passant capture is entered as if capturing a pawn that had only moved 1 square (no e.p. at end)\n- Disambiguation is required if more than one of the specified piece can move to the target square (e.g. Nbd2 to specify that the Knight on the b-file is meant to move to d2; R1e1 to specify that the Rook on  the 1st rank is meant to move to e1)\n- Promote a pawn to a Queen, Rook, Bishop, or Knight by appending to the move =Q, =R, =B, or =N, respectively\n\nEnforces the rules of chess, including:\n\n- King cannot move into or ignore check\n- Castling is only legal if:\n  - King is not in check\n  - Neither piece has moved\n  - King will not move into check along the path to its destination square\n- En passant is only legal immediately following opponent's two-square pawn move\n- Checkmate if player to move has no legal moves and their King is in check\n- Stalemate if player to move has no legal moves and their King is not in check\n- Threefold repetition if position has occured three times, including the following considerations:\n  - Same player to move\n  - Same castling rights\n  - Same en passant rights\n- Draw if during the last 50 moves no capture or pawn move has occurred\n- Draw if insufficient mating material\n\nUser can enter any of the following commands instead of a move:\n\n- **help** - show commands\n- **flip** - flip board\n- **draw** - offer opponent a draw (the engine will never accept a draw offer)\n- **resign** (the engine will never resign)\n- **quit** (alias: **exit**)\n- **save**\n- **tutorial** - shows instructions and examples on inputting moves\n\nA note on display: the pieces are tragically small, but can get a bit larger depending on the font in terminal.\n\n------\n\nThe chess engine uses a minimax algorithm with alpha beta pruning, but only very modest depths are searched within a reasonable amount of time. A collection of about 4,500 games by [Victor Korchnoi](https://en.wikipedia.org/wiki/Viktor_Korchnoi) is used as the opening database. (Note: The engine depth on Repl.it is by necessity set particularly low.)\n\n![engine](public/chess_engine.gif)\n\n------\n\nThere is an option to play through games from a handful of major chess events over the last half century. When in this mode, there are the following 4 controls:\n\n- **m** - enter next move\n- **p** - play all moves at a moderate tempo (every 2 seconds)\n- **z** - zoom through moves at a brisk tempo (every 0.2 seconds)\n- **q** - quit\n\n![game_viewer](public/game_viewer.gif)\n\n-Andrew Hayhurst","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewjh271%2Fchess","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewjh271%2Fchess","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewjh271%2Fchess/lists"}