Code covered by the BSD License  

Highlights from
Chess with "Greedy Edi"

image thumbnail

Chess with "Greedy Edi"

by

 

07 Nov 2009 (Updated )

Play chess against "Greedy Edi".

lastHalfMove
function [from, to] = lastHalfMove
% The last move is returned in matrix notation
%
global history

if length(history.white) > length(history.black)
    colour = 1; % whites last half move
else
    colour = 0; % blacks last half move
end

if colour % white
    from = history.white_pos{end,1};
    to   = history.white_pos{end,2};
else % black
    from = history.black_pos{end,1};
    to   = history.black_pos{end,2};
end

Contact us