A little help with arrays..
I am writing a program that an ace is moving randomly in a 5x5 zero-array and filling aces on its way.
So the ace moves randomly and can move only to a neighbor tile which is not 1 (an ace can not move to the same tile twice)
My problem is how can I detect when an ace is surrounded with aces and cannot move further?
I tried the following but didnt work because was out of bounds for the cases that the ace was at the boundaries of the array
if ( box[x+1][x+0]!=0
Tnx a lot!!!