I have a matrix of size $N \times M$, There is a doll placed at $(1,1)$, which is the upper-left corner of the matrix. Two player makes an alternative turn.
If the doll is at $(x,y)$ then a player can move it to
$$ (x+1,y) \text{ or } (x-1,y) \text{ or } (x,y+1) \text{ or } (x,y-1) $$
only if the new place is not visited yet.
The one who can't make any move loses. Who will win?
My Approach: Since I can visit every place from $(1,1)$, so if $(N\cdot M)$ is odd then the second player wins; if it's even the first player wins.
Modification: If the doll is at $(x,y)$ then a player can move it to
$$ (x+1,y+1) \text{ or } (x-1,y-1) \text{ or } (x-1,y+1) \text { or } (x+1,y-1) $$ only if the new place is not visited yet.
Then who will win? Please, help me understand the two cases.