Eco TicTacToe
From Design to iPhone App — Build a SwiftUI Game with a Computer Player That Never Loses
発行者による作品情報
Build a real iPhone game from an empty Xcode project to a finished app, and understand every line of code along the way.
Eco TicTacToe walks you step by step through a complete Tic Tac Toe game written in SwiftUI: a clean game board, a score bar, three difficulty levels, and a computer player that never loses. Like building with Lego, each chapter adds one small piece, and the pieces snap together into a professional app.
What you will learn:
• SwiftUI basics explained simply: views, stacks, grids, modifiers, @State and @Observable
• How to keep game rules separate from the screen, so your code is easy to read and test
• Easy and Medium computer players built from a few simple rules
• The MiniMax algorithm, the same idea behind chess programs, explained with a real game tree
• Swift Testing, including a test that plays every possible game to prove the computer never loses
• What Apple looks for when you publish to the App Store
This second edition was completely rewritten. The author rebuilt the app from scratch and shares, in "Lesson from Version 1" boxes, each mistake from the first version and how it was fixed. Every line of code was built and tested in Xcode, and the complete source code is included.
No experience with Swift is needed. If you can follow a recipe, you can follow this book.
Part of the Effortless Coding Series by James Chang.