use math and algorithms (and C++) to make sudoku, my fav game :D
use math and algorithms (and C++) to make sudoku, my fav game :D
Now there is HARD 6x6 sudoku generation too! (alongside MEDIUM and EASY).
i doubt it’s hard, but it’s 6x6 sudoku so what can i expect lol?
i had tooo many errors, especially with loops. Next im going to make this generator faster, next im going to visualize it yaya :D
here is a hard 6x6 sudoku puzzle :0
Log in to leave a comment
I replaced naive backtracking with constraint-based solving >w<
Before, the generator would place a number into a cell (like at (r, c)), check if it’s valid, and if not, backtrack and brute-try every number from 1 to 6.
Now it first figures out which numbers actually make sense for that cell and only tries those. No more pointless checks. It’s faster, cleaner, and way smarter :3
Here’s a 6x6 sudoku, try it, it’s fun :D
Log in to leave a comment
Fixed the bug (turns out I was using the same rng every time), so I kept getting identical puzzles. Now that’s sorted, and I’ve upgraded the whole thing. I’m using bitmasks now, which makes the generator faster than before (wayyy faster), plus I tossed in a few extra improvements :D
Testing it was actually pretty fun — the puzzles I’m getting all have unique solutions. This is a 6×6 Sudoku generator (grid is either 2×3 or 3×2), so naturally I had to try giving it some cursed dimensions like 3×3, 4×8, etc… just to see what happens hehehe
This is the answer I got: (this was funniest part lol)
It crashes and outputs nth js in one case: 3x3 ⬇️
Log in to leave a comment
I think I broke smth when I tided the code a lil, idk Im rlly sleepy so Good Night People UwU
Gotta fix the code (tmr)
Here’s a 6x6 (3, 2) sudoku enjoy solving it Ov<*
I think the 6x6 sudoku generator is ready, all I have to do is to:
Then I can commit it OwO
Here (down ⬇️) is an easy 6x6 sudoku (3, 2) with solution
Log in to leave a comment
So, uhem uhem, I’ve wasted an hour trying to figure out why I get these red lines in my code even tho everything is right, no syntax errors, but VS Code keeps showing up these red lines. The code compiles and works perfectly, whyyyy the red linessss. And because I have OCD, I couldn’t work. It seems like the problem is from VS Code, so I installed Dev cpp, but tbh it sucks, like all cpp editors. Now I gave up (temporarily), gonna js work on my proj till I figure it out.
I coded the 4x4 sudoku generator like 2 months ago, now I’m working on the 6x6 sudoku generator :D
Log in to leave a comment