Skip to content

Commit

Permalink
fix: #26 再修正
Browse files Browse the repository at this point in the history
  • Loading branch information
Suke-H committed Apr 21, 2024
1 parent 18106d5 commit cd9476e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/load/saveAndLoad.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ export const loadGameData = (todaysNo: number, correctAnswer: string, loadDataSe
// ラウンド数をセット
// answerListの中で空文字列がある場合はその行番号をセット
const index = answerList.findIndex((row) => row.includes(""));
// 空文字列がない(indexが-1)場合は5をセット
const round = index !== -1 ? index : 5;
// 空文字列がない(indexが-1)場合は6をセット
const round = index !== -1 ? index : 6;

loadDataSetters.setRound(round+1);

Expand All @@ -39,14 +39,14 @@ export const loadGameData = (todaysNo: number, correctAnswer: string, loadDataSe
}

// ゲームの状態をセット
loadDataSetters.setGameState(checkClear(correctAnswer, answerList, round+1));
loadDataSetters.setGameState(checkClear(correctAnswer, answerList, round));

// マッチリストをセット
const matchList = calcMatchList(answerList, correctAnswer, round+1)
const matchList = calcMatchList(answerList, correctAnswer, round)
loadDataSetters.setMatchList(matchList);

// 使用したアルファベットをセット
loadDataSetters.setAlphabetMatch(calcAlphabetMatch(answerList, matchList, round+1));
loadDataSetters.setAlphabetMatch(calcAlphabetMatch(answerList, matchList, round));
}

const resetGameData = () => {
Expand Down

0 comments on commit cd9476e

Please sign in to comment.