Example #1
0
        public Damka()
        {
            InitializeComponent();
            this.board = new Board(this);
            this.Controls.Add(board);
            this.Size        = new Size((int)(this.board.Width * 1.02), (int)(this.board.Height * 1.07875));
            this.MaximumSize = this.Size;
            this.MinimumSize = this.Size;
            this.MaximizeBox = false;
            this.medium36SecondsToolStripMenuItem.Checked = true;
            this.depth = 6;
            //file
            string directoryPath          = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + "\\Damka";
            string transpositionTablePath = directoryPath + "\\TTable";
            string boardsDirectoryPath    = directoryPath + "\\Boards";

            if (!Directory.Exists(directoryPath))
            {
                DirectoryInfo directory = Directory.CreateDirectory(directoryPath);
                directory.Attributes = FileAttributes.Directory | FileAttributes.Hidden;
            }
            if (!Directory.Exists(boardsDirectoryPath))
            {
                Directory.CreateDirectory(boardsDirectoryPath);
            }
            if (!File.Exists(transpositionTablePath))
            {
                this.tTable = new TranspositionTable();
                var file = File.Create(transpositionTablePath);
                file.Close();
            }
            else
            {
                this.tTable = new TranspositionTable(transpositionTablePath);
            }
            this.transpositionTablePath = transpositionTablePath;
            this.boardsDirectoryPath    = boardsDirectoryPath;
            this.directoryPath          = directoryPath;

            this.search = new Search(tTable);
            //this.board.AppendFromDamkaBoard(search.GetBestMove(8, false, board.GetDamkaBoard()));
            SetEvaluation();
        }
Example #2
0
 public Search(TranspositionTable tTable)
 {
     this.tTable = tTable;
 }