{"id":13753719,"url":"https://github.com/pleco-rs/Pleco","last_synced_at":"2025-05-09T21:35:39.904Z","repository":{"id":37548351,"uuid":"91042003","full_name":"pleco-rs/Pleco","owner":"pleco-rs","description":"A Rust-based re-write of the Stockfish Chess Engine","archived":false,"fork":false,"pushed_at":"2023-03-11T18:13:35.000Z","size":1572,"stargazers_count":355,"open_issues_count":12,"forks_count":37,"subscribers_count":11,"default_branch":"main","last_synced_at":"2024-05-18T19:02:46.749Z","etag":null,"topics":["ai","board","bot","chess","chess-engine","crates","crates-io","engine","library","pleco","pleco-crate","rust","uci"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/pleco","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pleco-rs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","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":"2017-05-12T02:19:07.000Z","updated_at":"2024-08-03T09:05:52.743Z","dependencies_parsed_at":"2024-08-03T09:17:16.422Z","dependency_job_id":null,"html_url":"https://github.com/pleco-rs/Pleco","commit_stats":null,"previous_names":["sfleischman105/pleco"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pleco-rs%2FPleco","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pleco-rs%2FPleco/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pleco-rs%2FPleco/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pleco-rs%2FPleco/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pleco-rs","download_url":"https://codeload.github.com/pleco-rs/Pleco/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224884615,"owners_count":17386121,"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":["ai","board","bot","chess","chess-engine","crates","crates-io","engine","library","pleco","pleco-crate","rust","uci"],"created_at":"2024-08-03T09:01:28.196Z","updated_at":"2024-11-16T06:30:39.694Z","avatar_url":"https://github.com/pleco-rs.png","language":"Rust","funding_links":[],"categories":["Rust","Applications"],"sub_categories":["Games"],"readme":"\u003cdiv align=\"center\"\u003e\n\n[![Pleco][pleco-badge]][pleco-link]\n[![Pleco][pleco-engine-badge]][pleco-engine-link]\n\n[![Build][build-badge]][build-link]\n[![License][license-badge]][license-link]\n[![Commits][commits-badge]][commits-link]\n\n\u003c/div\u003e\n\n# Overview\n\nPleco is a chess Engine \u0026 Library derived from Stockfish, written entirely in Rust.\n\nThis project is split into two crates, `pleco`, which contains the library functionality, and `pleco_engine`, which contains the\nUCI (Universal Chess Interface) compatible engine.\n\nThe overall goal for this project is to utilize the efficiency of Rust to create a Chess AI matching the speed of modern chess engines.\nFor the engine, the majority of the code is a direct port of Stockfish's C++ code. See [their website](https://stockfishchess.org/) for\nmore information about the engine. As such, the credit for all of the advanced algorithms used for searching, evaluation,\nand many others, go directly to the maintainers and authors of Stockfish. This project is for speed comparisons\nbetween the two languages, as well as for educational purposes.\n\n- [Documentation](https://docs.rs/pleco), [crates.io](https://crates.io/crates/pleco) for library functionality\n- [Documentation](https://docs.rs/pleco_engine), [crates.io](https://crates.io/crates/pleco_engine) for the Engine.\n\n## Standalone Installation and Use\n\nTo use pleco as an executable, please [navigate to here](https://github.com/sfleischman105/Pleco/tree/main/pleco_engine) and read the `README.md`.\n\n## Using Pleco as a Library\n\nTo use pleco inside your own Rust projects, [Pleco.rs is available as a library on crates.io.](https://crates.io/crates/pleco)\nSimply include the current version in your `Cargo.toml`:\n\n```\n[dependencies]\npleco = \"x.x.x\"\n```\n\nAnd add the following to a `main.rs` or `lib.rs`:\n\n```rust\nextern crate pleco;\n```\n\nAs of version `0.5.0`, the pleco library is available on all three Rust channels (stable, beta, nightly).\n\n### Basic Usage\n\nSetting up a board position is extremely simple.\n\n```rust\nuse pleco::{Board,Player,PieceType};\n\nlet board = Board::start_pos();\nassert_eq!(board.count_piece(Player::White,PieceType::P), 8);\nassert_eq!(\u0026board.fen(),\"rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1\");\n```\n\n#### Creating a board from a Position\n\nA `Board` can be created with any valid chess position using a valid FEN (Forsyth-Edwards Notation) String.\nCheck out the [Wikipedia article](https://en.wikipedia.org/wiki/Forsyth%E2%80%93Edwards_Notation) for more information on FEN Strings\nand their format.\n\n```rust\nlet board = Board::from_fen(\"rnbqkbnr/pp1ppppp/8/2p5/4P3/8/PPPP1PPP/RNBQKBNR w KQkq c6 0 2\").unwrap();\n```\n\n#### Applying and Generating Moves\n\nMoves are represented with a `BitMove` structure. They must be generated by a `Board` object directly, to be\nconsidered a valid move. Using `Board::generate_moves()` will generate all legal `BitMove`s of the current\nposition for the current player.\n\n```rust\nuse pleco::{Board,BitMove};\n\nlet mut board = Board::start_pos(); // create a board of the starting position\nlet moves = board.generate_moves(); // generate all possible legal moves\nboard.apply_move(moves[0]);\nassert_eq!(board.moves_played(), 1);\n```\n\nWe can ask the Board to apply a move to itself from a string. This string must follow the format of a standard\nUCI Move, in the format [src_sq][dst_sq][promo]. E.g., moving a piece from A1 to B3 would have a uci string of \"a1b3\",\nwhile promoting a pawn would look something like \"e7e81\". If the board is supplied a UCI move that is either\nincorrectly formatted or illegal, false shall be returned.\n\n```rust\nlet mut board = Board::start_pos(); // create a board of the starting position\nlet success = board.apply_uci_move(\"e7e8q\"); // apply a move where piece on e7 -\u003e eq, promotes to queen\nassert!(!success); // Wrong, not a valid move for the starting position\n```\n\n#### Undoing Moves\n\nWe can revert to the previous chessboard state with a simple Board::undo_move()\n\n```rust\nlet mut board = Board::start_pos();\nboard.apply_uci_move(\"e2e4\"); // A very good starting move, might I say\nassert_eq!(board.moves_played(),1);\nboard.undo_move();\nassert_eq!(board.moves_played(),0);\n```\n\nFor more information about `pleco` as a library, see the [pleco README.md](https://github.com/sfleischman105/Pleco/tree/main/pleco).\n\n## Contributing\n\nAny and all contributions are welcome! Open up a PR to contribute some improvements. Look at the Issues tab to see what needs some help.\n\n## License\n\nThe Pleco Engine is distributed under the GNU General Public License version 3 (or any later version at your option). See [LICENSE](LICENSE) for full details.\n\nThe Pleco crate (the library functionality) is distributed under the terms of the MIT license. See [pleco/LICENSE](pleco/LICENSE) for details.\n\nOpening a pull requests is assumed to signal agreement with these licensing terms.\n\n[build-link]: https://github.com/pleco-rs/Pleco/blob/main/.github/workflows/test.yml\n[build-badge]: https://img.shields.io/github/actions/workflow/status/pleco-rs/Pleco/test.yml?branch=main\u0026style=for-the-badge\u0026label=tanton\u0026logo=github\n[license-badge]: https://img.shields.io/github/license/pleco-rs/Pleco?style=for-the-badge\u0026label=license\u0026color=success\n[license-link]: https://github.com/pleco-rs/Pleco/blob/main/LICENSE\n[commits-badge]: https://img.shields.io/github/commit-activity/m/pleco-rs/Pleco?style=for-the-badge\n[commits-link]: https://github.com/pleco-rs/Pleco/commits/main\n[pleco-badge]: https://img.shields.io/crates/v/pleco.svg?style=for-the-badge\n[pleco-link]: https://crates.io/crates/pleco\n[pleco-engine-badge]: https://img.shields.io/crates/v/pleco_engine.svg?style=for-the-badge\n[pleco-engine-link]: https://crates.io/crates/pleco_engine\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpleco-rs%2FPleco","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpleco-rs%2FPleco","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpleco-rs%2FPleco/lists"}