Ax209
Member
Hi everyone. I was wondering if anyone would be kind enough to help me with this headscratcher.
I'm looking to create a puzzle in my game. I've got most of it figured out, but I simply cannot find a way to randomly generate the puzzles from the get-go.
What I'm looking to do is create a table. For example 10 x 10. Each entry in the grid can either be a 1 or a 0, positive or neveative, red or blue, whatever. Each of the 100 cells needs to randomly be one or the other, with a few caveats.
1) Each row/column must have an even amount of zeros to ones.
2) Each column must be unique in it's order to other columns (or row if it is a row).
3) Each column/row much have no more than x (probably between 2 and 4) of the same colour in it's order.
I've had a look online for algorithms to create such a board, but I've been having no luck. I can obviously handcraft a few but nowhere near enough for the amount I'd need.
If anyone can help me with this, I'd be very appreciative! Thanks in advance!
I'm looking to create a puzzle in my game. I've got most of it figured out, but I simply cannot find a way to randomly generate the puzzles from the get-go.
What I'm looking to do is create a table. For example 10 x 10. Each entry in the grid can either be a 1 or a 0, positive or neveative, red or blue, whatever. Each of the 100 cells needs to randomly be one or the other, with a few caveats.
1) Each row/column must have an even amount of zeros to ones.
2) Each column must be unique in it's order to other columns (or row if it is a row).
3) Each column/row much have no more than x (probably between 2 and 4) of the same colour in it's order.
I've had a look online for algorithms to create such a board, but I've been having no luck. I can obviously handcraft a few but nowhere near enough for the amount I'd need.
If anyone can help me with this, I'd be very appreciative! Thanks in advance!