File size: 595 Bytes
079c32c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import Board from './board';
import { minmax, cache_hits } from './minmax';
import { FOUR } from './eval';
import { min } from 'lodash';

describe('minmax', () => {
  test('悔棋', () => {
    const board = new Board(15);
    board.put(7, 8);
    console.log(board.display());
    const res = minmax(board, -1, 4);
    board.put(res[1][0], res[1][1]);
    console.log(board.display());
    board.undo();
    console.log(board.display());
    board.undo();
    console.log(board.display());
    board.put(7, 7);
    console.log(board.display());
    console.log(minmax(board, -1, 4));
  });
});