Code:
while(move!=1 && move !=2);// why is this not move!=1 || move !=2?
If move is 1, what is the result of move != 2?
OR is a combinatorial function that is true if either side of it is true, so what happens to the loop given the answer to the above question?
[I'm not giving the answer straight off, because learning to THINK in boolean is important, and I'm sure the questions I've just asked will lead you to the right answer].
Code:
if(isdigit(move)==0)
will always be true, since move is either 1 or 2 when you get out of the loop - and isdigit is true for values 48..57, which represents the 10 values of '0'..'9' in ASCII (assuming you are indeed using the ASCII representation, rather than one of the other character value representations that are used by 0.001% of the worlds OS/Hardware combinations).
Since scanf("%d", ...) will not accept ANY other input than digits [well, ok, spaces and newlines are accepted and immediately ignored if present in the input], calling isdigit after scanf() is pretty meaningless. What you MAY want to do instead is to check if scanf() accepted any of the data the user entered - you do that by examining the value returned from scanf() - under normal circumstances, that would correspond to the number of accepted inputs - in the case of "%d" as the format string, the expected value would be 1. If you have a format string of "%d%d%d", then you can expect to see 3 as the result. If you get anything else, something that wasn't a digit would be in the input.
--
Mats