#๐Ÿ”’ This code is driving me bonkers

15 messages ยท Page 1 of 1 (latest)

formal masonBOT
#

@marsh patio

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

marsh patio
#

Code and Guidline on top ^

void turtle
#

Is that a pasting issue or are you indenting everything like that?

delicate quest
#

Should be 4 spaces for each indentation level, but yeah there are simply missing

marsh patio
#

No identing issue, it just pasted weird, Pycharm can fix it anyways

#

Is there a problem with my code, or is it the Sudoku library fault

#

tell me if you have any issue

#

Issue: whenever I run my code it always leaves 3 empty cells. For the project I have to implement uninformed and informed search strategies to solve sudoku puzzles. I have to expand the initial state, pick an empty cell in the grid and fill it with a number between one and four. Filling in numbers in the empty states is the only available action for this problem. While expanding a node, I have to add nodes corresponding to all possible states from the current state for every empty cell, even nodes corresponding to invalid states in sudoku. a) Breadth-first search (bfs): maintain a FIFO queue for the frontier; refer to the queue in-built library in Python.
b)Depth-first search (dfs): maintain a LIFO queue for the frontier;
refer to the queue in-built library in Python. Both implementations should use the graph search version, and goal verification should be
done before adding a node to the queue. For the next
two implementations, I have to reimplement the breadth-first and depth-first searches
accounting for invalid states.
c) Breadth-first search with pruning (bfs_pruning): Same as bfs, except if an
expanded node is invalid, will not add it to the frontier. can check the validity
of a puzzle board using the function valid_puzzle(). d) Depth-first search with pruning (dfs_prning): Same as dfs, except if an
expanded node is invalid, will not add it to the frontier. can check the validity
of a puzzle board using the function valid_puzzle().

Github for Sudoku: https://github.com/jeffsieu/py-sudoku/tree/master

GitHub

A Python Sudoku solver. Contribute to jeffsieu/py-sudoku development by creating an account on GitHub.

sage cradle
#

oooo this looks interesting

#

right now i'm busy playing games but i'd love to help you figure this out

#

so feel free to message me directly, i may have free time later

marsh patio
#

Okay, np

formal masonBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.