Skip to content

Commit

Permalink
adding readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jaiminmoslake7020 committed Nov 22, 2024
1 parent 76b7bd4 commit 0736e32
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions js/components/TurnHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export const whenOneInSequence = (
foundAnotherMove = seq[0];
}
}
console.log('currentValues', currentValues, seq, anotherCurrentValues, foundAnotherMove);
return foundAnotherMove;
}

Expand Down Expand Up @@ -105,7 +106,7 @@ export const TurnHandler = () => {
}
const remainingMoves = allData.filter(v => !totalValues.includes(v));
// console.log('remainingMoves', remainingMoves, allData, totalValues);
console.log('foundAnotherMove V1 Random ');
// console.log('foundAnotherMove V1 Random ');
return remainingMoves[ Math.floor(Math.random() * ( remainingMoves.length - 1 )) ];
}

Expand Down Expand Up @@ -152,14 +153,14 @@ export const TurnHandler = () => {
while (startAt < winnerData.length) {
const seq = winnerData[startAt];
foundAnotherMove = whenOneInSequence(currentValues, seq, anotherCurrentValues);
if (!foundAnotherMove) {
if (foundAnotherMove !== null) {
break;
}
startAt++;
}
}

console.log('foundAnotherMove with V2 ', foundAnotherMove , foundWinner);
// console.log('foundAnotherMove with V2 ', foundAnotherMove , foundWinner);
if (foundWinner) {
winner = foundWinner;
} else if (foundAnotherMove === null) {
Expand Down Expand Up @@ -217,7 +218,7 @@ export const TurnHandler = () => {
}
}

console.log('foundAnotherMove with V3 ', foundAnotherMove , foundWinner);
// console.log('foundAnotherMove with V3 ', foundAnotherMove , foundWinner);
if (foundWinner) {
winner = foundWinner;
} else if (foundAnotherMove === null) {
Expand Down

0 comments on commit 0736e32

Please sign in to comment.