Sign in to follow this  
Mad_Coder

Project Design Flaws

Recommended Posts

I been wrtiing a projet to brute force solve a sudoku puzzle: http://gamdev.pastebin.com/d22d6d200 I can't figure out why the Sudoku::cUpdate::candidates() function fails to set numbers that are not candidates fo the square on call to checkColumnCandidates(rSquare,c,cand); on line 318. What I am more worried about it organizaing my classes so their is more order to one class doing most stuff like the cSquare class objects for the 81 squares upated itself without calling another update object. Also The odd way I pass parameters to dertermine which row and column I am refering to in funcitons like checkColumnCandidates() and checkRowCandidates() is a little bit confusing an leads to overall confusion. Please give me some hints on how I could redo my design of the project!

Share this post


Link to post
Share on other sites
Solving Su Doku is a simple problem, as long as you write the solving algorithm down on paper before translating it into code.

Also make sure that your translation techniques are solid. For instance, it's easier to deal with one-dimensional data in C++ than two-dimensional data. So, converting iterations of the form "traverse all squares" and "find a square that" into one-dimensional iterations is always a good strategy.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this