import java.io.*;import java.util.Vector;public class Table implements Utils { public Hashentry[] hashtable; public long[] repZobrist; public int HASHSIZE; // Ordinary transposition table public Table(int HASHSIZE) { this.HASHSIZE = HASHSIZE; hashtable = new Hashentry[HASHSIZE]; } public Hashentry getEntry(long zobrist) { int hashkey = (int)(zobrist%HASHSIZE); if(hashtable[hashkey] != null && hashtable[hashkey].zobrist == zobrist) return hashtable[hashkey]; return null; } public void record(long zobrist, int depth, int flag, int eval, int move) { // Depth replacement scheme int hashkey = (int)(zobrist%HASHSIZE); } public class Hashentry { public long zobrist; public int depth; public int flag; public int eval; public int move; public Hashentry(long zobrist, int depth, int flag, int eval, int move) { this.zobrist = zobrist; this.depth = depth; this.flag = flag; this.eval = eval; this.move = move; } }}
This is a new class created which will handle the transposition tables which I want to use to speed up the search.
My game of Tic Tac Toe is been programed using negamax along with alpha beta pruning,with history heuristics.
I know that transposition tables are not required for small game like tic tac toe, but as I am just learning to implement such algorithms,I think its best to start with a simple program, even if there is no need for transposition tables, I could still learn the way in which transposition tables can be implemented.
kindly help as I am unable to proceed further with recordmove();