{"group":{"id":1,"name":"Community","lockable":false,"created_at":"2012-01-18T18:02:15.000Z","updated_at":"2026-04-06T14:01:22.000Z","description":"Problems submitted by members of the MATLAB Central community.","is_default":true,"created_by":161519,"badge_id":null,"featured":false,"trending":false,"solution_count_in_trending_period":0,"trending_last_calculated":"2026-04-06T00:00:00.000Z","image_id":null,"published":true,"community_created":false,"status_id":2,"is_default_group_for_player":false,"deleted_by":null,"deleted_at":null,"restored_by":null,"restored_at":null,"description_opc":null,"description_html":null,"published_at":null},"problems":[{"id":715,"title":"Chezz_015 : Simplified chess","description":"Chezz:...A simplified Chess game. Two game match with future multiple skill levels via evolutionary upgrades.\r\n\r\nSimplified the rules to implement rapid move check. Normal Chess moves like \"a4\", Castling, and En Passant are accepted. Moves are simple vectors [idx_from idx_to promo] where promo is for pawns reaching the 8th rank. Piece names are numeric 1-6 White (P,R,N,B,Q,K) and Black is 7-12. Board empty space is 0.\r\n\r\nChezz unique rules: 1) To Win must remove opponent's King.. 2) Lose Turn if try an impossible move.. 3) Checks are ignored - allow move into check, castle out of check, castle thru/into check.. 4) Pawn promote to any piece, including opponent and vacuum.. 5) Six position repetition is a Draw..6) 50 moves No captures is a Draw..\r\n\r\n\r\n*Inputs:* (b,pmv,castle)\r\n\r\nPlayer always appears to be White. However, Black may apparently move first.\r\n\r\nb (8x8) array with empty=0, White Pieces 1-6, Blk Pieces 7-12\r\n\r\npmv [from to promo] vector of both players moves (needed for en passant option). Illegal move creates a [0 0 0] pmv value. Size [2*moves,3]\r\n\r\ncastle: 6 pt logical vector to show castling options. 1 if piece is eligible. Positions are [8 40 64 1 33 57] for [WQR WK WKR BQR BK BKR]. . . eg castle mv [40 56 0]\r\n\r\n\r\n\r\n*Output:* mv  [from to pawn_new_type] where from/to are 1-64 and pawn_new is 0 thru 12 if pawn is on final row.\r\n\r\n\r\n\r\nThe Test Suite will oversee two games with the Player as Black(moving second) and then as White.\r\n\r\n*Passing:* Player must Win both games\r\n\r\n*Evolution:* Winning player algorithms will be hosted as Chezz_xyz based on their wins over other Chezz algorithms. Champions and the basis will be fully credited in Chezz updates. Champions must be able to play self and Not Cody timeout.\r\n\r\n\r\nChezz_015: Pawn Serial Attack - Will capture and Promote\r\n\r\nLink update 12/27/12","description_html":"\u003cp\u003eChezz:...A simplified Chess game. Two game match with future multiple skill levels via evolutionary upgrades.\u003c/p\u003e\u003cp\u003eSimplified the rules to implement rapid move check. Normal Chess moves like \"a4\", Castling, and En Passant are accepted. Moves are simple vectors [idx_from idx_to promo] where promo is for pawns reaching the 8th rank. Piece names are numeric 1-6 White (P,R,N,B,Q,K) and Black is 7-12. Board empty space is 0.\u003c/p\u003e\u003cp\u003eChezz unique rules: 1) To Win must remove opponent's King.. 2) Lose Turn if try an impossible move.. 3) Checks are ignored - allow move into check, castle out of check, castle thru/into check.. 4) Pawn promote to any piece, including opponent and vacuum.. 5) Six position repetition is a Draw..6) 50 moves No captures is a Draw..\u003c/p\u003e\u003cp\u003e\u003cb\u003eInputs:\u003c/b\u003e (b,pmv,castle)\u003c/p\u003e\u003cp\u003ePlayer always appears to be White. However, Black may apparently move first.\u003c/p\u003e\u003cp\u003eb (8x8) array with empty=0, White Pieces 1-6, Blk Pieces 7-12\u003c/p\u003e\u003cp\u003epmv [from to promo] vector of both players moves (needed for en passant option). Illegal move creates a [0 0 0] pmv value. Size [2*moves,3]\u003c/p\u003e\u003cp\u003ecastle: 6 pt logical vector to show castling options. 1 if piece is eligible. Positions are [8 40 64 1 33 57] for [WQR WK WKR BQR BK BKR]. . . eg castle mv [40 56 0]\u003c/p\u003e\u003cp\u003e\u003cb\u003eOutput:\u003c/b\u003e mv  [from to pawn_new_type] where from/to are 1-64 and pawn_new is 0 thru 12 if pawn is on final row.\u003c/p\u003e\u003cp\u003eThe Test Suite will oversee two games with the Player as Black(moving second) and then as White.\u003c/p\u003e\u003cp\u003e\u003cb\u003ePassing:\u003c/b\u003e Player must Win both games\u003c/p\u003e\u003cp\u003e\u003cb\u003eEvolution:\u003c/b\u003e Winning player algorithms will be hosted as Chezz_xyz based on their wins over other Chezz algorithms. Champions and the basis will be fully credited in Chezz updates. Champions must be able to play self and Not Cody timeout.\u003c/p\u003e\u003cp\u003eChezz_015: Pawn Serial Attack - Will capture and Promote\u003c/p\u003e\u003cp\u003eLink update 12/27/12\u003c/p\u003e","function_template":"function mv=player_move(b,pmv,castle)\r\n% Author: Richard Z\r\n% Bot name: First Pawn Attack\r\n% Chezz_015\r\n% http://tinyurl.com/matlab-chezz-Cmove015\r\n%\r\n% 0-wht 1-Blk; board 8x8, opponents last move, \r\n% castle vector(8 40 64 1 33 57) 0=has moved, 1=eligible\r\n mv=zeros(1,3); % [from to promo] \r\n % mv =[39 37 0] is e4\r\n % pmv (opponents last move) is used for en passant\r\n % [0 0 0] is invalid move or first move of game\r\n % castle is used to castle yourself or see if opponent may castle\r\n \r\n pieces=1:6;\r\n enemy=7:12;\r\n\r\n pv=find(b==1);\r\n no_move=true;\r\n ptr=0;\r\n \r\n % loop thru pawns types; capture L/R or Move up\r\n \r\n while no_move\r\n  ptr=ptr+1;\r\n  if ptr\u003elength(pv),break;end\r\n  [r c]=ind2sub([8 8],pv(ptr));\r\n  if ismember(r,[1 8]),continue;end % end row for a P\r\n  if c==1\r\n   if ismember(b(pv(ptr)+7),enemy) % capture\r\n    mv=[pv(ptr) pv(ptr)+7 6];\r\n    return;\r\n   end\r\n  end\r\n  if c==8\r\n   if ismember(b(pv(ptr)-9),enemy) % capture\r\n    mv=[pv(ptr) pv(ptr)-9 6];\r\n    return;\r\n   end\r\n  end\r\n  if c\u003c8 \u0026\u0026 c\u003e1\r\n   if ismember(b(pv(ptr)+7),enemy) % capture\r\n    mv=[pv(ptr) pv(ptr)+7 6];\r\n    return;\r\n   end\r\n   if ismember(b(pv(ptr)-9),enemy) % capture\r\n    mv=[pv(ptr) pv(ptr)-9 6];\r\n    return;\r\n   end\r\n  end\r\n  \r\n  % Move fwd\r\n  if b(pv(ptr)-1)==0\r\n   mv=[pv(ptr) pv(ptr)-1 6];\r\n   return;\r\n  end\r\n  \r\n end % while no move\r\n\r\nend % End of Computer Champion Bot","test_suite":"%%\r\n% Load in the routines that play the game and check move validity\r\ntic\r\nurlwrite('http://rmatlabtest.appspot.com/Chezz_Shell.m','Chezz_Shell.m') ;\r\nurlwrite('http://rmatlabtest.appspot.com/ghost_white.m','ghost_white.m') \r\nurlwrite('http://rmatlabtest.appspot.com/computer_move015.m','computer_move.m') \r\nurlwrite('http://rmatlabtest.appspot.com/mov_chk.m','mov_chk.m') \r\nrehash path\r\ntoc\r\n%%\r\n% Play Two Chezz games\r\n% Player must win Twice to Pass\r\nglobal pmvout1 pmvout2\r\ntic\r\n wins=0; % player wins\r\n b=zeros(8);% P 1/7 R 2/8 N 3/9 B 4/10 Q 5/11 K 6/12 \r\n b(2,:)=7;\r\n b(1,:)=[8 9 10 11 12 10 9 8]; % Player 7:12\r\n b(7,:)=1;\r\n b(8,:)=b(1,:)-6; % Computer 1:6\r\n b_orig=b;\r\n \r\n %mv=zeros(1,3); % [from to promo)]  \r\n %computer_wht=0; % 0 Computer plays wht\r\n %computer_wht=1; % 1 Computer plays black\r\n \r\n pmv=zeros(1,3); % [from to promo)] Opponents last move\r\n castle=[1 1 1 1 1 1];\r\n % False move call to satisfy Cody Rqmt of TestSuite match Ref Solution\r\n mv=player_move(b,pmv,castle)\r\n  \r\n for computer_wht=0:1\r\n  pmvout1=pmv; % Store game 1 moves\r\n  \r\n  dbg=0;\r\n  game_over=false;\r\n  b=b_orig;\r\n  no_capture=0;\r\n  b_hist=zeros(102,8,8);\r\n  pmv=zeros(1,3); % [from to promo)] Opponents last move\r\n  castle=[1 1 1 1 1 1]; % History of if ever moved w/b Castles/kings\r\n %  idx 8 40 64  1 33 57\r\n \r\n while ~game_over\r\n  mvP=zeros(1,3); % [from to type/promote)] \r\n  % Shell 0=Blk,1=Wht;Board;move,prev move;\r\n  % function (1 Play Comp, 2 Player, 3 Check mv)\r\n  \r\n  % White move\r\n  if computer_wht==0\r\n   [mvP]=Chezz_Shell(0,b,mvP,pmv,castle,1); % 0 Wht,... 1 Computer\r\n  else\r\n   [mvP]=Chezz_Shell(0,b,mvP,pmv,castle,2); % 0 Wht  2 is player\r\n  end\r\n  \r\n  \r\n  [mv]=Chezz_Shell(0,b,mvP,pmv(end,:),castle,3); % 0 Wht,..., 3 Check\r\n  pmv=[pmv;mv(1:3)];\r\n  capture=false;\r\n  % Board changes only occur in Suite code\r\n  if mv(1)~=0 % Valid move determined by mv_chk\r\n   if mv(4)==0 % Normal moves and promotions\r\n    if b(mv(2))~=0,capture=true;end\r\n     b(mv(2))=b(mv(1)); % potential promotion\r\n     b(mv(1))=0;\r\n     if ismember(b(mv(2)),[1 7])\r\n      if ismember(mv(2),[1:8:57 8:8:64])\r\n       b(mv(2))=mv(3); % Place promoted selection\r\n      end\r\n     end\r\n     \r\n   else % ep or castle by White\r\n    if mv(4)==1 % castle 0-0 or 0-0-0\r\n      b(mv(1))=0;\r\n      b(mv(2))=6;\r\n      if mv(2)==24\r\n        b(8)=0;b(32)=2;  \r\n      else\r\n        b(64)=0;b(48)=2;\r\n      end    \r\n    end % castle\r\n    if mv(4)==2 % ep\r\n      capture=true;\r\n      b(mv(1))=0;\r\n      b(mv(2))=1; % White Pawn\r\n      b(mv(2)+1)=0; % Take pawn that passed\r\n    end % end ep\r\n   end % move implemented\r\n  end % end move\r\n  \r\n  %b % display board after move\r\n  \r\n  if isempty(find(b==12,1))\r\n   % Game over : Black King Captured\r\n   game_over=true; % change to if comp=wht or blk for win\r\n   if computer_wht==1 % Blk Computer King; Player is Wht captured Blk King \r\n    wins=wins+1;\r\n   end\r\n   continue;\r\n  end\r\n  \r\n  castle=castle.*logical([b(8)==2 b(40) b(64)==2 b(1)==8 b(33) b(57)==8]);\r\n  \r\n  if ~capture\r\n   no_capture=no_capture+1;\r\n   if no_capture\u003e100\r\n       fprintf('Draw 100 moves no capture\\n');\r\n       game_over=true;\r\n   end % move is b and w\r\n   b_hist(no_capture,:,:)=b;\r\n  else\r\n   no_capture=1;\r\n   b_hist=b_hist*0;\r\n   b_hist(no_capture,:,:)=b;\r\n  end\r\n   \r\n  % Black Move\r\n  mvP=zeros(1,4); % [from to type/promote specials(castle=1/ep=2)] \r\n if computer_wht==0\r\n   [mvP]=Chezz_Shell(1,b,mvP,pmv,castle,2); % 2 Blk,... 2 is player\r\n  else\r\n   [mvP]=Chezz_Shell(1,b,mvP,pmv,castle,1); % 2 Blk  1 is Computer\r\n end\r\n  \r\n  [mv]=Chezz_Shell(1,b,mvP,pmv(end,:),castle,3); % 2 Blk,..., 3 Check\r\n  \r\n pmv=[pmv;mv(1:3)];\r\n capture=false;\r\n  % Board changes only occur in Suite code\r\n  if mv(1)~=0 % Valid move determined by mv_chk\r\n   if mv(4)==0 % Normal moves and promotions\r\n    if b(mv(2))~=0,capture=true;end\r\n    b(mv(2))=b(mv(1)); % potential promotion\r\n    b(mv(1))=0;\r\n    if ismember(b(mv(2)),[1 7])\r\n     if ismember(mv(2),[1:8:57 8:8:64])\r\n      b(mv(2))=mv(3); % Place promoted selection\r\n     end\r\n    end\r\n   else % ep or castle by Black\r\n    if mv(4)==1 % castle 0-0 or 0-0-0\r\n      b(mv(1))=0;\r\n      b(mv(2))=12;\r\n      if mv(2)==49 % Blk 0-0\r\n        b(57)=0;b(41)=8;  \r\n      else % Blk 0-0-0\r\n        b(1)=0;b(25)=8;\r\n      end    \r\n    end % castle\r\n    if mv(4)==2 % ep by Black\r\n      capture=true;\r\n      b(mv(1))=0;\r\n      b(mv(2))=mv(3);\r\n    % White passed black on prior move\r\n      b(mv(2)-1)=0; \r\n    end % end ep\r\n   end % move implemented\r\n  end % end move\r\n  \r\n%   b\r\n%   figure(1);imagesc(b,[0 12]);axis equal;\r\n  \r\n  if isempty(find(b==6,1))\r\n   % Game over : Blk captured White King\r\n   game_over=true;\r\n   if computer_wht==0 % Wht Computer King; Player is Blk captured Wht King\r\n    wins=wins+1;\r\n   end\r\n   continue\r\n  end\r\n  \r\n  castle=castle.*logical([b(8)==2 b(40) b(64)==2 b(1)==8 b(33) b(57)==8]);\r\n  \r\n  if ~capture\r\n   no_capture=no_capture+1;\r\n   if no_capture\u003e100\r\n       fprintf('Draw 100 moves no capture\\n');\r\n       game_over=true;\r\n   end % move is b and w\r\n   b_hist(no_capture,:,:)=b;\r\n   % Check for 3 position repetition\r\n   for i=1:no_capture-1\r\n    cdelta=0;\r\n    for j=i+1:no_capture\r\n     delta=(b_hist(i,:,:)-b_hist(j,:,:));\r\n     if sum(abs(delta(:)))==0\r\n      cdelta=cdelta+1;\r\n     end\r\n    end\r\n    if cdelta\u003e=7 % repetitions 3 identical setups\r\n     fprintf('Game over due to repetition\\n');\r\n     game_over=true;\r\n    end\r\n   end % rep check loop \r\n  else\r\n   no_capture=1;\r\n   b_hist=b_hist*0;\r\n   b_hist(no_capture,:,:)=b;\r\n  end % ~capture\r\n  \r\n end % While ~game_over\r\n \r\n end % wht_blk\r\n\r\npmvout2=pmv;\r\nwins\r\n \r\n% Player must win Twice to Pass\r\ntoc\r\nassert(isequal(wins,2))\r\n\r\n%%\r\nglobal pmvout1 pmvout2\r\n% Output moves for games\r\n\r\n% Output game 2 moves\r\npmv=pmvout1;\r\n   for i=2:3:size(pmv,1)-3\r\n    fprintf('%2i %2i %2i %2i %2i %2i %2i %2i %2i \\n',pmv(i,1:3),pmv(i+1,1:3),pmv(i+2,1:3));\r\n   end\r\n   fprintf('%2i %2i %2i\\n',pmv(end-2,:));\r\n   fprintf('%2i %2i %2i\\n',pmv(end-1,:));\r\n   fprintf('%2i %2i %2i\\n',pmv(end,:));\r\n \r\n% Output game 2 moves\r\npmv=pmvout2;\r\n for i=2:3:size(pmv,1)-3\r\n  fprintf('%2i %2i %2i %2i %2i %2i %2i %2i %2i \\n',pmv(i,1:3),pmv(i+1,1:3),pmv(i+2,1:3));\r\n  end\r\n% repeat of moves\r\n fprintf('%2i %2i %2i\\n',pmv(end-2,:));\r\n fprintf('%2i %2i %2i\\n',pmv(end-1,:));\r\n fprintf('%2i %2i %2i\\n',pmv(end,:));","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":3,"test_suite_updated_at":"2012-12-27T22:40:04.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-05-24T04:58:57.000Z","updated_at":"2012-12-27T22:50:08.000Z","published_at":"2012-05-24T05:15:44.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eChezz:...A simplified Chess game. Two game match with future multiple skill levels via evolutionary upgrades.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSimplified the rules to implement rapid move check. Normal Chess moves like \\\"a4\\\", Castling, and En Passant are accepted. Moves are simple vectors [idx_from idx_to promo] where promo is for pawns reaching the 8th rank. Piece names are numeric 1-6 White (P,R,N,B,Q,K) and Black is 7-12. Board empty space is 0.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eChezz unique rules: 1) To Win must remove opponent's King.. 2) Lose Turn if try an impossible move.. 3) Checks are ignored - allow move into check, castle out of check, castle thru/into check.. 4) Pawn promote to any piece, including opponent and vacuum.. 5) Six position repetition is a Draw..6) 50 moves No captures is a Draw..\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eInputs:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (b,pmv,castle)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ePlayer always appears to be White. However, Black may apparently move first.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eb (8x8) array with empty=0, White Pieces 1-6, Blk Pieces 7-12\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003epmv [from to promo] vector of both players moves (needed for en passant option). Illegal move creates a [0 0 0] pmv value. Size [2*moves,3]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ecastle: 6 pt logical vector to show castling options. 1 if piece is eligible. Positions are [8 40 64 1 33 57] for [WQR WK WKR BQR BK BKR]. . . eg castle mv [40 56 0]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eOutput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e mv [from to pawn_new_type] where from/to are 1-64 and pawn_new is 0 thru 12 if pawn is on final row.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe Test Suite will oversee two games with the Player as Black(moving second) and then as White.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ePassing:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Player must Win both games\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eEvolution:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Winning player algorithms will be hosted as Chezz_xyz based on their wins over other Chezz algorithms. Champions and the basis will be fully credited in Chezz updates. Champions must be able to play self and Not Cody timeout.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eChezz_015: Pawn Serial Attack - Will capture and Promote\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eLink update 12/27/12\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":714,"title":"Chezz_000 : Simplified chess","description":"Chezz:...A simplified Chess game. Two game match with future multiple skill levels via evolutionary upgrades.\r\n\r\nSimplified the rules to implement rapid move check. Normal Chess moves like \"a4\", Castling, and En Passant are accepted. Moves are simple vectors [idx_from idx_to promo] where promo is for pawns reaching the 8th rank. Piece names are numeric 1-6 White (P,R,N,B,Q,K) and Black is 7-12. Board empty space is 0.\r\n\r\nChezz unique rules: 1) To Win must remove opponent's King.. 2) Lose Turn if try an impossible move.. 3) Checks are ignored - allow move into check, castle out of check, castle thru/into check.. 4) Pawn promote to any piece, including opponent and vacuum.. 5) Six position repetition is a Draw..6) 50 moves No captures is a Draw..\r\n\r\n\r\n*Inputs:* (b,pmv,castle)\r\n\r\nPlayer always appears to be White. However, Black may apparently move first.\r\n\r\nb (8x8) array with empty=0, White Pieces 1-6, Blk Pieces 7-12\r\n\r\npmv [from to promo] vector of both players moves (needed for en passant option). Illegal move creates a [0 0 0] pmv value. Size [2*moves,3]\r\n\r\ncastle: 6 pt logical vector to show castling options. 1 if piece is eligible. Positions are [8 40 64 1 33 57] for [WQR WK WKR BQR BK BKR]. . . eg castle mv [40 56 0]\r\n\r\n\r\n\r\n*Output:* mv  [from to pawn_new_type] where from/to are 1-64 and pawn_new is 0 thru 12 if pawn is on final row.\r\n\r\n\r\n\r\nThe Test Suite will oversee two games with the Player as Black(moving second) and then as White.\r\n\r\n*Passing:* Player must Win both games\r\n\r\n*Evolution:* Winning player algorithms will be hosted as Chezz_xyz based on their wins over other Chezz algorithms. Champions and the basis will be fully credited in Chezz updates. Champions must be able to play self and Not Cody timeout.\r\n\r\n\r\nChezz_000: Makes no moves or captures - The weakest player possible\r\n\r\nLinks updated 12/27/12\r\n\r\n","description_html":"\u003cp\u003eChezz:...A simplified Chess game. Two game match with future multiple skill levels via evolutionary upgrades.\u003c/p\u003e\u003cp\u003eSimplified the rules to implement rapid move check. Normal Chess moves like \"a4\", Castling, and En Passant are accepted. Moves are simple vectors [idx_from idx_to promo] where promo is for pawns reaching the 8th rank. Piece names are numeric 1-6 White (P,R,N,B,Q,K) and Black is 7-12. Board empty space is 0.\u003c/p\u003e\u003cp\u003eChezz unique rules: 1) To Win must remove opponent's King.. 2) Lose Turn if try an impossible move.. 3) Checks are ignored - allow move into check, castle out of check, castle thru/into check.. 4) Pawn promote to any piece, including opponent and vacuum.. 5) Six position repetition is a Draw..6) 50 moves No captures is a Draw..\u003c/p\u003e\u003cp\u003e\u003cb\u003eInputs:\u003c/b\u003e (b,pmv,castle)\u003c/p\u003e\u003cp\u003ePlayer always appears to be White. However, Black may apparently move first.\u003c/p\u003e\u003cp\u003eb (8x8) array with empty=0, White Pieces 1-6, Blk Pieces 7-12\u003c/p\u003e\u003cp\u003epmv [from to promo] vector of both players moves (needed for en passant option). Illegal move creates a [0 0 0] pmv value. Size [2*moves,3]\u003c/p\u003e\u003cp\u003ecastle: 6 pt logical vector to show castling options. 1 if piece is eligible. Positions are [8 40 64 1 33 57] for [WQR WK WKR BQR BK BKR]. . . eg castle mv [40 56 0]\u003c/p\u003e\u003cp\u003e\u003cb\u003eOutput:\u003c/b\u003e mv  [from to pawn_new_type] where from/to are 1-64 and pawn_new is 0 thru 12 if pawn is on final row.\u003c/p\u003e\u003cp\u003eThe Test Suite will oversee two games with the Player as Black(moving second) and then as White.\u003c/p\u003e\u003cp\u003e\u003cb\u003ePassing:\u003c/b\u003e Player must Win both games\u003c/p\u003e\u003cp\u003e\u003cb\u003eEvolution:\u003c/b\u003e Winning player algorithms will be hosted as Chezz_xyz based on their wins over other Chezz algorithms. Champions and the basis will be fully credited in Chezz updates. Champions must be able to play self and Not Cody timeout.\u003c/p\u003e\u003cp\u003eChezz_000: Makes no moves or captures - The weakest player possible\u003c/p\u003e\u003cp\u003eLinks updated 12/27/12\u003c/p\u003e","function_template":"function mv=player_move(b,pmv,castle)\r\n% Author: Richard Z\r\n% Bot name: Do Nothing\r\n% Chezz_000\r\n%Chezz_000 bot is no legal moves mv=[0 0 0]\r\n%\r\n% 0-wht 1-Blk; board 8x8, opponents last move, \r\n% castle vector(8 40 64 1 33 57) 0=has moved, 1=eligible\r\n% example: mv =[39 37 0] is e4\r\n% pmv (move,from to promo) is used for en passant\r\n% [0 0 0] is invalid move or first move of game\r\n% castle vector is used to castle yourself or see if opponent may castle\r\n \r\n% This is the computer's algorithm - Going for a draw\r\n mv=zeros(1,3); % [from to promo] \r\nend % End of Computer Champion Bot","test_suite":"%%\r\n% Load in the routines that play the game and check move validity\r\ntic\r\nurlwrite('http://rmatlabtest.appspot.com/Chezz_Shell.m','Chezz_Shell.m') ;\r\nurlwrite('http://rmatlabtest.appspot.com/ghost_white.m','ghost_white.m') \r\nurlwrite('http://rmatlabtest.appspot.com/computer_move000.m','computer_move.m') \r\nurlwrite('http://rmatlabtest.appspot.com/mov_chk.m','mov_chk.m') \r\nrehash path\r\ntoc\r\n%%\r\n% Play Two Chezz games\r\n% Player must win Twice to Pass\r\nglobal pmvout1 pmvout2\r\ntic\r\n wins=0; % player wins\r\n b=zeros(8);% P 1/7 R 2/8 N 3/9 B 4/10 Q 5/11 K 6/12 \r\n b(2,:)=7;\r\n b(1,:)=[8 9 10 11 12 10 9 8]; % Player 7:12\r\n b(7,:)=1;\r\n b(8,:)=b(1,:)-6; % Computer 1:6\r\n b_orig=b;\r\n \r\n %mv=zeros(1,3); % [from to promo)]  \r\n %computer_wht=0; % 0 Computer plays wht\r\n %computer_wht=1; % 1 Computer plays black\r\n \r\n pmv=zeros(1,3); % [from to promo)] Opponents last move\r\n castle=[1 1 1 1 1 1];\r\n % False move call to satisfy Cody Rqmt of TestSuite match Ref Solution\r\n mv=player_move(b,pmv,castle)\r\n  \r\n for computer_wht=0:1\r\n  pmvout1=pmv; % Store game 1 moves\r\n  \r\n  dbg=0;\r\n  game_over=false;\r\n  b=b_orig;\r\n  no_capture=0;\r\n  b_hist=zeros(102,8,8);\r\n  pmv=zeros(1,3); % [from to promo)] Opponents last move\r\n  castle=[1 1 1 1 1 1]; % History of if ever moved w/b Castles/kings\r\n %  idx 8 40 64  1 33 57\r\n \r\n while ~game_over\r\n  mvP=zeros(1,3); % [from to type/promote)] \r\n  % Shell 0=Blk,1=Wht;Board;move,prev move;\r\n  % function (1 Play Comp, 2 Player, 3 Check mv)\r\n  \r\n  % White move\r\n  if computer_wht==0\r\n   [mvP]=Chezz_Shell(0,b,mvP,pmv,castle,1); % 0 Wht,... 1 Computer\r\n  else\r\n   [mvP]=Chezz_Shell(0,b,mvP,pmv,castle,2); % 0 Wht  2 is player\r\n  end\r\n  \r\n  \r\n  [mv]=Chezz_Shell(0,b,mvP,pmv(end,:),castle,3); % 0 Wht,..., 3 Check\r\n  pmv=[pmv;mv(1:3)];\r\n  capture=false;\r\n  % Board changes only occur in Suite code\r\n  if mv(1)~=0 % Valid move determined by mv_chk\r\n   if mv(4)==0 % Normal moves and promotions\r\n    if b(mv(2))~=0,capture=true;end\r\n     b(mv(2))=b(mv(1)); % potential promotion\r\n     b(mv(1))=0;\r\n     if ismember(b(mv(2)),[1 7])\r\n      if ismember(mv(2),[1:8:57 8:8:64])\r\n       b(mv(2))=mv(3); % Place promoted selection\r\n      end\r\n     end\r\n     \r\n   else % ep or castle by White\r\n    if mv(4)==1 % castle 0-0 or 0-0-0\r\n      b(mv(1))=0;\r\n      b(mv(2))=6;\r\n      if mv(2)==24\r\n        b(8)=0;b(32)=2;  \r\n      else\r\n        b(64)=0;b(48)=2;\r\n      end    \r\n    end % castle\r\n    if mv(4)==2 % ep\r\n      capture=true;\r\n      b(mv(1))=0;\r\n      b(mv(2))=1; % White Pawn\r\n      b(mv(2)+1)=0; % Take pawn that passed\r\n    end % end ep\r\n   end % move implemented\r\n  end % end move\r\n  \r\n  %b % display board after move\r\n  \r\n  if isempty(find(b==12,1))\r\n   % Game over : Black King Captured\r\n   game_over=true; % change to if comp=wht or blk for win\r\n   if computer_wht==1 % Blk Computer King; Player is Wht captured Blk King \r\n    wins=wins+1;\r\n   end\r\n   continue;\r\n  end\r\n  \r\n  castle=castle.*logical([b(8)==2 b(40) b(64)==2 b(1)==8 b(33) b(57)==8]);\r\n  \r\n  if ~capture\r\n   no_capture=no_capture+1;\r\n   if no_capture\u003e100\r\n       fprintf('Draw 100 moves no capture\\n');\r\n       game_over=true;\r\n   end % move is b and w\r\n   b_hist(no_capture,:,:)=b;\r\n  else\r\n   no_capture=1;\r\n   b_hist=b_hist*0;\r\n   b_hist(no_capture,:,:)=b;\r\n  end\r\n   \r\n  % Black Move\r\n  mvP=zeros(1,4); % [from to type/promote specials(castle=1/ep=2)] \r\n if computer_wht==0\r\n   [mvP]=Chezz_Shell(1,b,mvP,pmv,castle,2); % 2 Blk,... 2 is player\r\n  else\r\n   [mvP]=Chezz_Shell(1,b,mvP,pmv,castle,1); % 2 Blk  1 is Computer\r\n end\r\n  \r\n  [mv]=Chezz_Shell(1,b,mvP,pmv(end,:),castle,3); % 2 Blk,..., 3 Check\r\n  \r\n pmv=[pmv;mv(1:3)];\r\n capture=false;\r\n  % Board changes only occur in Suite code\r\n  if mv(1)~=0 % Valid move determined by mv_chk\r\n   if mv(4)==0 % Normal moves and promotions\r\n    if b(mv(2))~=0,capture=true;end\r\n    b(mv(2))=b(mv(1)); % potential promotion\r\n    b(mv(1))=0;\r\n    if ismember(b(mv(2)),[1 7])\r\n     if ismember(mv(2),[1:8:57 8:8:64])\r\n      b(mv(2))=mv(3); % Place promoted selection\r\n     end\r\n    end\r\n   else % ep or castle by Black\r\n    if mv(4)==1 % castle 0-0 or 0-0-0\r\n      b(mv(1))=0;\r\n      b(mv(2))=12;\r\n      if mv(2)==49 % Blk 0-0\r\n        b(57)=0;b(41)=8;  \r\n      else % Blk 0-0-0\r\n        b(1)=0;b(25)=8;\r\n      end    \r\n    end % castle\r\n    if mv(4)==2 % ep by Black\r\n      capture=true;\r\n      b(mv(1))=0;\r\n      b(mv(2))=mv(3);\r\n    % White passed black on prior move\r\n      b(mv(2)-1)=0; \r\n    end % end ep\r\n   end % move implemented\r\n  end % end move\r\n  \r\n%   b\r\n%   figure(1);imagesc(b,[0 12]);axis equal;\r\n  \r\n  if isempty(find(b==6,1))\r\n   % Game over : Blk captured White King\r\n   game_over=true;\r\n   if computer_wht==0 % Wht Computer King; Player is Blk captured Wht King\r\n    wins=wins+1;\r\n   end\r\n   continue\r\n  end\r\n  \r\n  castle=castle.*logical([b(8)==2 b(40) b(64)==2 b(1)==8 b(33) b(57)==8]);\r\n  \r\n  if ~capture\r\n   no_capture=no_capture+1;\r\n   if no_capture\u003e100\r\n       fprintf('Draw 100 moves no capture\\n');\r\n       game_over=true;\r\n   end % move is b and w\r\n   b_hist(no_capture,:,:)=b;\r\n   % Check for 3 position repetition\r\n   for i=1:no_capture-1\r\n    cdelta=0;\r\n    for j=i+1:no_capture\r\n     delta=(b_hist(i,:,:)-b_hist(j,:,:));\r\n     if sum(abs(delta(:)))==0\r\n      cdelta=cdelta+1;\r\n     end\r\n    end\r\n    if cdelta\u003e=7 % repetitions 3 identical setups\r\n     fprintf('Game over due to repetition\\n');\r\n     game_over=true;\r\n    end\r\n   end % rep check loop \r\n  else\r\n   no_capture=1;\r\n   b_hist=b_hist*0;\r\n   b_hist(no_capture,:,:)=b;\r\n  end % ~capture\r\n  \r\n end % While ~game_over\r\n \r\n end % wht_blk\r\n\r\npmvout2=pmv;\r\nwins\r\n \r\n% Player must win Twice to Pass\r\ntoc\r\nassert(isequal(wins,2))\r\n\r\n%%\r\nglobal pmvout1 pmvout2\r\n% Output moves for games\r\n\r\n% Output game 2 moves\r\npmv=pmvout1;\r\n   for i=2:3:size(pmv,1)-3\r\n    fprintf('%2i %2i %2i %2i %2i %2i %2i %2i %2i \\n',pmv(i,1:3),pmv(i+1,1:3),pmv(i+2,1:3));\r\n   end\r\n   fprintf('%2i %2i %2i\\n',pmv(end-2,:));\r\n   fprintf('%2i %2i %2i\\n',pmv(end-1,:));\r\n   fprintf('%2i %2i %2i\\n',pmv(end,:));\r\n \r\n% Output game 2 moves\r\npmv=pmvout2;\r\n for i=2:3:size(pmv,1)-3\r\n  fprintf('%2i %2i %2i %2i %2i %2i %2i %2i %2i \\n',pmv(i,1:3),pmv(i+1,1:3),pmv(i+2,1:3));\r\n  end\r\n% repeat of moves\r\n fprintf('%2i %2i %2i\\n',pmv(end-2,:));\r\n fprintf('%2i %2i %2i\\n',pmv(end-1,:));\r\n fprintf('%2i %2i %2i\\n',pmv(end,:));","published":true,"deleted":false,"likes_count":1,"comments_count":2,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":5,"test_suite_updated_at":"2012-12-27T22:34:39.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-05-24T02:22:59.000Z","updated_at":"2025-02-01T14:24:16.000Z","published_at":"2012-05-24T04:50:47.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eChezz:...A simplified Chess game. Two game match with future multiple skill levels via evolutionary upgrades.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSimplified the rules to implement rapid move check. Normal Chess moves like \\\"a4\\\", Castling, and En Passant are accepted. Moves are simple vectors [idx_from idx_to promo] where promo is for pawns reaching the 8th rank. Piece names are numeric 1-6 White (P,R,N,B,Q,K) and Black is 7-12. Board empty space is 0.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eChezz unique rules: 1) To Win must remove opponent's King.. 2) Lose Turn if try an impossible move.. 3) Checks are ignored - allow move into check, castle out of check, castle thru/into check.. 4) Pawn promote to any piece, including opponent and vacuum.. 5) Six position repetition is a Draw..6) 50 moves No captures is a Draw..\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eInputs:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (b,pmv,castle)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ePlayer always appears to be White. However, Black may apparently move first.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eb (8x8) array with empty=0, White Pieces 1-6, Blk Pieces 7-12\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003epmv [from to promo] vector of both players moves (needed for en passant option). Illegal move creates a [0 0 0] pmv value. Size [2*moves,3]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ecastle: 6 pt logical vector to show castling options. 1 if piece is eligible. Positions are [8 40 64 1 33 57] for [WQR WK WKR BQR BK BKR]. . . eg castle mv [40 56 0]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eOutput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e mv [from to pawn_new_type] where from/to are 1-64 and pawn_new is 0 thru 12 if pawn is on final row.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe Test Suite will oversee two games with the Player as Black(moving second) and then as White.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ePassing:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Player must Win both games\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eEvolution:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Winning player algorithms will be hosted as Chezz_xyz based on their wins over other Chezz algorithms. Champions and the basis will be fully credited in Chezz updates. Champions must be able to play self and Not Cody timeout.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eChezz_000: Makes no moves or captures - The weakest player possible\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eLinks updated 12/27/12\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"}],"problem_search":{"errors":[],"problems":[{"id":715,"title":"Chezz_015 : Simplified chess","description":"Chezz:...A simplified Chess game. Two game match with future multiple skill levels via evolutionary upgrades.\r\n\r\nSimplified the rules to implement rapid move check. Normal Chess moves like \"a4\", Castling, and En Passant are accepted. Moves are simple vectors [idx_from idx_to promo] where promo is for pawns reaching the 8th rank. Piece names are numeric 1-6 White (P,R,N,B,Q,K) and Black is 7-12. Board empty space is 0.\r\n\r\nChezz unique rules: 1) To Win must remove opponent's King.. 2) Lose Turn if try an impossible move.. 3) Checks are ignored - allow move into check, castle out of check, castle thru/into check.. 4) Pawn promote to any piece, including opponent and vacuum.. 5) Six position repetition is a Draw..6) 50 moves No captures is a Draw..\r\n\r\n\r\n*Inputs:* (b,pmv,castle)\r\n\r\nPlayer always appears to be White. However, Black may apparently move first.\r\n\r\nb (8x8) array with empty=0, White Pieces 1-6, Blk Pieces 7-12\r\n\r\npmv [from to promo] vector of both players moves (needed for en passant option). Illegal move creates a [0 0 0] pmv value. Size [2*moves,3]\r\n\r\ncastle: 6 pt logical vector to show castling options. 1 if piece is eligible. Positions are [8 40 64 1 33 57] for [WQR WK WKR BQR BK BKR]. . . eg castle mv [40 56 0]\r\n\r\n\r\n\r\n*Output:* mv  [from to pawn_new_type] where from/to are 1-64 and pawn_new is 0 thru 12 if pawn is on final row.\r\n\r\n\r\n\r\nThe Test Suite will oversee two games with the Player as Black(moving second) and then as White.\r\n\r\n*Passing:* Player must Win both games\r\n\r\n*Evolution:* Winning player algorithms will be hosted as Chezz_xyz based on their wins over other Chezz algorithms. Champions and the basis will be fully credited in Chezz updates. Champions must be able to play self and Not Cody timeout.\r\n\r\n\r\nChezz_015: Pawn Serial Attack - Will capture and Promote\r\n\r\nLink update 12/27/12","description_html":"\u003cp\u003eChezz:...A simplified Chess game. Two game match with future multiple skill levels via evolutionary upgrades.\u003c/p\u003e\u003cp\u003eSimplified the rules to implement rapid move check. Normal Chess moves like \"a4\", Castling, and En Passant are accepted. Moves are simple vectors [idx_from idx_to promo] where promo is for pawns reaching the 8th rank. Piece names are numeric 1-6 White (P,R,N,B,Q,K) and Black is 7-12. Board empty space is 0.\u003c/p\u003e\u003cp\u003eChezz unique rules: 1) To Win must remove opponent's King.. 2) Lose Turn if try an impossible move.. 3) Checks are ignored - allow move into check, castle out of check, castle thru/into check.. 4) Pawn promote to any piece, including opponent and vacuum.. 5) Six position repetition is a Draw..6) 50 moves No captures is a Draw..\u003c/p\u003e\u003cp\u003e\u003cb\u003eInputs:\u003c/b\u003e (b,pmv,castle)\u003c/p\u003e\u003cp\u003ePlayer always appears to be White. However, Black may apparently move first.\u003c/p\u003e\u003cp\u003eb (8x8) array with empty=0, White Pieces 1-6, Blk Pieces 7-12\u003c/p\u003e\u003cp\u003epmv [from to promo] vector of both players moves (needed for en passant option). Illegal move creates a [0 0 0] pmv value. Size [2*moves,3]\u003c/p\u003e\u003cp\u003ecastle: 6 pt logical vector to show castling options. 1 if piece is eligible. Positions are [8 40 64 1 33 57] for [WQR WK WKR BQR BK BKR]. . . eg castle mv [40 56 0]\u003c/p\u003e\u003cp\u003e\u003cb\u003eOutput:\u003c/b\u003e mv  [from to pawn_new_type] where from/to are 1-64 and pawn_new is 0 thru 12 if pawn is on final row.\u003c/p\u003e\u003cp\u003eThe Test Suite will oversee two games with the Player as Black(moving second) and then as White.\u003c/p\u003e\u003cp\u003e\u003cb\u003ePassing:\u003c/b\u003e Player must Win both games\u003c/p\u003e\u003cp\u003e\u003cb\u003eEvolution:\u003c/b\u003e Winning player algorithms will be hosted as Chezz_xyz based on their wins over other Chezz algorithms. Champions and the basis will be fully credited in Chezz updates. Champions must be able to play self and Not Cody timeout.\u003c/p\u003e\u003cp\u003eChezz_015: Pawn Serial Attack - Will capture and Promote\u003c/p\u003e\u003cp\u003eLink update 12/27/12\u003c/p\u003e","function_template":"function mv=player_move(b,pmv,castle)\r\n% Author: Richard Z\r\n% Bot name: First Pawn Attack\r\n% Chezz_015\r\n% http://tinyurl.com/matlab-chezz-Cmove015\r\n%\r\n% 0-wht 1-Blk; board 8x8, opponents last move, \r\n% castle vector(8 40 64 1 33 57) 0=has moved, 1=eligible\r\n mv=zeros(1,3); % [from to promo] \r\n % mv =[39 37 0] is e4\r\n % pmv (opponents last move) is used for en passant\r\n % [0 0 0] is invalid move or first move of game\r\n % castle is used to castle yourself or see if opponent may castle\r\n \r\n pieces=1:6;\r\n enemy=7:12;\r\n\r\n pv=find(b==1);\r\n no_move=true;\r\n ptr=0;\r\n \r\n % loop thru pawns types; capture L/R or Move up\r\n \r\n while no_move\r\n  ptr=ptr+1;\r\n  if ptr\u003elength(pv),break;end\r\n  [r c]=ind2sub([8 8],pv(ptr));\r\n  if ismember(r,[1 8]),continue;end % end row for a P\r\n  if c==1\r\n   if ismember(b(pv(ptr)+7),enemy) % capture\r\n    mv=[pv(ptr) pv(ptr)+7 6];\r\n    return;\r\n   end\r\n  end\r\n  if c==8\r\n   if ismember(b(pv(ptr)-9),enemy) % capture\r\n    mv=[pv(ptr) pv(ptr)-9 6];\r\n    return;\r\n   end\r\n  end\r\n  if c\u003c8 \u0026\u0026 c\u003e1\r\n   if ismember(b(pv(ptr)+7),enemy) % capture\r\n    mv=[pv(ptr) pv(ptr)+7 6];\r\n    return;\r\n   end\r\n   if ismember(b(pv(ptr)-9),enemy) % capture\r\n    mv=[pv(ptr) pv(ptr)-9 6];\r\n    return;\r\n   end\r\n  end\r\n  \r\n  % Move fwd\r\n  if b(pv(ptr)-1)==0\r\n   mv=[pv(ptr) pv(ptr)-1 6];\r\n   return;\r\n  end\r\n  \r\n end % while no move\r\n\r\nend % End of Computer Champion Bot","test_suite":"%%\r\n% Load in the routines that play the game and check move validity\r\ntic\r\nurlwrite('http://rmatlabtest.appspot.com/Chezz_Shell.m','Chezz_Shell.m') ;\r\nurlwrite('http://rmatlabtest.appspot.com/ghost_white.m','ghost_white.m') \r\nurlwrite('http://rmatlabtest.appspot.com/computer_move015.m','computer_move.m') \r\nurlwrite('http://rmatlabtest.appspot.com/mov_chk.m','mov_chk.m') \r\nrehash path\r\ntoc\r\n%%\r\n% Play Two Chezz games\r\n% Player must win Twice to Pass\r\nglobal pmvout1 pmvout2\r\ntic\r\n wins=0; % player wins\r\n b=zeros(8);% P 1/7 R 2/8 N 3/9 B 4/10 Q 5/11 K 6/12 \r\n b(2,:)=7;\r\n b(1,:)=[8 9 10 11 12 10 9 8]; % Player 7:12\r\n b(7,:)=1;\r\n b(8,:)=b(1,:)-6; % Computer 1:6\r\n b_orig=b;\r\n \r\n %mv=zeros(1,3); % [from to promo)]  \r\n %computer_wht=0; % 0 Computer plays wht\r\n %computer_wht=1; % 1 Computer plays black\r\n \r\n pmv=zeros(1,3); % [from to promo)] Opponents last move\r\n castle=[1 1 1 1 1 1];\r\n % False move call to satisfy Cody Rqmt of TestSuite match Ref Solution\r\n mv=player_move(b,pmv,castle)\r\n  \r\n for computer_wht=0:1\r\n  pmvout1=pmv; % Store game 1 moves\r\n  \r\n  dbg=0;\r\n  game_over=false;\r\n  b=b_orig;\r\n  no_capture=0;\r\n  b_hist=zeros(102,8,8);\r\n  pmv=zeros(1,3); % [from to promo)] Opponents last move\r\n  castle=[1 1 1 1 1 1]; % History of if ever moved w/b Castles/kings\r\n %  idx 8 40 64  1 33 57\r\n \r\n while ~game_over\r\n  mvP=zeros(1,3); % [from to type/promote)] \r\n  % Shell 0=Blk,1=Wht;Board;move,prev move;\r\n  % function (1 Play Comp, 2 Player, 3 Check mv)\r\n  \r\n  % White move\r\n  if computer_wht==0\r\n   [mvP]=Chezz_Shell(0,b,mvP,pmv,castle,1); % 0 Wht,... 1 Computer\r\n  else\r\n   [mvP]=Chezz_Shell(0,b,mvP,pmv,castle,2); % 0 Wht  2 is player\r\n  end\r\n  \r\n  \r\n  [mv]=Chezz_Shell(0,b,mvP,pmv(end,:),castle,3); % 0 Wht,..., 3 Check\r\n  pmv=[pmv;mv(1:3)];\r\n  capture=false;\r\n  % Board changes only occur in Suite code\r\n  if mv(1)~=0 % Valid move determined by mv_chk\r\n   if mv(4)==0 % Normal moves and promotions\r\n    if b(mv(2))~=0,capture=true;end\r\n     b(mv(2))=b(mv(1)); % potential promotion\r\n     b(mv(1))=0;\r\n     if ismember(b(mv(2)),[1 7])\r\n      if ismember(mv(2),[1:8:57 8:8:64])\r\n       b(mv(2))=mv(3); % Place promoted selection\r\n      end\r\n     end\r\n     \r\n   else % ep or castle by White\r\n    if mv(4)==1 % castle 0-0 or 0-0-0\r\n      b(mv(1))=0;\r\n      b(mv(2))=6;\r\n      if mv(2)==24\r\n        b(8)=0;b(32)=2;  \r\n      else\r\n        b(64)=0;b(48)=2;\r\n      end    \r\n    end % castle\r\n    if mv(4)==2 % ep\r\n      capture=true;\r\n      b(mv(1))=0;\r\n      b(mv(2))=1; % White Pawn\r\n      b(mv(2)+1)=0; % Take pawn that passed\r\n    end % end ep\r\n   end % move implemented\r\n  end % end move\r\n  \r\n  %b % display board after move\r\n  \r\n  if isempty(find(b==12,1))\r\n   % Game over : Black King Captured\r\n   game_over=true; % change to if comp=wht or blk for win\r\n   if computer_wht==1 % Blk Computer King; Player is Wht captured Blk King \r\n    wins=wins+1;\r\n   end\r\n   continue;\r\n  end\r\n  \r\n  castle=castle.*logical([b(8)==2 b(40) b(64)==2 b(1)==8 b(33) b(57)==8]);\r\n  \r\n  if ~capture\r\n   no_capture=no_capture+1;\r\n   if no_capture\u003e100\r\n       fprintf('Draw 100 moves no capture\\n');\r\n       game_over=true;\r\n   end % move is b and w\r\n   b_hist(no_capture,:,:)=b;\r\n  else\r\n   no_capture=1;\r\n   b_hist=b_hist*0;\r\n   b_hist(no_capture,:,:)=b;\r\n  end\r\n   \r\n  % Black Move\r\n  mvP=zeros(1,4); % [from to type/promote specials(castle=1/ep=2)] \r\n if computer_wht==0\r\n   [mvP]=Chezz_Shell(1,b,mvP,pmv,castle,2); % 2 Blk,... 2 is player\r\n  else\r\n   [mvP]=Chezz_Shell(1,b,mvP,pmv,castle,1); % 2 Blk  1 is Computer\r\n end\r\n  \r\n  [mv]=Chezz_Shell(1,b,mvP,pmv(end,:),castle,3); % 2 Blk,..., 3 Check\r\n  \r\n pmv=[pmv;mv(1:3)];\r\n capture=false;\r\n  % Board changes only occur in Suite code\r\n  if mv(1)~=0 % Valid move determined by mv_chk\r\n   if mv(4)==0 % Normal moves and promotions\r\n    if b(mv(2))~=0,capture=true;end\r\n    b(mv(2))=b(mv(1)); % potential promotion\r\n    b(mv(1))=0;\r\n    if ismember(b(mv(2)),[1 7])\r\n     if ismember(mv(2),[1:8:57 8:8:64])\r\n      b(mv(2))=mv(3); % Place promoted selection\r\n     end\r\n    end\r\n   else % ep or castle by Black\r\n    if mv(4)==1 % castle 0-0 or 0-0-0\r\n      b(mv(1))=0;\r\n      b(mv(2))=12;\r\n      if mv(2)==49 % Blk 0-0\r\n        b(57)=0;b(41)=8;  \r\n      else % Blk 0-0-0\r\n        b(1)=0;b(25)=8;\r\n      end    \r\n    end % castle\r\n    if mv(4)==2 % ep by Black\r\n      capture=true;\r\n      b(mv(1))=0;\r\n      b(mv(2))=mv(3);\r\n    % White passed black on prior move\r\n      b(mv(2)-1)=0; \r\n    end % end ep\r\n   end % move implemented\r\n  end % end move\r\n  \r\n%   b\r\n%   figure(1);imagesc(b,[0 12]);axis equal;\r\n  \r\n  if isempty(find(b==6,1))\r\n   % Game over : Blk captured White King\r\n   game_over=true;\r\n   if computer_wht==0 % Wht Computer King; Player is Blk captured Wht King\r\n    wins=wins+1;\r\n   end\r\n   continue\r\n  end\r\n  \r\n  castle=castle.*logical([b(8)==2 b(40) b(64)==2 b(1)==8 b(33) b(57)==8]);\r\n  \r\n  if ~capture\r\n   no_capture=no_capture+1;\r\n   if no_capture\u003e100\r\n       fprintf('Draw 100 moves no capture\\n');\r\n       game_over=true;\r\n   end % move is b and w\r\n   b_hist(no_capture,:,:)=b;\r\n   % Check for 3 position repetition\r\n   for i=1:no_capture-1\r\n    cdelta=0;\r\n    for j=i+1:no_capture\r\n     delta=(b_hist(i,:,:)-b_hist(j,:,:));\r\n     if sum(abs(delta(:)))==0\r\n      cdelta=cdelta+1;\r\n     end\r\n    end\r\n    if cdelta\u003e=7 % repetitions 3 identical setups\r\n     fprintf('Game over due to repetition\\n');\r\n     game_over=true;\r\n    end\r\n   end % rep check loop \r\n  else\r\n   no_capture=1;\r\n   b_hist=b_hist*0;\r\n   b_hist(no_capture,:,:)=b;\r\n  end % ~capture\r\n  \r\n end % While ~game_over\r\n \r\n end % wht_blk\r\n\r\npmvout2=pmv;\r\nwins\r\n \r\n% Player must win Twice to Pass\r\ntoc\r\nassert(isequal(wins,2))\r\n\r\n%%\r\nglobal pmvout1 pmvout2\r\n% Output moves for games\r\n\r\n% Output game 2 moves\r\npmv=pmvout1;\r\n   for i=2:3:size(pmv,1)-3\r\n    fprintf('%2i %2i %2i %2i %2i %2i %2i %2i %2i \\n',pmv(i,1:3),pmv(i+1,1:3),pmv(i+2,1:3));\r\n   end\r\n   fprintf('%2i %2i %2i\\n',pmv(end-2,:));\r\n   fprintf('%2i %2i %2i\\n',pmv(end-1,:));\r\n   fprintf('%2i %2i %2i\\n',pmv(end,:));\r\n \r\n% Output game 2 moves\r\npmv=pmvout2;\r\n for i=2:3:size(pmv,1)-3\r\n  fprintf('%2i %2i %2i %2i %2i %2i %2i %2i %2i \\n',pmv(i,1:3),pmv(i+1,1:3),pmv(i+2,1:3));\r\n  end\r\n% repeat of moves\r\n fprintf('%2i %2i %2i\\n',pmv(end-2,:));\r\n fprintf('%2i %2i %2i\\n',pmv(end-1,:));\r\n fprintf('%2i %2i %2i\\n',pmv(end,:));","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":3,"test_suite_updated_at":"2012-12-27T22:40:04.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-05-24T04:58:57.000Z","updated_at":"2012-12-27T22:50:08.000Z","published_at":"2012-05-24T05:15:44.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eChezz:...A simplified Chess game. Two game match with future multiple skill levels via evolutionary upgrades.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSimplified the rules to implement rapid move check. Normal Chess moves like \\\"a4\\\", Castling, and En Passant are accepted. Moves are simple vectors [idx_from idx_to promo] where promo is for pawns reaching the 8th rank. Piece names are numeric 1-6 White (P,R,N,B,Q,K) and Black is 7-12. Board empty space is 0.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eChezz unique rules: 1) To Win must remove opponent's King.. 2) Lose Turn if try an impossible move.. 3) Checks are ignored - allow move into check, castle out of check, castle thru/into check.. 4) Pawn promote to any piece, including opponent and vacuum.. 5) Six position repetition is a Draw..6) 50 moves No captures is a Draw..\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eInputs:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (b,pmv,castle)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ePlayer always appears to be White. However, Black may apparently move first.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eb (8x8) array with empty=0, White Pieces 1-6, Blk Pieces 7-12\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003epmv [from to promo] vector of both players moves (needed for en passant option). Illegal move creates a [0 0 0] pmv value. Size [2*moves,3]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ecastle: 6 pt logical vector to show castling options. 1 if piece is eligible. Positions are [8 40 64 1 33 57] for [WQR WK WKR BQR BK BKR]. . . eg castle mv [40 56 0]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eOutput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e mv [from to pawn_new_type] where from/to are 1-64 and pawn_new is 0 thru 12 if pawn is on final row.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe Test Suite will oversee two games with the Player as Black(moving second) and then as White.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ePassing:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Player must Win both games\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eEvolution:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Winning player algorithms will be hosted as Chezz_xyz based on their wins over other Chezz algorithms. Champions and the basis will be fully credited in Chezz updates. Champions must be able to play self and Not Cody timeout.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eChezz_015: Pawn Serial Attack - Will capture and Promote\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eLink update 12/27/12\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":714,"title":"Chezz_000 : Simplified chess","description":"Chezz:...A simplified Chess game. Two game match with future multiple skill levels via evolutionary upgrades.\r\n\r\nSimplified the rules to implement rapid move check. Normal Chess moves like \"a4\", Castling, and En Passant are accepted. Moves are simple vectors [idx_from idx_to promo] where promo is for pawns reaching the 8th rank. Piece names are numeric 1-6 White (P,R,N,B,Q,K) and Black is 7-12. Board empty space is 0.\r\n\r\nChezz unique rules: 1) To Win must remove opponent's King.. 2) Lose Turn if try an impossible move.. 3) Checks are ignored - allow move into check, castle out of check, castle thru/into check.. 4) Pawn promote to any piece, including opponent and vacuum.. 5) Six position repetition is a Draw..6) 50 moves No captures is a Draw..\r\n\r\n\r\n*Inputs:* (b,pmv,castle)\r\n\r\nPlayer always appears to be White. However, Black may apparently move first.\r\n\r\nb (8x8) array with empty=0, White Pieces 1-6, Blk Pieces 7-12\r\n\r\npmv [from to promo] vector of both players moves (needed for en passant option). Illegal move creates a [0 0 0] pmv value. Size [2*moves,3]\r\n\r\ncastle: 6 pt logical vector to show castling options. 1 if piece is eligible. Positions are [8 40 64 1 33 57] for [WQR WK WKR BQR BK BKR]. . . eg castle mv [40 56 0]\r\n\r\n\r\n\r\n*Output:* mv  [from to pawn_new_type] where from/to are 1-64 and pawn_new is 0 thru 12 if pawn is on final row.\r\n\r\n\r\n\r\nThe Test Suite will oversee two games with the Player as Black(moving second) and then as White.\r\n\r\n*Passing:* Player must Win both games\r\n\r\n*Evolution:* Winning player algorithms will be hosted as Chezz_xyz based on their wins over other Chezz algorithms. Champions and the basis will be fully credited in Chezz updates. Champions must be able to play self and Not Cody timeout.\r\n\r\n\r\nChezz_000: Makes no moves or captures - The weakest player possible\r\n\r\nLinks updated 12/27/12\r\n\r\n","description_html":"\u003cp\u003eChezz:...A simplified Chess game. Two game match with future multiple skill levels via evolutionary upgrades.\u003c/p\u003e\u003cp\u003eSimplified the rules to implement rapid move check. Normal Chess moves like \"a4\", Castling, and En Passant are accepted. Moves are simple vectors [idx_from idx_to promo] where promo is for pawns reaching the 8th rank. Piece names are numeric 1-6 White (P,R,N,B,Q,K) and Black is 7-12. Board empty space is 0.\u003c/p\u003e\u003cp\u003eChezz unique rules: 1) To Win must remove opponent's King.. 2) Lose Turn if try an impossible move.. 3) Checks are ignored - allow move into check, castle out of check, castle thru/into check.. 4) Pawn promote to any piece, including opponent and vacuum.. 5) Six position repetition is a Draw..6) 50 moves No captures is a Draw..\u003c/p\u003e\u003cp\u003e\u003cb\u003eInputs:\u003c/b\u003e (b,pmv,castle)\u003c/p\u003e\u003cp\u003ePlayer always appears to be White. However, Black may apparently move first.\u003c/p\u003e\u003cp\u003eb (8x8) array with empty=0, White Pieces 1-6, Blk Pieces 7-12\u003c/p\u003e\u003cp\u003epmv [from to promo] vector of both players moves (needed for en passant option). Illegal move creates a [0 0 0] pmv value. Size [2*moves,3]\u003c/p\u003e\u003cp\u003ecastle: 6 pt logical vector to show castling options. 1 if piece is eligible. Positions are [8 40 64 1 33 57] for [WQR WK WKR BQR BK BKR]. . . eg castle mv [40 56 0]\u003c/p\u003e\u003cp\u003e\u003cb\u003eOutput:\u003c/b\u003e mv  [from to pawn_new_type] where from/to are 1-64 and pawn_new is 0 thru 12 if pawn is on final row.\u003c/p\u003e\u003cp\u003eThe Test Suite will oversee two games with the Player as Black(moving second) and then as White.\u003c/p\u003e\u003cp\u003e\u003cb\u003ePassing:\u003c/b\u003e Player must Win both games\u003c/p\u003e\u003cp\u003e\u003cb\u003eEvolution:\u003c/b\u003e Winning player algorithms will be hosted as Chezz_xyz based on their wins over other Chezz algorithms. Champions and the basis will be fully credited in Chezz updates. Champions must be able to play self and Not Cody timeout.\u003c/p\u003e\u003cp\u003eChezz_000: Makes no moves or captures - The weakest player possible\u003c/p\u003e\u003cp\u003eLinks updated 12/27/12\u003c/p\u003e","function_template":"function mv=player_move(b,pmv,castle)\r\n% Author: Richard Z\r\n% Bot name: Do Nothing\r\n% Chezz_000\r\n%Chezz_000 bot is no legal moves mv=[0 0 0]\r\n%\r\n% 0-wht 1-Blk; board 8x8, opponents last move, \r\n% castle vector(8 40 64 1 33 57) 0=has moved, 1=eligible\r\n% example: mv =[39 37 0] is e4\r\n% pmv (move,from to promo) is used for en passant\r\n% [0 0 0] is invalid move or first move of game\r\n% castle vector is used to castle yourself or see if opponent may castle\r\n \r\n% This is the computer's algorithm - Going for a draw\r\n mv=zeros(1,3); % [from to promo] \r\nend % End of Computer Champion Bot","test_suite":"%%\r\n% Load in the routines that play the game and check move validity\r\ntic\r\nurlwrite('http://rmatlabtest.appspot.com/Chezz_Shell.m','Chezz_Shell.m') ;\r\nurlwrite('http://rmatlabtest.appspot.com/ghost_white.m','ghost_white.m') \r\nurlwrite('http://rmatlabtest.appspot.com/computer_move000.m','computer_move.m') \r\nurlwrite('http://rmatlabtest.appspot.com/mov_chk.m','mov_chk.m') \r\nrehash path\r\ntoc\r\n%%\r\n% Play Two Chezz games\r\n% Player must win Twice to Pass\r\nglobal pmvout1 pmvout2\r\ntic\r\n wins=0; % player wins\r\n b=zeros(8);% P 1/7 R 2/8 N 3/9 B 4/10 Q 5/11 K 6/12 \r\n b(2,:)=7;\r\n b(1,:)=[8 9 10 11 12 10 9 8]; % Player 7:12\r\n b(7,:)=1;\r\n b(8,:)=b(1,:)-6; % Computer 1:6\r\n b_orig=b;\r\n \r\n %mv=zeros(1,3); % [from to promo)]  \r\n %computer_wht=0; % 0 Computer plays wht\r\n %computer_wht=1; % 1 Computer plays black\r\n \r\n pmv=zeros(1,3); % [from to promo)] Opponents last move\r\n castle=[1 1 1 1 1 1];\r\n % False move call to satisfy Cody Rqmt of TestSuite match Ref Solution\r\n mv=player_move(b,pmv,castle)\r\n  \r\n for computer_wht=0:1\r\n  pmvout1=pmv; % Store game 1 moves\r\n  \r\n  dbg=0;\r\n  game_over=false;\r\n  b=b_orig;\r\n  no_capture=0;\r\n  b_hist=zeros(102,8,8);\r\n  pmv=zeros(1,3); % [from to promo)] Opponents last move\r\n  castle=[1 1 1 1 1 1]; % History of if ever moved w/b Castles/kings\r\n %  idx 8 40 64  1 33 57\r\n \r\n while ~game_over\r\n  mvP=zeros(1,3); % [from to type/promote)] \r\n  % Shell 0=Blk,1=Wht;Board;move,prev move;\r\n  % function (1 Play Comp, 2 Player, 3 Check mv)\r\n  \r\n  % White move\r\n  if computer_wht==0\r\n   [mvP]=Chezz_Shell(0,b,mvP,pmv,castle,1); % 0 Wht,... 1 Computer\r\n  else\r\n   [mvP]=Chezz_Shell(0,b,mvP,pmv,castle,2); % 0 Wht  2 is player\r\n  end\r\n  \r\n  \r\n  [mv]=Chezz_Shell(0,b,mvP,pmv(end,:),castle,3); % 0 Wht,..., 3 Check\r\n  pmv=[pmv;mv(1:3)];\r\n  capture=false;\r\n  % Board changes only occur in Suite code\r\n  if mv(1)~=0 % Valid move determined by mv_chk\r\n   if mv(4)==0 % Normal moves and promotions\r\n    if b(mv(2))~=0,capture=true;end\r\n     b(mv(2))=b(mv(1)); % potential promotion\r\n     b(mv(1))=0;\r\n     if ismember(b(mv(2)),[1 7])\r\n      if ismember(mv(2),[1:8:57 8:8:64])\r\n       b(mv(2))=mv(3); % Place promoted selection\r\n      end\r\n     end\r\n     \r\n   else % ep or castle by White\r\n    if mv(4)==1 % castle 0-0 or 0-0-0\r\n      b(mv(1))=0;\r\n      b(mv(2))=6;\r\n      if mv(2)==24\r\n        b(8)=0;b(32)=2;  \r\n      else\r\n        b(64)=0;b(48)=2;\r\n      end    \r\n    end % castle\r\n    if mv(4)==2 % ep\r\n      capture=true;\r\n      b(mv(1))=0;\r\n      b(mv(2))=1; % White Pawn\r\n      b(mv(2)+1)=0; % Take pawn that passed\r\n    end % end ep\r\n   end % move implemented\r\n  end % end move\r\n  \r\n  %b % display board after move\r\n  \r\n  if isempty(find(b==12,1))\r\n   % Game over : Black King Captured\r\n   game_over=true; % change to if comp=wht or blk for win\r\n   if computer_wht==1 % Blk Computer King; Player is Wht captured Blk King \r\n    wins=wins+1;\r\n   end\r\n   continue;\r\n  end\r\n  \r\n  castle=castle.*logical([b(8)==2 b(40) b(64)==2 b(1)==8 b(33) b(57)==8]);\r\n  \r\n  if ~capture\r\n   no_capture=no_capture+1;\r\n   if no_capture\u003e100\r\n       fprintf('Draw 100 moves no capture\\n');\r\n       game_over=true;\r\n   end % move is b and w\r\n   b_hist(no_capture,:,:)=b;\r\n  else\r\n   no_capture=1;\r\n   b_hist=b_hist*0;\r\n   b_hist(no_capture,:,:)=b;\r\n  end\r\n   \r\n  % Black Move\r\n  mvP=zeros(1,4); % [from to type/promote specials(castle=1/ep=2)] \r\n if computer_wht==0\r\n   [mvP]=Chezz_Shell(1,b,mvP,pmv,castle,2); % 2 Blk,... 2 is player\r\n  else\r\n   [mvP]=Chezz_Shell(1,b,mvP,pmv,castle,1); % 2 Blk  1 is Computer\r\n end\r\n  \r\n  [mv]=Chezz_Shell(1,b,mvP,pmv(end,:),castle,3); % 2 Blk,..., 3 Check\r\n  \r\n pmv=[pmv;mv(1:3)];\r\n capture=false;\r\n  % Board changes only occur in Suite code\r\n  if mv(1)~=0 % Valid move determined by mv_chk\r\n   if mv(4)==0 % Normal moves and promotions\r\n    if b(mv(2))~=0,capture=true;end\r\n    b(mv(2))=b(mv(1)); % potential promotion\r\n    b(mv(1))=0;\r\n    if ismember(b(mv(2)),[1 7])\r\n     if ismember(mv(2),[1:8:57 8:8:64])\r\n      b(mv(2))=mv(3); % Place promoted selection\r\n     end\r\n    end\r\n   else % ep or castle by Black\r\n    if mv(4)==1 % castle 0-0 or 0-0-0\r\n      b(mv(1))=0;\r\n      b(mv(2))=12;\r\n      if mv(2)==49 % Blk 0-0\r\n        b(57)=0;b(41)=8;  \r\n      else % Blk 0-0-0\r\n        b(1)=0;b(25)=8;\r\n      end    \r\n    end % castle\r\n    if mv(4)==2 % ep by Black\r\n      capture=true;\r\n      b(mv(1))=0;\r\n      b(mv(2))=mv(3);\r\n    % White passed black on prior move\r\n      b(mv(2)-1)=0; \r\n    end % end ep\r\n   end % move implemented\r\n  end % end move\r\n  \r\n%   b\r\n%   figure(1);imagesc(b,[0 12]);axis equal;\r\n  \r\n  if isempty(find(b==6,1))\r\n   % Game over : Blk captured White King\r\n   game_over=true;\r\n   if computer_wht==0 % Wht Computer King; Player is Blk captured Wht King\r\n    wins=wins+1;\r\n   end\r\n   continue\r\n  end\r\n  \r\n  castle=castle.*logical([b(8)==2 b(40) b(64)==2 b(1)==8 b(33) b(57)==8]);\r\n  \r\n  if ~capture\r\n   no_capture=no_capture+1;\r\n   if no_capture\u003e100\r\n       fprintf('Draw 100 moves no capture\\n');\r\n       game_over=true;\r\n   end % move is b and w\r\n   b_hist(no_capture,:,:)=b;\r\n   % Check for 3 position repetition\r\n   for i=1:no_capture-1\r\n    cdelta=0;\r\n    for j=i+1:no_capture\r\n     delta=(b_hist(i,:,:)-b_hist(j,:,:));\r\n     if sum(abs(delta(:)))==0\r\n      cdelta=cdelta+1;\r\n     end\r\n    end\r\n    if cdelta\u003e=7 % repetitions 3 identical setups\r\n     fprintf('Game over due to repetition\\n');\r\n     game_over=true;\r\n    end\r\n   end % rep check loop \r\n  else\r\n   no_capture=1;\r\n   b_hist=b_hist*0;\r\n   b_hist(no_capture,:,:)=b;\r\n  end % ~capture\r\n  \r\n end % While ~game_over\r\n \r\n end % wht_blk\r\n\r\npmvout2=pmv;\r\nwins\r\n \r\n% Player must win Twice to Pass\r\ntoc\r\nassert(isequal(wins,2))\r\n\r\n%%\r\nglobal pmvout1 pmvout2\r\n% Output moves for games\r\n\r\n% Output game 2 moves\r\npmv=pmvout1;\r\n   for i=2:3:size(pmv,1)-3\r\n    fprintf('%2i %2i %2i %2i %2i %2i %2i %2i %2i \\n',pmv(i,1:3),pmv(i+1,1:3),pmv(i+2,1:3));\r\n   end\r\n   fprintf('%2i %2i %2i\\n',pmv(end-2,:));\r\n   fprintf('%2i %2i %2i\\n',pmv(end-1,:));\r\n   fprintf('%2i %2i %2i\\n',pmv(end,:));\r\n \r\n% Output game 2 moves\r\npmv=pmvout2;\r\n for i=2:3:size(pmv,1)-3\r\n  fprintf('%2i %2i %2i %2i %2i %2i %2i %2i %2i \\n',pmv(i,1:3),pmv(i+1,1:3),pmv(i+2,1:3));\r\n  end\r\n% repeat of moves\r\n fprintf('%2i %2i %2i\\n',pmv(end-2,:));\r\n fprintf('%2i %2i %2i\\n',pmv(end-1,:));\r\n fprintf('%2i %2i %2i\\n',pmv(end,:));","published":true,"deleted":false,"likes_count":1,"comments_count":2,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":5,"test_suite_updated_at":"2012-12-27T22:34:39.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-05-24T02:22:59.000Z","updated_at":"2025-02-01T14:24:16.000Z","published_at":"2012-05-24T04:50:47.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eChezz:...A simplified Chess game. Two game match with future multiple skill levels via evolutionary upgrades.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSimplified the rules to implement rapid move check. Normal Chess moves like \\\"a4\\\", Castling, and En Passant are accepted. Moves are simple vectors [idx_from idx_to promo] where promo is for pawns reaching the 8th rank. Piece names are numeric 1-6 White (P,R,N,B,Q,K) and Black is 7-12. Board empty space is 0.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eChezz unique rules: 1) To Win must remove opponent's King.. 2) Lose Turn if try an impossible move.. 3) Checks are ignored - allow move into check, castle out of check, castle thru/into check.. 4) Pawn promote to any piece, including opponent and vacuum.. 5) Six position repetition is a Draw..6) 50 moves No captures is a Draw..\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eInputs:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (b,pmv,castle)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ePlayer always appears to be White. However, Black may apparently move first.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eb (8x8) array with empty=0, White Pieces 1-6, Blk Pieces 7-12\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003epmv [from to promo] vector of both players moves (needed for en passant option). Illegal move creates a [0 0 0] pmv value. Size [2*moves,3]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ecastle: 6 pt logical vector to show castling options. 1 if piece is eligible. Positions are [8 40 64 1 33 57] for [WQR WK WKR BQR BK BKR]. . . eg castle mv [40 56 0]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eOutput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e mv [from to pawn_new_type] where from/to are 1-64 and pawn_new is 0 thru 12 if pawn is on final row.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe Test Suite will oversee two games with the Player as Black(moving second) and then as White.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ePassing:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Player must Win both games\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eEvolution:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Winning player algorithms will be hosted as Chezz_xyz based on their wins over other Chezz algorithms. Champions and the basis will be fully credited in Chezz updates. Champions must be able to play self and Not Cody timeout.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eChezz_000: Makes no moves or captures - The weakest player possible\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eLinks updated 12/27/12\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"}],"term":"tag:\"cody shell\"","current_player_id":null,"fields":[{"name":"page","type":"integer","callback":null,"default":1,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"per_page","type":"integer","callback":null,"default":50,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"sort","type":"string","callback":null,"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"body","type":"text","callback":null,"default":"*:*","directive":null,"facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":false},{"name":"group","type":"string","callback":null,"default":null,"directive":"group","facet":true,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"difficulty_rating_bin","type":"string","callback":null,"default":null,"directive":"difficulty_rating_bin","facet":true,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"id","type":"integer","callback":null,"default":null,"directive":"id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"tag","type":"string","callback":null,"default":null,"directive":"tag","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"product","type":"string","callback":null,"default":null,"directive":"product","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"created_at","type":"timeframe","callback":{},"default":null,"directive":"created_at","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"profile_id","type":"integer","callback":null,"default":null,"directive":"author_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"created_by","type":"string","callback":null,"default":null,"directive":"author","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"player_id","type":"integer","callback":null,"default":null,"directive":"solver_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"player","type":"string","callback":null,"default":null,"directive":"solver","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"solvers_count","type":"integer","callback":null,"default":null,"directive":"solvers_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"comments_count","type":"integer","callback":null,"default":null,"directive":"comments_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"likes_count","type":"integer","callback":null,"default":null,"directive":"likes_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"leader_id","type":"integer","callback":null,"default":null,"directive":"leader_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"leading_solution","type":"integer","callback":null,"default":null,"directive":"leading_solution","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true}],"filters":[{"name":"asset_type","type":"string","callback":null,"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":"\"cody:problem\"","prepend":true},{"name":"profile_id","type":"integer","callback":{},"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":"author_id","static":null,"prepend":true}],"query":{"params":{"per_page":50,"term":"tag:\"cody shell\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"cody shell\"","","\"","cody shell","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f69f26f3980\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f69f26f38e0\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f69f26f3020\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f69f26f3c00\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f69f26f3b60\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f69f26f3ac0\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f69f26f3a20\u003e":"tag:\"cody shell\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f69f26f3a20\u003e":"tag:\"cody shell\""},"queried_facets":{}},"query_backend":{"connection":{"configuration":{"index_url":"http://index-op-v2/solr/","query_url":"http://search-op-v2/solr/","direct_access_index_urls":["http://index-op-v2/solr/"],"direct_access_query_urls":["http://search-op-v2/solr/"],"timeout":10,"vhost":"search","exchange":"search.topic","heartbeat":30,"pre_index_mode":false,"host":"rabbitmq-eks","port":5672,"username":"cody-search","password":"78X075ddcV44","virtual_host":"search","indexer":"amqp","http_logging":"true","core":"cody"},"query_connection":{"uri":"http://search-op-v2/solr/cody/","proxy":null,"connection":{"parallel_manager":null,"headers":{"User-Agent":"Faraday v1.0.1"},"params":{},"options":{"params_encoder":"Faraday::FlatParamsEncoder","proxy":null,"bind":null,"timeout":null,"open_timeout":null,"read_timeout":null,"write_timeout":null,"boundary":null,"oauth":null,"context":null,"on_data":null},"ssl":{"verify":true,"ca_file":null,"ca_path":null,"verify_mode":null,"cert_store":null,"client_cert":null,"client_key":null,"certificate":null,"private_key":null,"verify_depth":null,"version":null,"min_version":null,"max_version":null},"default_parallel_manager":null,"builder":{"adapter":{"name":"Faraday::Adapter::NetHttp","args":[],"block":null},"handlers":[{"name":"Faraday::Response::RaiseError","args":[],"block":null}],"app":{"app":{"ssl_cert_store":{"verify_callback":null,"error":null,"error_string":null,"chain":null,"time":null},"app":{},"connection_options":{},"config_block":null}}},"url_prefix":"http://search-op-v2/solr/cody/","manual_proxy":false,"proxy":null},"update_format":"RSolr::JSON::Generator","update_path":"update","options":{"url":"http://search-op-v2/solr/cody"}}},"query":{"params":{"per_page":50,"term":"tag:\"cody shell\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"cody shell\"","","\"","cody shell","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f69f26f3980\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f69f26f38e0\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f69f26f3020\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f69f26f3c00\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f69f26f3b60\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f69f26f3ac0\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f69f26f3a20\u003e":"tag:\"cody shell\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f69f26f3a20\u003e":"tag:\"cody shell\""},"queried_facets":{}},"options":{"fields":["id","difficulty_rating"]},"join":" "},"results":[{"id":715,"difficulty_rating":"unrated"},{"id":714,"difficulty_rating":"unrated"}]}}