|
import { expect } from 'chai' |
|
|
|
import board from '@/ai/board.js' |
|
import Search from '@/ai/negamax.js' |
|
import SCORE from '@/ai/score.js' |
|
|
|
import math from '@/ai/math.js' |
|
|
|
import config from '@/ai/config.js' |
|
|
|
describe('测试的时候碰到的Bug', () => { |
|
it('冲四双三不能赢,因为对手可以冲四防双三,bug', () => { |
|
const b = [ |
|
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], |
|
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], |
|
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], |
|
[0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], |
|
[0, 0, 0, 0, 0, 1, 0, 2, 1, 0, 0, 0, 0, 0, 0], |
|
[0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0], |
|
[0, 0, 0, 0, 0, 0, 2, 1, 2, 1, 0, 0, 0, 0, 0], |
|
[0, 0, 0, 0, 0, 2, 2, 1, 1, 1, 1, 2, 0, 0, 0], |
|
[0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 1, 0, 0, 0], |
|
[0, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 2, 0, 0], |
|
[0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0], |
|
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], |
|
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], |
|
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], |
|
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], |
|
] |
|
board.init(b) |
|
|
|
const p = Search() |
|
expect(p.score < SCORE.FIVE/2).to.be.true |
|
}) |
|
|
|
}) |
|
|