Hey!
I'm trying to make a game but it's not really working
If I have a field in a 2x2 matrix, let's say:
Code:
XXXXXXXXXX
X X
X X
X X
X X
X X
X X
X X
X X
XXXXXXXXXX
I want to randomly add a serie of X-characters (they are walls in the game). So I can create new "maps" at random. SO for instance I could get something like:
Code:
XXXXXXXXXX
X X X
X X X
X X X
X X X X
X X X
X X X
X X X
X X X
XXXXXXXXXX
The difficult part is that there shouldn't be any 'double walls' for instance
the X in the middle would be doubled (there are other doubled positions too).
I can't seem to figure out an algorythm to check wheter or not a wall is 'doubled'. Any help?
Bookmarks