{"id":38339933,"url":"https://github.com/bertoort/sugoku","last_synced_at":"2026-01-17T02:59:21.234Z","repository":{"id":54570168,"uuid":"45548474","full_name":"bertoort/sugoku","owner":"bertoort","description":"Sudoku puzzle solver and generator","archived":false,"fork":false,"pushed_at":"2024-04-13T18:03:36.000Z","size":197,"stargazers_count":122,"open_issues_count":2,"forks_count":39,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-06-11T17:10:18.038Z","etag":null,"topics":["go","puzzle"],"latest_commit_sha":null,"homepage":"https://sugoku.onrender.com/","language":"Go","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/bertoort.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":"2015-11-04T15:34:35.000Z","updated_at":"2024-04-12T17:03:44.000Z","dependencies_parsed_at":"2024-06-11T17:09:54.462Z","dependency_job_id":"5b8631cc-8b81-44c0-bb3a-9333513b869f","html_url":"https://github.com/bertoort/sugoku","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bertoort/sugoku","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertoort%2Fsugoku","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertoort%2Fsugoku/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertoort%2Fsugoku/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertoort%2Fsugoku/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bertoort","download_url":"https://codeload.github.com/bertoort/sugoku/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertoort%2Fsugoku/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28492593,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T02:39:23.645Z","status":"ssl_error","status_checked_at":"2026-01-17T02:34:19.649Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["go","puzzle"],"created_at":"2026-01-17T02:59:21.145Z","updated_at":"2026-01-17T02:59:21.219Z","avatar_url":"https://github.com/bertoort.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# suGOku\n\n![](https://pbs.twimg.com/media/Bo7fvKJIMAA0moL.png)\n\n[https://sugoku.onrender.com/](https://sugoku.onrender.com/)\n\n[Go Challenge 8](http://golang-challenge.com/go-challenge8/) solution for the month of November 2015.\n\n*The API is hosted on a [Render](https://render.com/) free tier instance. The server gets spun down with inactivity, expect a delay of 50 secs or more for the initial request. Then it's ⚡\n\n## Overview\n\nSudoku web app: solves, generates, grades, and validates sudoku puzzles.\n\nThe algorithm implements two solving functions:\n\n1. QuickFill - Called so because it quickly checks horizontally, vertically and in the nine grid box for possible options. If only one possible solution remains, it adds the value to the square.\n\n2. Guess - It fills an empty square with a possible, non-conflicting value. If the puzzle is solved (completely filled), it validates to see if it correct. If not, it goes back and fills the square with another possible value. It recursively fills in and backtracks until the puzzle is complete.\n\nA very interesting finding was that implementing the QuickFill function before each guess did not improve the speed of the algorithm, in fact, it slowed it down. I was not expecting it. I was so surprised that I decided to keep the original name I had given the function without Quickfill: SlowSolve().\n\nSlowSolve is the faster function and therefore the one used for the API.\n\n## Installation\n\n`go get github.com/bertoort/sugoku`\n\n## Technologies\n\n- [Go](https://golang.org)\n- [Gin](https://github.com/gin-gonic/gin)\n- [Semantic UI](http://semantic-ui.com/)\n- [jQuery](http://jquery.com/)\n- [Render](https://render.com/)\n- [Godep](https://github.com/tools/godep)\n\n## API\n\n### Get\n\nBoard - returns a puzzle board\n\n`https://sugoku.onrender.com/board`\n\nArguments -\n\n- Difficulty:\n  - easy\n  - medium\n  - hard\n  - random\n\nExample:\n\n    https://sugoku.onrender.com/board?difficulty=easy\n\n### Post\n\nSolve - returns the solved puzzle, along with difficulty and status\n\n`https://sugoku.onrender.com/solve`\n\nGrade - returns the difficulty of the puzzle\n\n`https://sugoku.onrender.com/grade`\n\nValidate - returns the status of the puzzle\n\n`https://sugoku.onrender.com/validate`\n\n### NOTE:\n\nThe request does not support content-type of `application/json`. It must be `application/x-www-form-urlencoded`\n\nTo help, here is a quick and dirty encoding functions for a board:\n\n```\nconst encodeBoard = (board) =\u003e board.reduce((result, row, i) =\u003e result + `%5B${encodeURIComponent(row)}%5D${i === board.length -1 ? '' : '%2C'}`, '')\n\nconst encodeParams = (params) =\u003e\n  Object.keys(params)\n  .map(key =\u003e key + '=' + `%5B${encodeBoard(params[key])}%5D`)\n  .join('\u0026');\n```\n\nHere is an example sending a board:\n\n```\nconst data = {board:[[0,0,0,0,0,0,8,0,0],[0,0,4,0,0,8,0,0,9],[0,7,0,0,0,0,0,0,5],[0,1,0,0,7,5,0,0,8],[0,5,6,0,9,1,3,0,0],[7,8,0,0,0,0,0,0,0],[0,2,0,0,0,0,0,0,0],[0,0,0,9,3,0,0,1,0],[0,0,5,7,0,0,4,0,3]]}\n\nfetch('https://sugoku.onrender.com/solve', {\n  method: 'POST',\n  body: encodeParams(data),\n  headers: { 'Content-Type': 'application/x-www-form-urlencoded' }\n})\n  .then(response =\u003e response.json())\n  .then(response =\u003e console.log(response.solution))\n  .catch(console.warn)\n```\n\n##### jQuery Example:\n\n````\nvar data = {\n  board: \"[[0,0,1,0,0,0,0,0,0],\n          [2,0,0,0,0,0,0,7,0],\n          [0,7,0,0,0,0,0,0,0],\n          [1,0,0,4,0,6,0,0,7],\n          [0,0,0,0,0,0,0,0,0],\n          [0,0,0,0,1,2,5,4,6],\n          [3,0,2,7,6,0,9,8,0],\n          [0,6,4,9,0,3,0,0,1],\n          [9,8,0,5,2,1,0,6,0]]\"\n}\n$.post('https://sugoku.onrender.com/solve', data)\n  .done(function (response) {\n\n    \u003c% response = {\n      difficulty: \"hard\",\n      solution: Array[9],\n      status: \"solved\"\n    } \u0026\u003e\n\n  });```\n\nFor more, check out the [api.js](https://github.com/bertoort/sugoku/blob/master/public/api.js) file\n````\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbertoort%2Fsugoku","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbertoort%2Fsugoku","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbertoort%2Fsugoku/lists"}