{"id":18626903,"url":"https://github.com/kacperwyczawski/chesssharp","last_synced_at":"2026-04-15T18:01:37.669Z","repository":{"id":48211964,"uuid":"497366704","full_name":"kacperwyczawski/ChessSharp","owner":"kacperwyczawski","description":":rocket: Chess library written in C#","archived":false,"fork":false,"pushed_at":"2022-11-10T16:51:49.000Z","size":168,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-03T13:29:49.186Z","etag":null,"topics":["c-sharp","chess","nuget"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kacperwyczawski.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}},"created_at":"2022-05-28T16:08:57.000Z","updated_at":"2023-03-21T08:23:35.000Z","dependencies_parsed_at":"2023-01-22T00:01:02.801Z","dependency_job_id":null,"html_url":"https://github.com/kacperwyczawski/ChessSharp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kacperwyczawski/ChessSharp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kacperwyczawski%2FChessSharp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kacperwyczawski%2FChessSharp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kacperwyczawski%2FChessSharp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kacperwyczawski%2FChessSharp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kacperwyczawski","download_url":"https://codeload.github.com/kacperwyczawski/ChessSharp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kacperwyczawski%2FChessSharp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31853279,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"ssl_error","status_checked_at":"2026-04-15T15:24:39.138Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["c-sharp","chess","nuget"],"created_at":"2024-11-07T04:39:29.212Z","updated_at":"2026-04-15T18:01:37.648Z","avatar_url":"https://github.com/kacperwyczawski.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ♟️ ChessSharp\n\n![GitHub](https://img.shields.io/github/license/kacperwyczawski/ConsoleChess)\n\n## :toolbox: *Work In Progress*\n\n- [x] working chess board representation\n- [ ] full move validation and checkmate/stalemate detection\n- [ ] fairy pieces\n- [ ] chess variants\n- [ ] chess AI\n\n### Additional:\n\n- [ ] example working implementation\n\n## :hammer_and_wrench: How to use\n\n### Regular chess\n\n```csharp\nusing ChessSharp;\n\n// create a new game\nvar game = new ChessGame\n(\n    // add players\n    new Player(\"P1\", Color.Blue, AttackDirection.North),\n    new Player(\"P2\", Color.Red, AttackDirection.South)\n);\n\nwhile (!game.IsOver)\n{\n    // get board and do something with it (display it, etc.)\n    _ = game.Board;\n    \n    // get current player name and do whatever you want with it\n    _ = game.CurrentPlayer.Name;\n    \n    // ask user for coordinates of piece and get piece from that coordinates\n    // for example user entered 0, 1\n    var selectedPiece = game.Board[0, 1].Piece\n                        ?? throw new Exception(\"There is no piece under given coordinates\");\n                        \n    // now you can get and for example display valid moves for that piece\n    var moves = selectedPiece.GetValidMoves();\n    \n    // and finally you can execute that move, like this:\n    moves\n        .ElementAt(new Random().Next(moves.Count()))\n        .ExecuteMove();\n        \n    // or like this, using coordinates\n    moves.First(m =\u003e m.DestinationCell is { X: 0, Y: 3 }).ExecuteMove();\n    \n    // or even like this (probably most readable)\n    var selectedCell = game.Board[0, 3];\n    moves.First(m =\u003e m.DestinationCell == selectedCell).ExecuteMove();\n}\n\n// display result of the game\nConsole.WriteLine(game.Winner is not null ? $\"{game.Winner.Color} player won!\" : \"Stalemate!\");\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkacperwyczawski%2Fchesssharp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkacperwyczawski%2Fchesssharp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkacperwyczawski%2Fchesssharp/lists"}