{"id":25065688,"url":"https://github.com/programming-sai/sudoku","last_synced_at":"2025-03-31T13:27:55.537Z","repository":{"id":245751116,"uuid":"819125725","full_name":"Programming-Sai/Sudoku","owner":"Programming-Sai","description":null,"archived":false,"fork":false,"pushed_at":"2024-06-23T21:37:27.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-06T19:49:00.910Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/Programming-Sai.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":"2024-06-23T21:10:49.000Z","updated_at":"2024-11-11T10:54:45.000Z","dependencies_parsed_at":"2024-06-23T22:43:06.061Z","dependency_job_id":null,"html_url":"https://github.com/Programming-Sai/Sudoku","commit_stats":null,"previous_names":["programming-sai/sudoku"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Programming-Sai%2FSudoku","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Programming-Sai%2FSudoku/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Programming-Sai%2FSudoku/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Programming-Sai%2FSudoku/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Programming-Sai","download_url":"https://codeload.github.com/Programming-Sai/Sudoku/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246473305,"owners_count":20783244,"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":[],"created_at":"2025-02-06T19:44:46.285Z","updated_at":"2025-03-31T13:27:55.495Z","avatar_url":"https://github.com/Programming-Sai.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Sudoku Game\n\nWelcome to the Sudoku game implemented in Python. This project includes a Sudoku board generator and a game interface that allows users to play Sudoku, validate moves, and see possible moves for each cell.\n\n\n## Installation\n\n1. Clone the repository:\n   ```sh\n   git clone https://github.com/Programming-Sai/Sudoku.git\n   ```\n2. Navigate to the project directory:\n   ```sh\n   cd Sudoku\n   ```\n3. Run the game:\n   ```sh\n   python Sudoku_Game.py\n   ```\n\n\n## Features\n\n- **Board Generation**: Automatically generates a complete and valid Sudoku board.\n- **Puzzle Creation**: Creates a playable Sudoku puzzle by removing random numbers from the completed board.\n- **User Interaction**: Allows users to input values, see possible moves, and validate their moves.\n- **Game Validation**: Checks for duplicate values in rows, columns, and subgrids to ensure the board remains valid.\n- **Help Option**: Provides instructions and rules for the game.\n\n## Files\n\n- `Sudoku_Board.py`: Contains the `Board` class, which defines all methods related to board generation, cell value validation, and board display.\n- `Sudoku_Player.py`: Contains the `Player` class, which defines methods for user input, move validation, and game interactions.\n- `Sudoku_Game.py`: The main game file that brings together the board and player classes to implement the Sudoku game.\n- `Game.txt`: Contains the game instructions and rules.\n- `__pycache__`: A directory created by Python to store compiled bytecode files.\n\n## How to Play\n\n1. **Run the Game**:\n   - Execute the `Sudoku_Game.py` file to start the game.\n   - You will see an initial board with some cells marked as '.' to indicate an empty cell.\n\n2. **Game Options**:\n   - Select `1` for Help: Displays the game rules and instructions.\n   - Select `2` for New Game: Starts a new Sudoku game with a randomly generated puzzle.\n\n3. **User Input**:\n   - Enter your moves in the format `column-row-action` (e.g., `a1e` to enter a value in cell (A, 1)).\n   - Actions:\n     - `e`: Enter a value.\n     - `s`: Show possible moves for the selected cell.\n\n4. **Move Validation**:\n   - The game will validate your move and inform you if it causes any clashes.\n   - You have 10 lives to complete the puzzle. Each invalid move reduces your lives.\n\n5. **Winning the Game**:\n   - Complete the puzzle without any errors to win the game.\n\n## Classes and Methods\n\n### `Board` Class\n\n- `__init__()`: Initializes an empty board and its numbers.\n- `is_duplicate_in_list(list)`: Checks for duplicates in a list.\n- `find(board, list, target)`: Searches for an element in the board.\n- `get_row(row, col)`: Gets the entire row for a given cell.\n- `get_col(row, col)`: Gets the entire column for a given cell.\n- `get_block(row, col)`: Gets the entire block for a given cell.\n- `is_valid(row, col, num, board)`: Validates the cell value.\n- `clashes(row, col, board)`: Checks for clashes and their locations.\n- `solution_board()`: Generates a complete Sudoku board.\n- `puzzle_board(board)`: Generates a puzzle board by removing numbers.\n- `is_board_complete(board)`: Checks if the board is complete.\n- `possible_moves(row, col, board)`: Returns possible values for a cell.\n- `display_board(board_1)`: Displays the board to the user.\n\n### `Player` Class\n\n- `__init__(board)`: Initializes the Board class.\n- `user_input()`: Receives and validates user input.\n- `show_possible_moves(row, col, board_2)`: Shows possible moves for a cell.\n- `enter_value(row, col, board_1, board_2, lives)`: Allows user to enter values and checks for validity.\n- `help()`: Displays the game rules and instructions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprogramming-sai%2Fsudoku","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprogramming-sai%2Fsudoku","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprogramming-sai%2Fsudoku/lists"}