Skip to content

Check initial grid availability for backtracking/sudoku.py #3833

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed

Check initial grid availability for backtracking/sudoku.py #3833

wants to merge 3 commits into from

Conversation

RonDingDing
Copy link

initial_grid = [
    [3, 0, 6, 5, 0, 8, 4, 0, 0],
    [5, 2, 0, 0, 0, 0, 0, 0, 0],
    [0, 8, 7, 0, 0, 0, 0, 3, 1],
    [0, 0, 3, 0, 1, 0, 0, 8, 0],
    [9, 0, 0, 8, 6, 3, 0, 0, 5],
    [0, 5, 0, 0, 9, 0, 6, 0, 0],
    [1, 3, 0, 0, 0, 0, 2, 5, 0],
    [0, 0, 0, 0, 0, 0, 0, 7, 4],
    [0, 0, 5, 2, 0, 6, 3, 0, 0],
]

In the original code above if you change the number 9 in the fifth line to 5, you will have a solution. But that is not a valid sudoku according to the definition. That means it's not validating whether the origingal sudoku can be solved. Not to mention to put a 10 anywhere or a minus number or a float at initial matrix. In the current request, this bug is fixed.

@RonDingDing RonDingDing reopened this Oct 30, 2020
@TravisBuddy
Copy link

Travis tests have failed

Hey @RonDingDing,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

TravisBuddy Request Identifier: 2eaa63e0-1a95-11eb-ae00-6f9b88d90b9e

@TravisBuddy
Copy link

Travis tests have failed

Hey @RonDingDing,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

TravisBuddy Request Identifier: 51ba80b0-1afc-11eb-ae51-b75871e10011

@TravisBuddy
Copy link

Hey @RonDingDing,
Something went wrong with the build.

TravisCI finished with status errored, which means the build failed because of something unrelated to the tests, such as a problem with a dependency or the build process itself.

View build log

TravisBuddy Request Identifier: 1165a5e0-1b50-11eb-ae51-b75871e10011

@RonDingDing RonDingDing reopened this Oct 31, 2020
@TravisBuddy
Copy link

Hey @RonDingDing,
Something went wrong with the build.

TravisCI finished with status errored, which means the build failed because of something unrelated to the tests, such as a problem with a dependency or the build process itself.

View build log

TravisBuddy Request Identifier: 838865e0-1b50-11eb-ae51-b75871e10011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants