No BSD License  

Highlights from
Connect Five (Wu Zi Qi)

image thumbnail
from Connect Five (Wu Zi Qi) by Zhen Qian
This is a simplified version of Connect Five (in Chinese, WuZiQi) game for two players.

wu (J)
function I = wu (J)

I = zeros(1,length(J));

%%
for i=1:length(J)-4
        It = J(i:i+4);
        if It == [1 1 1 1 1]
            I(i:i+4)=5;
        end
        if It == [-1 -1 -1 -1 -1]
            I(i:i+4)=-5;
        end
    end

end

Contact us at files@mathworks.com