>> Pop[index][11] = Pop[index][1]
This part is wrong. It should be:
then Pop[index][11] = 1 and fitness = 1.
Printable View
>> Pop[index][11] = Pop[index][1]
This part is wrong. It should be:
then Pop[index][11] = 1 and fitness = 1.
Perhaps i should have been more clear, but yes.
If the if statement is true, then Pop[index][11] = 1,
what i need to know is does this part work as intended:
(Grid[x-1][y] == 1)
ie Grid[4][5] equal to 1
>> (Grid[x-1][y] == 1)
Well, if x=5 and y=5, then it should work as intended.
This is a really bad idea. Although, due to the fact that && and || are sequence points, it will actually produce predictable results, it is still hard to read and thus hard to maintain.Code:if (Grid[x][++y] != 1 && Grid[x][y] != 0 /*|| Grid[x][y] != 3*/)
Just increment x/y first and then do the test.