Win game logic done

This commit is contained in:
2021-12-27 16:28:27 -03:00
parent 0102f9b106
commit bc65015c21
6 changed files with 148 additions and 14 deletions

View File

@@ -0,0 +1,13 @@
export default function checkVictory(combinations, boxes) {
combinations.forEach(combination => {
const boxesSorted = boxes.sort()
if (boxesSorted[0] === combination[0], boxesSorted[1] === combination[1], boxesSorted[2] === combination[2]) {
alert('Win')
}
});
}