// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: packimports(3) // Source File Name: PinChess.java import java.applet.Applet; import java.awt.*; public class PinChess extends Chess { public PinChess() { } public void twoassailants() { if(assailant_rank != 0) { assailant2_rank = assailant_rank; assailant2_file = assailant_file; } } public void SupplementalInit(){ pinned=new boolean[10][10]; maybe_pinned=new boolean[10][10]; } public void DisplayRules(Graphics g) { LowRectangle(g); g.drawString("Pinned units can't give check.", 5, 285); } public void DrawNowBoard(Graphics g) { for(ee=1; ee < 9; ee++) for(ff=1; ff < 9; ff++) NowBoard.sq_[ff][ee].drawchsqBATAK(g, 1, icanmove[ff][ee], pinned[ff][ee],false); } public boolean IsEnemyBishop(int i, int j) { if((j > 8) | (j < 1) | (i > 8) | (i < 1)) return false; if(maybe_pinned[i][j]) return false; if(MaybeBoard.sq_[i][j].piece_ == 4) { twoassailants(); assailant_rank=i; assailant_file=j; return true; } if(MaybeBoard.sq_[i][j].piece_ == 9) { twoassailants(); assailant_rank=i; assailant_file=j; return true; } else { return false; } } public boolean IsEnemyKing(int i, int j, int k) { if((j > 8) | (j < 1) | (i > 8) | (i < 1)) return false; if(maybe_pinned[i][j]) return false; if(MaybeBoard.sq_[i][j].side_ == k) return false; if(MaybeBoard.sq_[i][j].piece_ == -1) { twoassailants(); assailant_rank=i; assailant_file=j; return true; } if(MaybeBoard.sq_[i][j].piece_ == -2) { twoassailants(); assailant_rank=i; assailant_file=j; return true; } else { return false; } } public boolean IsEnemyKnight(int i, int j, int k) { if((j > 8) | (j < 1) | (i > 8) | (i < 1)) return false; if(maybe_pinned[i][j]) return false; if(MaybeBoard.sq_[i][j].side_ == k) return false; if(MaybeBoard.sq_[i][j].piece_ == 3) { twoassailants(); assailant_rank=i; assailant_file=j; return true; } else { return false; } } public boolean IsEnemyPawn(int i, int j, int k) { if((j > 8) | (j < 1) | (i > 8) | (i < 1)) return false; if(maybe_pinned[i][j]) return false; if(MaybeBoard.sq_[i][j].side_ == k) return false; if(MaybeBoard.sq_[i][j].piece_ == 1) { twoassailants(); assailant_rank=i; assailant_file=j; return true; } if(MaybeBoard.sq_[i][j].piece_ == 2) { twoassailants(); assailant_rank=i; assailant_file=j; return true; } else { return false; } } public boolean IsEnemyRook(int i, int j) { if((j > 8) | (j < 1) | (i > 8) | (i < 1)) return false; if(maybe_pinned[i][j]) return false; if(MaybeBoard.sq_[i][j].piece_ == 5) { twoassailants(); assailant_rank=i; assailant_file=j; return true; } if(MaybeBoard.sq_[i][j].piece_ == 6) { twoassailants(); assailant_rank=i; assailant_file=j; return true; } if(MaybeBoard.sq_[i][j].piece_ == 9) { twoassailants(); assailant_rank=i; assailant_file=j; return true; } else { return false; } } public boolean MachineMoves(Graphics g, int i) { if(GameOver) return true; NegateGMCounts();goodmove1=0; goodmove2=0; goodmove3=0; goodmove4=0; goodmove5=0; goodmove6=0; goodmove7=0; goodmove8=0; goodmove9=0; goodmove10=0; moveCounter=0; if(!opening_library()) { gametreecounter=0; if(how_deep_to_seek > 3) depth=1; bestvcom1=-5000; for(x_run[1]=1; x_run[1] < 9; x_run[1]++) for(y_run[1]=1; y_run[1] < 9; y_run[1]++) if(NowBoard.sq_[y_run[1]][x_run[1]].side_ == i) findPieceMoves(g, NowBoard.sq_[y_run[1]][x_run[1]], NowBoard, MaybeBoard); depth=0; ShowStatusNothing(); ShowStatusNothing(); if(moveCounter == 0) { System.out.println("No Moves");WhoIsHuman[1]=true;WhoIsHuman[2]=true;ShowStatusQ("No Moves"); return false; } x=1 + (int)Math.floor(Math.random() * (double)moveCounter); if(Attackers[MaybeMoves[x].endingsquare_.rank_][MaybeMoves[x].endingsquare_.file_][3 - i] > Attackers[MaybeMoves[x].endingsquare_.rank_][MaybeMoves[x].endingsquare_.file_][i]) x=1 + (int)Math.floor(Math.random() * (double)moveCounter); if(Attackers[MaybeMoves[x].endingsquare_.rank_][MaybeMoves[x].endingsquare_.file_][3 - i] > Attackers[MaybeMoves[x].endingsquare_.rank_][MaybeMoves[x].endingsquare_.file_][i]) x=1 + (int)Math.floor(Math.random() * (double)moveCounter); if(goodmove1 > 0) x=goodmove1; if(goodmove2 > 0) x=goodmove2; if(goodmove3 > 0) x=goodmove3; if(goodmove4 > 0) x=goodmove4; if(goodmove5 > 0) x=goodmove5; if(goodmove6 > 0) x=goodmove6; if(goodmove7 > 0) x=goodmove7; if(goodmove8 > 0) x=goodmove8; if(goodmove9 > 0) x=goodmove9; if(goodmove10 > 0) x=goodmove10; moveto_file=MaybeMoves[x].endingsquare_.file_; moveto_rank=MaybeMoves[x].endingsquare_.rank_; mover_file=MaybeMoves[x].startingsquare_.file_; mover_rank=MaybeMoves[x].startingsquare_.rank_; RedCastleCheat(); } NormalMove(g); NowBoard.sq_[mover_rank][mover_file].drawchsqBATAK(g, 1, false, pinned[mover_rank][mover_file],false); NowBoard.sq_[moveto_rank][moveto_file].drawchsqBATAK(g, 1, false, pinned[moveto_rank][moveto_file],false); MaybeBoard.sq_[mover_rank][mover_file].side_=NowBoard.sq_[mover_rank][mover_file].side_; MaybeBoard.sq_[moveto_rank][moveto_file].side_=NowBoard.sq_[moveto_rank][moveto_file].side_; MaybeBoard.sq_[mover_rank][mover_file].piece_=NowBoard.sq_[mover_rank][mover_file].piece_; MaybeBoard.sq_[moveto_rank][moveto_file].piece_=NowBoard.sq_[moveto_rank][moveto_file].piece_; TotalMaybeBoard(NowBoard,MaybeBoard);DidICheckOrStalemate(g, i); if(GameOver) return true; if(fifty_move_rule>100) { fifty_move_rule=0; DrawNowBoard(g);ShowStatusQ("Fifty move rule!"); drawn_games++; GameOver=true; return false; } else { MachineMoveExtra(g, i); return true; } } public boolean MaybeAdd(Graphics g, Chsq chsq, CB10_10 cb10_10, CB10_10 cb10_10_1) { assailant_rank=0; assailant2_rank=0; assailant_file=0; assailant2_file=0; CheckSquare[depth]=false; SquatterOnCheckSquare[depth]=false; if((c[depth] < 1) | (c[depth] > 8) | (d[depth] < 1) | (d[depth] > 8)) return false; if(!PassedOtherRequirementsToKeep(chsq, cb10_10, cb10_10_1)) return false; if(cb10_10.sq_[d[depth]][c[depth]].side_ == chsq.side_) return false; if(depth < 4) alterMaybeBoard(g, chsq, cb10_10.sq_[d[depth]][c[depth]], cb10_10, cb10_10_1); if(depth < 2) { WhoIsMaybePinned(); if(IsMySideInCheck(chsq.side_)) { if (ExtenuatingCircumstances(chsq)==false) { unalterMaybeBoard(g, chsq, cb10_10.sq_[d[depth]][c[depth]], cb10_10, cb10_10_1); CheckSquare[depth]=true; if(NowBoard.sq_[d[depth]][c[depth]].piece_ != 0) SquatterOnCheckSquare[depth]=true; return false; } } if(chsq.side_ == whoseMove) { assailant2_rank=0; assailant2_file=0; assailant_rank=0; assailant_file=0; } if ((how_deep_to_seek<4)&(seek_sacrificial_wins==false)&(WhoIsHuman[whoseMove]==false)&(moveCounter>0)&(chsq.side_==whoseMove)) { if ((Attackers[d[depth]][c[depth]][3-chsq.side_]>0)&(chsq.strength()>NowBoard.sq_[d[depth]][c[depth]].strength())& ( (WeakestAttacker[d[depth]][c[depth]][3-chsq.side_]Attackers[d[depth]][c[depth]][chsq.side_]-1) ) &(IsMySideInCheck(3-chsq.side_)==false) /// HEEEERE ) { // SquatterOnCheckSquare[depth]=true; SquatterOnCheckSquare[depth]=false; if(cb10_10.sq_[d[depth]][c[depth]].piece_ != 0) SquatterOnCheckSquare[depth]=true; if (NowBoard.sq_[d[depth]][c[depth]].piece_==0){CheckSquare[depth]=true;} unalterMaybeBoard(g, chsq, cb10_10.sq_[d[depth]][c[depth]], cb10_10, cb10_10_1); return false; } } good_move=1; good_counter=1; if(moveCounter > 500) good_move=1; for(; good_counter <= good_move; good_counter++) { moveCounter++; if ((halt_if_king_taken==true)&(skipDtGM==false)&(depth<2)&(NowBoard.sq_[d[depth]][c[depth]].piece_<0)){goodmove10=moveCounter;System.out.print("King captured"+""+chsq.rank_+""+chsq.file_+""+d[depth]+""+c[depth]);WhoIsHuman[1]=true;WhoIsHuman[2]=true;} MaybeMoves[moveCounter].startingsquare_=chsq; MaybeMoves[moveCounter].endingsquare_=NowBoard.sq_[d[depth]][c[depth]]; } DesignateTheGoodMoves(chsq); if((worried) & (IsThisAGoodMove()==false) & (moveCounter > 1) & (!WhoIsHuman[whoseMove])) moveCounter--; } if((depth == 1) & (!skipDtGM)) { vcom1=valuoo(NowBoard.sq_[d[1]][c[1]].piece_, NowBoard, MaybeBoard); depth=2; he_moved[2]=false; bestvcom2=5000; for(x_run[2]=1; x_run[2] < 9; x_run[2]++) for(y_run[2]=1; y_run[2] < 9; y_run[2]++) if(MaybeBoard.sq_[y_run[2]][x_run[2]].side_ == 3 - whoseMove) { TotalMaybeBoard(MaybeBoard, TwoBoard); findPieceMoves(g, MaybeBoard.sq_[y_run[2]][x_run[2]], MaybeBoard, TwoBoard); } depth=1; if(bestvcom1 <= vcom1 + bestvcom2) { if(bestvcom1 < vcom1 + bestvcom2) gametreecounter=0; if(bestvcom1 == vcom1 + bestvcom2) gametreecounter++; bestvcom1=vcom1 + bestvcom2; if(Math.random() * (double)(1 + gametreecounter) < 1.0D) goodmove10=moveCounter; } } else if((depth == 2) & (!skipDtGM)) { vcom2=-valuoo(MaybeBoard.sq_[d[2]][c[2]].piece_, MaybeBoard, TwoBoard); depth=3; he_moved[3]=false; bestvcom3=-5000; for(x_run[3]=1; x_run[3] < 9; x_run[3]++) for(y_run[3]=1; y_run[3] < 9; y_run[3]++) if(TwoBoard.sq_[y_run[3]][x_run[3]].side_ == whoseMove) { TotalMaybeBoard(TwoBoard, ThreeBoard); findPieceMoves(g, TwoBoard.sq_[y_run[3]][x_run[3]], TwoBoard, ThreeBoard); } depth=2; if(!he_moved[3]) bestvcom3=0; if(bestvcom2 > vcom2 + bestvcom3) bestvcom2=vcom2 + bestvcom3; } else if((depth == 3) & (!skipDtGM)) { vcom3=valuoo(TwoBoard.sq_[d[3]][c[3]].piece_, TwoBoard, ThreeBoard); if(vcom1 + vcom2 + vcom3 < bestvcom1) { unalterMaybeBoard(g, chsq, cb10_10.sq_[d[depth]][c[depth]], cb10_10, cb10_10_1); return true; } if(how_deep_to_seek > 3) { depth=4; he_moved[4]=false; bestvcom4=5000; for(x_run[4]=1; x_run[4] < 9; x_run[4]++) for(y_run[4]=1; y_run[4] < 9; y_run[4]++) if(ThreeBoard.sq_[y_run[4]][x_run[4]].side_ == 3 - whoseMove) findPieceMoves(g, ThreeBoard.sq_[y_run[4]][x_run[4]], ThreeBoard, FourBoard); depth=3; if(!he_moved[4]) bestvcom4=0; } else { bestvcom4=0; } if(bestvcom3 < vcom3 + bestvcom4) bestvcom3=vcom3 + bestvcom4; } else if((depth == 4) & (!skipDtGM)) { vcom4=-valuoo(ThreeBoard.sq_[d[4]][c[4]].piece_, ThreeBoard, FourBoard); if(bestvcom4 > vcom4) bestvcom4=vcom4; } if(depth < 4) unalterMaybeBoard(g, chsq, cb10_10.sq_[d[depth]][c[depth]], cb10_10, cb10_10_1); return cb10_10.sq_[d[depth]][c[depth]].side_ == 0; } /* public void MaybeCastleKingside(Graphics g, int i) { } public void MaybeCastleQueenside(Graphics g, int i) { } */ public void AssignVariantName(){ variant_name="Pin Chess"; } public void NextOrdinaryPlayer(Graphics g) { IsTheGameOver(); if(GameOver) return; if (WhoIsHuman[whoseMove]==true){SayWhoIsHuman(g);} WhoIsPinned(); whoseMove=3 - whoseMove; if (whoseMove==1){turncounter++;} UnTwoThePawns(whoseMove); whatpiecescanmove(g); TotalMaybeBoard(NowBoard, MaybeBoard); TotalMaybeBoard(MaybeBoard, TwoBoard); TotalMaybeBoard(TwoBoard, ThreeBoard); TotalMaybeBoard(ThreeBoard, FourBoard); GenerateAttackersArrays(); CountAllThePieces(); DrawNowBoard(g); } public void NullifySomethingElse() { pinned=null; } public void PawnStuff(Graphics g) { if(NowBoard.sq_[mover_rank][mover_file].piece_ == 2) NowBoard.sq_[mover_rank][mover_file].piece_=1; I_just_took_en_passant=false; if((mover_rank - moveto_rank) * (mover_rank - moveto_rank) != 1) return; if((mover_file - moveto_file) * (mover_file - moveto_file) != 1) return; if(((NowBoard.sq_[mover_rank][mover_file].piece_ == 1) | (NowBoard.sq_[mover_rank][mover_file].piece_ == 51) | (NowBoard.sq_[mover_rank][mover_file].piece_ == 83) | (NowBoard.sq_[mover_rank][mover_file].piece_ == 85) | (NowBoard.sq_[mover_rank][mover_file].piece_ == 85) | (NowBoard.sq_[mover_rank][mover_file].piece_ == 8101) | (NowBoard.sq_[mover_rank][mover_file].piece_ == 8102)) && (NowBoard.sq_[mover_rank][moveto_file].piece_ == 2)) { NowBoard.sq_[mover_rank][moveto_file].piece_=0; NowBoard.sq_[mover_rank][moveto_file].side_=0; ShowStatusQ("En Passant");CapturedAPawn[whoseMove]=true; I_just_took_en_passant=true; NowBoard.sq_[mover_rank][moveto_file].drawchsqBATAK(g, 1, false, false,false); MaybeBoard.sq_[mover_rank][moveto_file].side_=0; MaybeBoard.sq_[mover_rank][moveto_file].piece_=0; } } public void SupplementalAddAnAttacker() { if(patt == -2) { catt=xatt + 2; datt=yatt + 2; AddAnAttacker(); catt=xatt + 2; datt=yatt; AddAnAttacker(); catt=xatt + 2; datt=yatt - 2; AddAnAttacker(); catt=xatt; datt=yatt - 2; AddAnAttacker(); catt=xatt - 2; datt=yatt - 2; AddAnAttacker(); catt=xatt - 2; datt=yatt; AddAnAttacker(); catt=xatt - 2; datt=yatt + 2; AddAnAttacker(); catt=xatt; datt=yatt + 2; AddAnAttacker(); catt=xatt + 1; datt=yatt + 2; AddAnAttacker(); catt=xatt + 1; datt=yatt - 2; AddAnAttacker(); catt=xatt - 1; datt=yatt + 2; AddAnAttacker(); catt=xatt - 1; datt=yatt - 2; AddAnAttacker(); catt=xatt + 2; datt=yatt + 1; AddAnAttacker(); catt=xatt + 2; datt=yatt - 1; AddAnAttacker(); catt=xatt - 2; datt=yatt + 1; AddAnAttacker(); catt=xatt - 2; datt=yatt - 1; AddAnAttacker(); } } public void SupplementalStartup() { WhoIsPinned(); } public void WhoIsMaybePinned() { for(ff_batak=1; ff_batak < 9; ff_batak++) for(ee_batak=1; ee_batak < 9; ee_batak++) { maybe_pinned[ff_batak][ee_batak]=false; if(NowBoard.sq_[ff_batak][ee_batak].piece_ < 0) { KingRank[NowBoard.sq_[ff_batak][ee_batak].side_]=ff_batak; KingFile[NowBoard.sq_[ff_batak][ee_batak].side_]=ee_batak; } } seek_maybe_pinned(1, 0, 1); seek_maybe_pinned(1, 1, 1); seek_maybe_pinned(1, 1, 0); seek_maybe_pinned(1, 1, -1); seek_maybe_pinned(1, 0, -1); seek_maybe_pinned(1, -1, -1); seek_maybe_pinned(1, -1, 0); seek_maybe_pinned(1, -1, 1); seek_maybe_pinned(2, 0, 1); seek_maybe_pinned(2, 1, 1); seek_maybe_pinned(2, 1, 0); seek_maybe_pinned(2, 1, -1); seek_maybe_pinned(2, 0, -1); seek_maybe_pinned(2, -1, -1); seek_maybe_pinned(2, -1, 0); seek_maybe_pinned(2, -1, 1); } public void WhoIsPinned() { for(ff_batak=1; ff_batak < 9; ff_batak++) for(ee_batak=1; ee_batak < 9; ee_batak++) { pinned[ff_batak][ee_batak]=false; if(NowBoard.sq_[ff_batak][ee_batak].piece_ < 0) { KingRank[NowBoard.sq_[ff_batak][ee_batak].side_]=ff_batak; KingFile[NowBoard.sq_[ff_batak][ee_batak].side_]=ee_batak; } } seek_pinned(1, 0, 1); seek_pinned(1, 1, 1); seek_pinned(1, 1, 0); seek_pinned(1, 1, -1); seek_pinned(1, 0, -1); seek_pinned(1, -1, -1); seek_pinned(1, -1, 0); seek_pinned(1, -1, 1); seek_pinned(2, 0, 1); seek_pinned(2, 1, 1); seek_pinned(2, 1, 0); seek_pinned(2, 1, -1); seek_pinned(2, 0, -1); seek_pinned(2, -1, -1); seek_pinned(2, -1, 0); seek_pinned(2, -1, 1); } /* public boolean markAPiece(Graphics g, int i, int j) { if(NowBoard.sq_[i][j].side_ != whoseMove) return false; moveCounter=0; c[depth]=j; d[depth]=i; AlsoMark(g); mover_rank=i; mover_file=j; moveCounter=0; findPieceMoves(g, NowBoard.sq_[mover_rank][mover_file], NowBoard, MaybeBoard); if(moveCounter == 0) { stringy=NowBoard.sq_[mover_rank][mover_file].moniker();ShowStatusQ("That "+stringy+" cannot move."); NowBoard.sq_[i][j].drawchsqBATAK(g, 1, icanmove[i][j], pinned[i][j],false); return false; } NowBoard.sq_[i][j].drawchsqBATAK(g, 2, false, pinned[i][j],false); for(x=1; x <= moveCounter; x++) MaybeMoves[x].endingsquare_.markexchsquncheckered(g,8); markingAPiece=false; return true; } */ public boolean mouseDown(Event event, int i, int j) { if(NowBoard == null) return true; Graphics g=getGraphics(); if(j < 30) if((humanizing) | (PromotingAPawn)) { return true; } else { DisplayRules(g); return true; } if(!PromotingAPawn) SayWhoIsHuman(g); if(PromotingAPawn) DrawPromotionOptions(g); TotalMaybeBoard(NowBoard, MaybeBoard); TotalMaybeBoard(MaybeBoard, TwoBoard); TotalMaybeBoard(TwoBoard, ThreeBoard); TotalMaybeBoard(ThreeBoard, FourBoard); ShowStatusNothing(); if(GameOver) { GameOver=false; StartUp(g); repaint(); return true; } a=i / 30; b=9 - j / 30; if(!PromotingAPawn) if((i >= 56) & (j >= 276) & (i <= 104) & (j <= 294)) { humanizing=true; WhoIsHuman[1]=true; SayWhoIsHuman(g); } else if((i >= 117) & (j >= 276) & (i <= 178) & (j <= 294)) { humanizing=true; WhoIsHuman[1]=false; SayWhoIsHuman(g); } else if((i >= 56) & (j >= 296) & (i <= 104) & (j <= 314)) { humanizing=true; WhoIsHuman[2]=true; SayWhoIsHuman(g); } else if((i >= 117) & (j >= 296) & (i <= 178) & (j <= 314)) { humanizing=true; WhoIsHuman[2]=false; SayWhoIsHuman(g); } else if((i >= 26) & (j > 316) & (i <= 93) & (j <= 334)) { if(who_is_winning == 0) return true; humanizing=true; accepted_terms=true; SayWhoIsHuman(g); } else if((i >= 147) & (j >= 316) & (i < 242) & (j < 334)) { if(who_is_winning == 0) return true; humanizing=true; accepted_terms=false; SayWhoIsHuman(g); } else if((i >= 210) & (j >= 285) & (i < 270) & (j < 320)) { humanizing=false; SayWhoIsHuman(g); if(accepted_terms) { if(who_is_winning != 0) GameOver=true; if(who_is_winning == 1) wins[1]++; if(who_is_winning == 2) wins[2]++; if(who_is_winning == 3) drawn_games++; if(who_is_winning != 0) { StartUp(g); repaint(); markingAPiece=true; return true; } } } if(humanizing) return true; if((a < 1) | (a > 8) | (b < 1) | (b > 8) && !PromotingAPawn) return true; if(PromotingAPawn) { if(!PromotionClicks(i, j)) return true; NowBoard.sq_[queening_rank][queening_file].piece_=xxx; MaybeBoard.sq_[queening_rank][queening_file].piece_=xxx; NowBoard.sq_[queening_rank][queening_file].drawchsqBATAK(g, 1, false, pinned[queening_rank][queening_file],false); TotalMaybeBoard(NowBoard,MaybeBoard);DidICheckOrStalemate(g, whoseMove); PromotingAPawn=false; if (WhoIsHuman[whoseMove]==true){SayWhoIsHuman(g);} NextOrdinaryPlayer(g); if(WhoIsHuman[whoseMove]) { markingAPiece=true; return true; } } if(WhoIsHuman[whoseMove]) if(markingAPiece) markAPiece(g, b, a); else if(HumanMoveAPiece(g, b, a)) { if(GameOver) return true; if(PromotingAPawn) return true; NextOrdinaryPlayer(g); } while((!WhoIsHuman[whoseMove]) & (!GameOver) & (!PromotingAPawn)) { MachineMoves(g, whoseMove); if(GameOver) return true; NextOrdinaryPlayer(g); if(WhoIsHuman[whoseMove]) markingAPiece=true; } return true; } public void seek_maybe_pinned(int i, int j, int k) { friend_x=0; friend_y=0; cc=KingFile[i] + k; for(dd=KingRank[i] + j; (cc < 9) & (dd < 9) & (cc > 0) & (dd > 0); dd += j) { if(MaybeBoard.sq_[dd][cc].side_ == i) { if(friend_x != 0) return; friend_x=cc; friend_y=dd; } if(MaybeBoard.sq_[dd][cc].side_ == 3 - i) { if(friend_x == 0) return; if(MaybeBoard.sq_[dd][cc].piece_ < 4) return; switch(MaybeBoard.sq_[dd][cc].piece_) { default: break; case 4: // '\004' if(j * k == 0) return; break; case 5: // '\005' if(j * k != 0) return; break; case 6: // '\006' if(j * k != 0) return; break; } maybe_pinned[friend_y][friend_x]=true; return; } cc += k; } } public void seek_pinned(int i, int j, int k) { friend_x=0; friend_y=0; cc=KingFile[i] + k; for(dd=KingRank[i] + j; (cc < 9) & (dd < 9) & (cc > 0) & (dd > 0); dd += j) { if(NowBoard.sq_[dd][cc].side_ == i) { if(friend_x != 0) return; friend_x=cc; friend_y=dd; } if(NowBoard.sq_[dd][cc].side_ == 3 - i) { if(friend_x == 0) return; if(NowBoard.sq_[dd][cc].piece_ < 4) return; switch(NowBoard.sq_[dd][cc].piece_) { default: break; case 4: // '\004' if(j * k == 0) return; break; case 5: // '\005' if(j * k != 0) return; break; case 6: // '\006' if(j * k != 0) return; break; } pinned[friend_y][friend_x]=true; return; } cc += k; } } public boolean ExtenuatingCircumstances(Chsq chsq){return false;} boolean pinned[][]; boolean maybe_pinned[][]; static int friend_x; static int friend_y; static int ee_batak; static int ff_batak; }