So using the same algorithm I changed the variable from 9 to 16. Which suprisingly worked right away. This however takes almost a full minute. I’m working on a better appoach the results of which will be uploaded. It is possible with this algorithm to be able to create any size Sudoku puzzle having a whole number when the square root is taken.
I have added a method to solve puzzles utilizing the same method I already wrote to generate Sudoku puzzles. So now we can solve them given information. It is cool to watch when given just a little bit of information how many combinations there are. This function basically generates the board and removes the row, cell, and 3×3 options before calling the solve/generate method. Kind of nice to have the same algorithm solve and generate puzzles.
So last night I got this bright idea to create my own Sudoku generator. The first iteration it randomly generated the first row and for each row after that it kept generating random arrays until they fit. This worked for some cases but failed more times that not. In addition processing time became an issue.
I then tried to create the puzzles using a brute force methodology. This worked but I noticed that some 3×3 sections were not correct or had repeating numbers.
Finally, I created a loop and a method that seemed to work. There were however occasions (not sure why I think it has to do with some inconsistencies in PHP) where it would fail. So, I built a simple row check that told the program to re-run itself when it failed. The result a simple PHP class that generates Sudoku puzzles in record time. It uses recursion to eliminate certain rows combinations.
I’ve posted the puzzle page for printing… I’m working on a web based puzzle version. I also posted a debug version that shows the algorithm step by step… the max number of re-runs I’ve seen is five if your playing with it and see more than that I would love to know.
Enjoy…
So I figured out a way to recreate the same stuff Google, YouTube, and BroadRamp are doing only using free and open source software.
- ffmpeg
- For conversion from to FLV
- flvmdi
- To add the XML so it streams
- FlowPlayer
- To play the videos once converted
Normally I just convert a couple of times to be able to eventually convert to FLV from my original format. Recently I found a Windows
tool called SUPER that does a great job converting the video. Now all I have to do is run the file through the gui version of flvmdi. Done.
Check out my results at my own video player.