r/programmingchallenges • u/babygame • Jun 01 '11
Coloring a grid
Make a program to color in the squares of an (n x m) grid (with some number of colors > 2) such that no two same colors touch.
There is a 'brute force' way, and (at least one) more 'elegant' solution as well.
Edit: I didn't specify-- try one that will output a different pattern each time. It's a nicer problem, I think :)
20
Upvotes
View all comments
Show parent comment
1
u/StoneCypher Sep 09 '11
May I see your implementation? I suspect a bug.
I should point out that the experiment you performed is not, in fact, his original claim, nor is it my restate of his original claim.
If you're not going to read the whole thing, consider also not taking a position.