In the chess game I'm working on I have come across the following problem:
Code: Select all
...
char canbetakenweight=4;
...
if (target[takerow][takecol]>1){target[takerow][takecol]=canbetakenweight;}
//if (target[takerow][takecol]>1){target[takerow][takecol]=4;}
This does not work unless I EXPLICITLY assign it the value "4" (in the commented line).
Initially, I thought is was to do with mismatched char types (target is UNSIGNED and canbetakenweight is SIGNED but making them the same (unsigned) makes no difference.
By printing out the values of particular target locations (straight after being assigned the value of "canbetakenweight" which should be 4) we get different figures (e.g. 72). This drastically alters the behaviour of the program as "proper" higher value targets sometimes get ignored in favour of these spurious ones.
Anyone got any thoughts? (perhaps it's my coding and NOT the OSDK) but I just can't spot it and it's really slowing me down.
Thanks
Barnsey
PS: Happy New Year everyone!