mirror of
https://github.com/FranP-code/Tic-Tac-Toe-Game.git
synced 2025-10-12 23:52:39 +00:00
Victory actions done
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import accessToCombinations from "./accessToCombinations.js"
|
||||
import checkVictory from "./checkVictory.js"
|
||||
import victoryActions from "./victoryActions.js"
|
||||
|
||||
export default function gameLogic(checkInputsResult) {
|
||||
|
||||
@@ -38,7 +39,14 @@ export default function gameLogic(checkInputsResult) {
|
||||
|
||||
actualPlayer.markedBoxes.push(box.id)
|
||||
|
||||
checkVictory(combinations, actualPlayer.markedBoxes)
|
||||
const checkVictoryResult = checkVictory(combinations, actualPlayer.markedBoxes)
|
||||
console.log(checkVictoryResult)
|
||||
|
||||
if (checkVictoryResult[0] === 'WIN') {
|
||||
|
||||
victoryActions(checkVictoryResult[1], actualPlayer.name)
|
||||
|
||||
}
|
||||
|
||||
if (players.indexOf(actualPlayer) === 0) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user