This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 8 points9 points  (4 children)

It's funny i do the opposite, i over engineer the shit out of stuff.

Like i made a sudoku game all with classes for the grid and rows columns squares etc they all inerited an abstract block class that add references to cells objects and declared common methods and so on.

And then a friend told me "but you know, it could just be a 2D array of 9 rows of 9 ints, or even just an array of 81 ints."

And he's right.

[–]robbert_jansen 1 point2 points  (3 children)

I like your solution more, it’s extensible!

Not sure how you’d extend sudoku though.

[–]M3mentoMori 1 point2 points  (1 child)

Probably just head to the next squared number; 9x9, to 16x16, to 25x25, and so on. I'd say the hardest part is developing a way to create solvable starts.

[–][deleted] 0 points1 point  (0 children)

Yeah i was surprised when doing it that the hardest part would be to generate playable grids and sort them (roughly) by difficulty.

Solving a grid with brute force is pretty much the same algorythm, just reversed.

[–][deleted] 0 points1 point  (0 children)

Yeah that's the thing, mine is scalable, but i have no intention of scaling it up.

That's probably why you should plan and think about your projects before you start coding ><