Python Forum
Sudoku Solver, please help to solve a problem.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sudoku Solver, please help to solve a problem.
#6
When your key is an index, take that as a sign that you want a list. I don't think dictionaries are a good choice for mast, gv, gvn or dc. Turning these into lists eliminates the need for count and fncount.

You don't need to use global unless you want to assign a value to a global variable. In sutcheck() you declare gv and gvn to be global, but you never assign them. You modify their contents (they are dictionaries that should be lists), but gv and gvn always reference the dictionaries created at the start of the program.

check9() should return True or False, not 'true' or 'false'. The end of check9() should be:
return totalcount == 3
Reply


Messages In This Thread
RE: Sudoku Solver, please help to solve a problem. - by deanhystad - Oct-28-2021, 03:15 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Can someone help me solve this programming problem? SuchUmami 6 1,043 Nov-20-2023, 10:01 AM
Last Post: EdwardMatthew
  A simple problem, how best to solve it? SuchUmami 2 785 Sep-01-2023, 05:36 AM
Last Post: Pedroski55
  Sudoku Solver in Python - Can someone explain this code ? qwemx 6 2,253 Jun-27-2022, 12:46 PM
Last Post: deanhystad
  How to solve this simple problem? Check if cvs first element is the same in each row? thesquid 2 1,328 Jun-14-2022, 08:35 PM
Last Post: thesquid
  How do I solve the second problem? Cranberry 1 1,191 May-16-2022, 11:56 AM
Last Post: Larz60+
  Try to solve GTG multiplication table problem. Frankduc 6 2,107 Jan-18-2022, 08:26 PM
Last Post: Frankduc
  building a sudoku solver usercat123 7 2,887 Oct-01-2021, 08:57 PM
Last Post: deanhystad
  General list size question to solve problem Milfredo 3 2,441 Sep-27-2020, 08:42 AM
Last Post: Milfredo
  unable to use result of solver in another function ross1993hall 0 1,447 Aug-10-2020, 10:29 AM
Last Post: ross1993hall
  I want to solve the following problem srisrinu 4 6,061 May-09-2020, 01:07 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020