|
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' |
|
|
|
describe('Edge 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, 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, 1], |
|
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2], |
|
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2], |
|
[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, 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], |
|
] |
|
board.init(b); |
|
|
|
const points = board.gen() |
|
|
|
console.log(points) |
|
|
|
expect(math.containPoint(points, [11, 14])).to.be.true |
|
}) |
|
}) |
|
|