{"id":16676997,"url":"https://github.com/abcaeffchen/sudoku-php","last_synced_at":"2025-10-07T20:58:20.030Z","repository":{"id":56939212,"uuid":"54722910","full_name":"AbcAeffchen/sudoku-php","owner":"AbcAeffchen","description":"Generate random Sudokus of different size and difficulty and check the solution.","archived":false,"fork":false,"pushed_at":"2023-04-05T12:20:17.000Z","size":18,"stargazers_count":10,"open_issues_count":1,"forks_count":9,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T23:16:23.492Z","etag":null,"topics":["php","sudoku"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AbcAeffchen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["AbcAeffchen"]}},"created_at":"2016-03-25T14:12:52.000Z","updated_at":"2023-12-13T05:29:50.000Z","dependencies_parsed_at":"2025-02-15T22:31:37.967Z","dependency_job_id":"98967a42-f2dc-4337-b0a7-ad1bae8fbde4","html_url":"https://github.com/AbcAeffchen/sudoku-php","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbcAeffchen%2Fsudoku-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbcAeffchen%2Fsudoku-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbcAeffchen%2Fsudoku-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbcAeffchen%2Fsudoku-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AbcAeffchen","download_url":"https://codeload.github.com/AbcAeffchen/sudoku-php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248113189,"owners_count":21049801,"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":["php","sudoku"],"created_at":"2024-10-12T13:24:51.234Z","updated_at":"2025-10-07T20:58:19.955Z","avatar_url":"https://github.com/AbcAeffchen.png","language":"PHP","funding_links":["https://github.com/sponsors/AbcAeffchen"],"categories":[],"sub_categories":[],"readme":"sudoku-php\n=====\n\n[![Unit Tests](https://github.com/AbcAeffchen/sudoku-php/actions/workflows/php.yml/badge.svg)](https://github.com/AbcAeffchen/sudoku-php/actions/workflows/php.yml)\n[![Latest Stable Version](https://poser.pugx.org/abcaeffchen/sudoku-php/v/stable.svg)](https://packagist.org/packages/abcaeffchen/sudoku-php) \n[![Total Downloads](https://poser.pugx.org/abcaeffchen/sudoku-php/downloads.svg)](https://packagist.org/packages/abcaeffchen/sudoku-php) \n[![License](https://poser.pugx.org/abcaeffchen/sudoku-php/license.svg)](https://packagist.org/packages/abcaeffchen/sudoku-php)\n\nGenral\n-----\nGenerate random Sudokus of different size and difficulty and check the solution. Features:\n\n- Choose from the following sizes: 4, 9, 16, 25, 36.\n- Choose from fife degrees of difficulty.\n- Sudokus are reproducible via a integer seed.\n- Check if a input is a solution of any Sudoku or a solution to a specific task.\n- Solve Sudokus.\n- works with PHP 7.4 up to 8.2 (maybe also work with PHP \u003c 7.4, but these versions are not supported anymore)\n- backend only, so you can build your own frontend however you like it.\n\nInstallation\n-----\nYou can install this via composer using\n```json\n{\n    \"require\": {\n        \"abcaeffchen/sudoku-php\": \"~1.1.0\"\n    }\n}\n```\nor just download the `Sudoku.php` file and include it to your project. \nMake sure to use the namespace `AbcAeffchen\\sudoku`.\n\nHow to use\n------\n#### Generate a task\n```\nuse AbcAeffchen\\sudoku\\Sudoku;\n$task = Sudoku::generate(9, Sudoku::NORMAL);\n```\nGenerates a standard 9x9 Sudoku with normal difficulty. You can use the difficulties \n`VERY_EASY`, `EASY`, `NORMAL`, `MEDIUM`, `HARD`.\n\n`$task` contains a two dimensional array of integers, where the gaps are set to `null`. \nYou can use \n```\nlist($task,$solution) = Sudoku::generateWithSolution(9, Sudoku::NORMAL)\n```\nto generate a task and a possible solution. Maybe to give hints?\n\nYou can reproduce the Sudoku by providing a seed.\n```\n$seed = 0;\n$task = Sudoku::generate(9, Sudoku::NORMAL, $seed);\n```\nThis way cou could store a seed seed and reproduce the task at any time.  \nThe seed can be any positive integer.\n\n#### Check a solution\n\nYou can check a solution by using\n```\nif(Sudoku::checkSolution($solution))\n{\n    echo 'Nice done!';\n}\nelse\n{\n    echo 'Try again!';\n}\n```\n\nIf you also want to also check if the solution relates to the task, you can just also provide the task like this:\n```\nif(Sudoku::checkSolution($solution,$task))\n    ...\n```\n\n#### Solve Sudokus\n\nThis function is used to generate the Sudokus, but you can also use it to solve some you generated by hand (or get it from somewhere else).\n```\n$solution = Sudoku::solve($task);\n```\nYou only have to make sure, that `$task` is a two dimensional int array containing only numbers \nfrom 1 to the size and all gaps contain `null`.\n\nLicense\n----\nLicensed under the LGPL v3.0 License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabcaeffchen%2Fsudoku-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabcaeffchen%2Fsudoku-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabcaeffchen%2Fsudoku-php/lists"}