The problem is that at higher depths, the program plays many of its own moves(same color),without giving a chance to opponent what problem might be there? At lower depths(4 plys) it plays properly. Trouble starts from depth 8 onwards.
My table size is 18 bits i.e 2^18=262144
hI=zob_key%(tablesize-1)
Here is the code where the transposition tables are coded:
makeMove(posn, r, c, white);//make a move if (hKey[hI] == zob_key) { hit++;//Count number of hits in table. System.out.println("HIT "+hit+" " + " " + zob_key); if (hDepth[hI] >= ply) { System.out.println("hply " + " " + hDepth[hI]+" ply "+ply); if (hType[hI] == 0) { System.out.println("hVal " + " " + hVal[hI]); return hVal[hI]; }//hashfEXACT if ((hType[hI] == 1) && (hVal[hI] <= alpha)) { System.out.println("htype_alpha " + " " + hType[hI]); return alpha; }//hashfALPHA if ((hType[hI] == 2) && (hVal[hI] >= beta)) { System.out.println("htype_beta " + " " + hType[hI]); return beta; }//hashfBETA } } eval = -alphaBeta(posn, !white, ply + 1, -beta, -alpha); undoMove(posn, r, c, white);// undo move if (eval >= beta) { if (ply == 1) { bestMove = new Move(r, c); } //Record at Beta cutoff. hKey[hI] = zob_key; hType[hI] = 2; hDepth[hI] = ply; hVal[hI] = beta; return beta; } if (eval > alpha) { if (ply == 1) { bestMove = new Move(r, c); } alpha = eval; hashType = 0; } } hKey[hI] = zob_key; hType[hI] = 0; hDepth[hI] = ply; hVal[hI] = alpha; return alpha;