|
|
@ -114,6 +114,11 @@ function check(dryrun) {
|
|
|
|
|
|
|
|
|
|
|
|
complete.cells.forEach(({ el }) => el.classList.add('ttt-blink'))
|
|
|
|
complete.cells.forEach(({ el }) => el.classList.add('ttt-blink'))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (complete.player === 'o') {
|
|
|
|
|
|
|
|
ahead.classList.add('ttt-player-icon--hidden')
|
|
|
|
|
|
|
|
behind.classList.remove('ttt-player-icon--hidden')
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
setTimeout(() => {
|
|
|
|
reset()
|
|
|
|
reset()
|
|
|
|
}, 1200)
|
|
|
|
}, 1200)
|
|
|
@ -131,8 +136,8 @@ function play(cells) {
|
|
|
|
setTimeout(() => {
|
|
|
|
setTimeout(() => {
|
|
|
|
let found = false
|
|
|
|
let found = false
|
|
|
|
|
|
|
|
|
|
|
|
search: for (const cell of cells) {
|
|
|
|
search: for (const player of players) {
|
|
|
|
for (const player of players) {
|
|
|
|
for (const cell of cells) {
|
|
|
|
cell.value = player
|
|
|
|
cell.value = player
|
|
|
|
|
|
|
|
|
|
|
|
const { winner, empty } = check(true)
|
|
|
|
const { winner, empty } = check(true)
|
|
|
|