function [ from to suggestion] = getmove( board, color )

board2 = board';
command = sprintf('CheckerConsole\\release\\CheckerConsole.exe %d %s', color, int2str(board2(:)') );  
[s w] = dos(command);

%w

res = sscanf(w, '%d');

%res2 = sscanf(w, '\n%s')
%tok = strtok(w, ' ')

%[token, rem] = strtok(w, '\n');
   
%startp = strfind(w, 'best:')+5;
%endp  = strfind(w, 'time')-1;
%w(startp:endp);

% adding 1 because of matlab semantics
%color;
letters = 'ABCDEFGH';
numbers = '87654321';
from = [ (res(1)+1) ( res(2)+1) ];
to = [ (res(3)+1) (res(4)+1) ];
if (from(1)== 8 && from(2)== 1 && to(1)==8 && to(2)==1 )
        suggestion = 'invalid game state';
else
    suggestion = [letters(res(1)+1) numbers( res(2)+1) '-' letters(res(3)+1) numbers(res(4)+1) ];
end

return;
