I’ve been working on the Sudoku Solver project for the last several weeks, and have finally made a good amount of progress.
For some reason, however, I can’t get these two tests to pass:
(I’m pretty sure the error messages are because I haven’t written the unit tests or functional tests as I’ve seen a similar error on previous FCC projects.)
#1: " The return value from the
/api/check will be an object containing a
valid property, which is
true if the number may be placed at the provided coordinate and
false if the number may not. If false, the returned object will also contain a
conflict property which is an array containing the strings
"column" , and/or
"region" depending on which makes the placement invalid."
#2 : " If
value submitted to
/api/check is already placed in
puzzle on that
coordinate , the returned value will be an object containing a
valid property with
value is not conflicting."
Any insights into mistakes I’ve made or how the behavior of the app needs to change to get these “/api/check” tests to pass would be very much appreciated.
Live App URL: https://FCC-Sudoku-Solver.camchardukian.repl.co
Project Repository: GitHub - camchardukian/FCC-Sudoku-Solver
What happens if you edit your
/api/check route or the route controller or the solving function to log your inputs and outputs to the console as you run the fCC tests against your project?
Hey Jeremy I tried your idea and this is what I got:
First, you are returning
conflicts in your JSON instead of
conflict. That is at least part of the problem in the second input/output pair.
Second, the third pair with coordinate C3 is returning
false but the test is expecting
true. If I’m using the correct coordinate system C3 in the given puzzle is 2 (3 right, 3 down from top-left, upper left region) and is the only one in that region, so you need to check the implementation of your region test.
Also, you can just post the errors as text in a code block instead of an image. It helps with readability and copying/pasting/quoting.
Your comment was very helpful. Thank you very much for sharing your advice and debugging tips. I have solved this issue. Now, on to the functional tests and unit tests for this project!
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.