Factor Blitz is a SwiftUI iOS app for practicing multiplication factors. It turns each product into a quick multiple-choice round where players identify the factor pair or pairs that create that product.
The app is built for short practice sessions, progressive learning, and local score tracking. It runs fully on-device and stores profile, leaderboard, language, and learning progress data in UserDefaults.
- Progressive learning path from easier tables through full-table review.
- Practice modes for the full multiplication table, diagonal squares, and a selected times table from 1 through 10.
- Product-based questions that can require multiple correct factor pairs, such as
16 = 2 x 8and16 = 4 x 4. - Per-player local leaderboards, ranked by accuracy, elapsed time, wrong answers, and completion date.
- Star-based learning progress; three-star completion unlocks the next learning level.
- Result review with accuracy, time, wrong-answer count, and product-level performance.
- Localized UI with system language support plus English, Russian, Uzbek Latin, and Ukrainian.
- Haptic feedback for correct and wrong answers.
- Xcode with Swift 6 support.
- iOS 17.0 or later simulator/device target.
FactorBlitz/FactorBlitzApp.swift: app entry point.FactorBlitz/Views: SwiftUI screens and reusable view styles.FactorBlitz/ViewModels: game round state, timer, answer feedback, and result creation.FactorBlitz/Models: modes, learning levels, multiplication pairs, session/result models, localization helpers, and player data.FactorBlitz/Game: question generation, persistence stores, haptics, and time formatting.FactorBlitz/Localizable.xcstrings: localized strings.FactorBlitzTests: XCTest coverage for game rules, persistence, localization, and formatting.
Open FactorBlitz.xcodeproj in Xcode and run the FactorBlitz scheme, or build from the command line:
xcodebuild -project FactorBlitz.xcodeproj \
-scheme FactorBlitz \
-destination 'generic/platform=iOS Simulator' \
-derivedDataPath .build/DerivedData \
buildRun tests from Xcode with the FactorBlitz scheme, or use xcodebuild with an installed simulator:
xcodebuild test -project FactorBlitz.xcodeproj \
-scheme FactorBlitz \
-destination 'platform=iOS Simulator,name=iPhone 15' \
-derivedDataPath .build/DerivedDataIf the named simulator is not installed, replace iPhone 15 with a simulator listed by your local Xcode installation.
QuestionGeneratorcreates unique unordered multiplication pairs for the selected mode and groups questions by product.GameSessiontracks round progress, correct selections, wrong answers, per-product timing, and final scoring.LeaderboardStoreandLearningProgressStoreuse injectedUserDefaults, which keeps persistence logic testable.- Learning level IDs and
GameMode.idvalues are persisted keys; keep them stable.