{"id":19060335,"url":"https://github.com/martian56/ChessGame","last_synced_at":"2025-09-07T08:31:54.017Z","repository":{"id":212468709,"uuid":"726897780","full_name":"martian58/ChessGame","owner":"martian58","description":"Chess Game with python.","archived":false,"fork":false,"pushed_at":"2024-02-12T21:16:40.000Z","size":10,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-09T00:14:32.573Z","etag":null,"topics":["chess","chess-wit-python","python-chess","text-based-chess"],"latest_commit_sha":null,"homepage":"","language":"Python","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/martian58.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}},"created_at":"2023-12-03T18:11:38.000Z","updated_at":"2024-11-07T18:39:58.000Z","dependencies_parsed_at":"2024-02-03T21:25:28.323Z","dependency_job_id":"77e0331d-2bb4-4cd5-9ea5-da972fb4a29b","html_url":"https://github.com/martian58/ChessGame","commit_stats":null,"previous_names":["martian58/chessgame"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martian58%2FChessGame","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martian58%2FChessGame/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martian58%2FChessGame/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martian58%2FChessGame/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/martian58","download_url":"https://codeload.github.com/martian58/ChessGame/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232194232,"owners_count":18486521,"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-wit-python","python-chess","text-based-chess"],"created_at":"2024-11-09T00:14:51.885Z","updated_at":"2025-09-07T08:31:48.749Z","avatar_url":"https://github.com/martian58.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"###                                                  ChessGame \n\n#### 1. Overview:\n   - **Code Name:** ChessGame\n   - **Purpose:** Implements a two-player command-line chess game in Python.\n\n#### 2. Class and Methods:\n   - **Class:** `ChessGame`\n   - **Methods:**\n     - `__init__(self)`: Initializes the chess game with an 8x8 chessboard and sets initial player and game state.\n     - `create_board(self)`: Creates the initial 8x8 chessboard with piece positions.\n     - `display_board(self)`: Displays the current state of the chessboard.\n     - `make_move(self, move)`: Processes a player's move and updates the board.\n     - `is_valid_move(self, start_col, start_row, end_col, end_row)`: Validates if a move adheres to chess rules.\n     - Various methods for validating moves of different chess pieces.\n     - `no_obstacles(self, start_row, start_col, end_row, end_col)`: Checks if there are obstacles between two positions.\n     - `get_king_position(self, player)`: Retrieves the position of the king for the specified player.\n     - `is_check(self, player)`: Checks if the player's king is in check.\n     - `is_checkmate(self, player)`: Determines if the player is in checkmate.\n     - `play_game(self)`: Initiates the game loop, allowing players to make moves until checkmate.\n\n#### 3. Execution:\n   - The game is initiated by creating an instance of `ChessGame` and calling the `play_game` method.\n   - Players take turns entering moves in standard chess notation (e.g., 'e2 e4').\n   - The game continues until one player achieves checkmate, and the winner is announced.\n\n#### 4. Check and Checkmate:\n   - The code includes methods (`is_check` and `is_checkmate`) to determine if a player's king is in check or checkmate.\n\n#### 5. Conclusion:\n   - The code successfully implements a basic two-player chess game with command-line interaction.\n   - It provides a foundation for further improvements, such as code readability and additional features.\n\n#### 6. Recommendations for Improvement:\n   - Add comments for better code readability.\n   - Refactor to eliminate code duplication, particularly in the checkmate detection block.\n   - Implement input validation to ensure moves are in the correct format.\n   - Consider breaking down the code into smaller, more focused methods for improved modularity.\n\n#### 7. Usage:\n   - Execute the code to start the chess game.\n   - Follow the prompts to enter moves in standard chess notation.\n\n   \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartian56%2FChessGame","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmartian56%2FChessGame","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartian56%2FChessGame/lists"}