Giter Club home page Giter Club logo

kenken's People

Contributors

sven-oly avatar

Stargazers

 avatar

Watchers

 avatar

kenken's Issues

Solver yields wrong/incorrect solution

Due to two bugs in the code, the solver (1) gives the wrong solution to some puzzles, and (2) declares some puzzles solved when they are not.

(1) The problem is in line 194 & 195 of kenken.py; it should read int(...) rather than round(...). Try round(6 / 4) and you'll see why 6 & 4 is a mistaken solution to a 2/ cage.

(2) In check_done(), line 656, the test should be

    if len(cell.possibles) > 1 or len(cell.possibles) == 0:

to prevent a mis-declaration of a solution.

Show each reduction step in detail as an option

Give the details of when and how each set of possible values is reduced, e.g., a singleton removes that value from all others in that row/column. Two equivalent doubles allow removal of those values from others. Same for triples, quadruples, etc.

Can't solve this 9x9 puzzle

There's a problem setting the initial configuration, e.g., top row, 3+ cage.

{"width":9,"height":9,"values":[1,2,3,4,5,6,7,8,9],"rules":[{"op":"/","value":3,"cells":[{"x":0,"y":0},{"x":0,"y":1}]},{"op":"-","value":5,"cells":[{"x":1,"y":1},{"x":2,"y":1}]},{"op":"","value":336,"cells":[{"x":3,"y":0},{"x":4,"y":0},{"x":5,"y":0}]},{"op":"+","value":3,"cells":[{"x":6,"y":0},{"x":7,"y":0}]},{"op":"+","value":15,"cells":[{"x":8,"y":0},{"x":7,"y":1},{"x":8,"y":1},{"x":8,"y":2}]},{"op":"-","value":1,"cells":[{"x":5,"y":1},{"x":6,"y":1}]},{"op":"-","value":3,"cells":[{"x":3,"y":1},{"x":4,"y":1}]},{"op":"-","value":2,"cells":[{"x":0,"y":2},{"x":1,"y":2}]},{"op":"-","value":2,"cells":[{"x":2,"y":2},{"x":3,"y":2}]},{"op":"+","value":17,"cells":[{"x":4,"y":2},{"x":4,"y":3}]},{"op":"","value":6,"cells":[{"x":5,"y":2},{"x":5,"y":3}]},{"op":"-","value":8,"cells":[{"x":6,"y":2},{"x":6,"y":3}]},{"op":"-","value":2,"cells":[{"x":7,"y":2},{"x":7,"y":3}]},{"op":"+","value":15,"cells":[{"x":8,"y":3},{"x":8,"y":4},{"x":8,"y":5}]},{"op":"","value":405,"cells":[{"x":8,"y":6},{"x":7,"y":7},{"x":8,"y":7},{"x":8,"y":8}]},{"op":"","value":56,"cells":[{"x":5,"y":7},{"x":6,"y":7}]},{"op":"-","value":2,"cells":[{"x":6,"y":8},{"x":7,"y":8}]},{"op":"+","value":14,"cells":[{"x":3,"y":8},{"x":4,"y":8},{"x":5,"y":8}]},{"op":"/","value":3,"cells":[{"x":1,"y":8},{"x":2,"y":8}]},{"op":"-","value":4,"cells":[{"x":0,"y":7},{"x":0,"y":8}]},{"op":"-","value":1,"cells":[{"x":0,"y":6},{"x":1,"y":6}]},{"op":"-","value":8,"cells":[{"x":1,"y":7},{"x":2,"y":7}]},{"op":"/","value":3,"cells":[{"x":3,"y":7},{"x":4,"y":7}]},{"op":"/","value":2,"cells":[{"x":2,"y":6},{"x":3,"y":6}]},{"op":"/","value":2,"cells":[{"x":4,"y":5},{"x":4,"y":6}]},{"op":"/","value":4,"cells":[{"x":5,"y":5},{"x":5,"y":6}]},{"op":"-","value":5,"cells":[{"x":6,"y":5},{"x":6,"y":6}]},{"op":"-","value":3,"cells":[{"x":7,"y":5},{"x":7,"y":6}]},{"op":"-","value":5,"cells":[{"x":6,"y":4},{"x":7,"y":4}]},{"op":"+","value":12,"cells":[{"x":4,"y":4},{"x":5,"y":4}]},{"op":"+","value":13,"cells":[{"x":3,"y":3},{"x":3,"y":4},{"x":3,"y":5}]},{"op":"","value":72,"cells":[{"x":2,"y":3},{"x":2,"y":4},{"x":2,"y":5}]},{"op":"","value":80,"cells":[{"x":1,"y":3},{"x":1,"y":4},{"x":1,"y":5}]},{"op":"+","value":13,"cells":[{"x":0,"y":3},{"x":0,"y":4},{"x":0,"y":5}]},{"op":"-","value":4,"cells":[{"x":1,"y":0},{"x":2,"y":0}]}]}

Work to solve with deeper guessing logic

Current guessing only goes to on level of guesses of cells with 2 possible values. This could be extended to push a second guess in another cell, and possibly more.

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.