diff --git a/PrimePickApp/MainView.swift b/PrimePickApp/MainView.swift index 4bdca00..232f270 100644 --- a/PrimePickApp/MainView.swift +++ b/PrimePickApp/MainView.swift @@ -23,9 +23,7 @@ struct MainView: View { .font(.headline) .padding() - Button(action: { - // Hardボタンのアクション - }) { + NavigationLink(destination: QuizView(difficulty: "Hard")) { Text("Hard") .padding() .frame(maxWidth: .infinity) @@ -36,9 +34,7 @@ struct MainView: View { .padding(.horizontal, 50) .padding(.bottom, 10) - Button(action: { - // Normalボタンのアクション - }) { + NavigationLink(destination: QuizView(difficulty: "Normal")) { Text("Normal") .padding() .frame(maxWidth: .infinity) @@ -49,7 +45,7 @@ struct MainView: View { .padding(.horizontal, 50) .padding(.bottom, 10) - NavigationLink(destination: QuizView()) { + NavigationLink(destination: QuizView(difficulty: "Easy")) { Text("Easy") .padding() .frame(maxWidth: .infinity) diff --git a/PrimePickApp/QuizData/PrimeData.swift b/PrimePickApp/QuizData/PrimeData.swift index a6cde75..7440282 100644 --- a/PrimePickApp/QuizData/PrimeData.swift +++ b/PrimePickApp/QuizData/PrimeData.swift @@ -22,4 +22,56 @@ final class PrimeData { } return twoDigitPrimes } + + public func generateThreeDigitPrimes() -> [Int] { + var twoDigitPrimes = [Int]() + outerLoop: for num in 100..<1000 { + for i in 2.. [Int] { + var twoDigitPrimes = [Int]() + outerLoop: for num in 1000..<10000 { + for i in 2.. [Int] { + var twoDigitPrimes = [Int]() + outerLoop: for num in 100..<10000 { + for i in 2.. [Int] { + var twoDigitPrimes = [Int]() + outerLoop: for num in 10000..<1000000 { + for i in 2..