from
Chess with "Greedy Edi"
by Wolfgang Garn
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 at files@mathworks.com