|
import { expect } from 'chai' |
|
|
|
import board from '@/ai/board.js' |
|
|
|
describe('测试evaluate速度', () => { |
|
it('速度', () => { |
|
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 start = + new Date() |
|
let i=0 |
|
while(i++<100000) { |
|
board.put([6, 10], 1) |
|
board.remove([6, 10]) |
|
} |
|
console.log(new Date - start) |
|
}) |
|
|
|
}) |
|
|