between one statment and the other in the if, try using brackets example:
if ( (x=2) || (y=3) || (f=2) ) ....
that could be one problem
the other can be that i am not sure if the program accepts (!= '#') as a stamtent. not sure about that tough. the other thing is u better check the || and && because u need to understand the logic, not the english.
hope it helps
ZaTTaRa
QUOTE(kckc314 @ 8 May, 2008 - 10:34 PM)

what's the errors in this code?
CODE
if (c < dCol && ((sq[r][c + 1] != '#' && sq[r][c + 1] != ' ') || (sq[r - 1][c] != '#' && sq[r - 1][c] != ' ') ||
(sq[r][c - 1] != '#' && sq[r][c - 1] != ' ') || (sq[r + 1][c] != '#' && sq[r + 1][c] != ' ')) &&
sq[r][c + 1] <= sq[r - 1][c] && sq[r][c + 1] <= sq[r][c - 1] && sq[r][c + 1] <= sq[r + 1][c])
spmw1(r, c + 1);
else
if (r > dRow && ((sq[r - 1][c] != '#' && sq[r - 1][c] != ' ') || (sq[r][c - 1] != '#' && sq[r][c - 1] != ' ') ||
(sq[r + 1][c] != '#' && sq[r + 1][c] != ' ') || (sq[r][c + 1] != '#' && sq[r][c + 1] != ' ')) &&
sq[r - 1][c] <= sq[r][c - 1] && sq[r - 1][c] <= sq[r + 1][c] && sq[r - 1][c] <= sq[r][c + 1])
spmw1(r - 1, c);
else
if