Code Monkey home page Code Monkey logo

sudokugen's People

Contributors

wokste avatar

Watchers

 avatar  avatar

sudokugen's Issues

requiredSquare is mandatory

In PuzzleGen::iterativeReduce the following line is meant as a speed optimization: solver.requiredSquare = Point::fromIndex(id, puzzle.width);

Unfortunately, the unoptimized code doesn't work. When commenting it out, the algorithm doesn't find any digits to remove. This bug may block #3, so it is likely that this blocks the milestone as well.

AT: 1). Commenting said line generates valid sudoku's. 2). There is a unit-test to catch the bug, if applicable.

Only valid location

I would like to add the only valid location technique to the solver. This checks what numbers in a zone can only be placed on a single square.

Benefits:

  • Sudoku's can become more challenging.
  • Grid generator will have significantly fewer contradictions.

AT: the technique is implemented and shown using a unit-test that it works.

Iteratively improve difficulty

The current sudoku's are way too easy. To solve this, I would like to:
a) Be able to rate the difficulty of a sudoku. (It doesn't have to be perfect yet).
b) Iteratively optimize a sudoku for a harder difficulty.

An iteration has the following steps:

  1. Place back a number of digits.
  2. Reduce the digits as usual.
  3. If the difficulty of the new puzzle is harder than before, replace puzzle.
  4. Repeat n times.

Filled grid generator

PuzzleGen::fillEmpty currently always outputs the same grid. While it is ok for the first tests, this has several problems. First, it is very boring. Second it limits sudoku's to 9x9 grids. To solve this, I want to generate a filled grid.

The currently suggested algorithm is:

  1. Fill grid by row.
  2. When filling the grid by row, start with the squares with the lowest number of possible digits.
  3. Run solver between each step.

Should the solver fail to generate a grid, it should return nullopt. The caller already has a retry strategy.

SVG export

I would like to show sudoku's to friends. For this, I don't want to have a console window. Instead, generate SVGs

  • For extensibility, it should be possible to add multiple exporters.
  • We should choose whether it is best using an existing XML library or make something to export svg's manually.

AT: A readable exported SVG image representing the svg.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.