Skip to main content

Project 34: Four in a Row

About 2 minSwiftiOSArticle(s)bloghackingwithswift.comcrashcourseswiftxcodeappstoreios

Project 34: Four in a Row 관련

Hacking with iOS – learn to code iPhone and iPad apps with free Swift tutorials

Learn Swift coding for iOS with these free tutorials – learn Swift, iOS, and Xcode

Project 34: Four in a Row

Let iOS take over the AI in your games using GameplayKit.

Description

Let iOS take over the AI in your games using GameplayKit AI.

Setting up | Hacking with iOS

Setting up
Creating the interface with UIStackView | Hacking with iOS

Creating the interface with UIStackView
Preparing for basic play | Hacking with iOS

Preparing for basic play
Adding in players: GKGameModelPlayer | Hacking with iOS

Adding in players: GKGameModelPlayer
Detecting wins and draws in Four in a Row | Hacking with iOS

Detecting wins and draws in Four in a Row
How GameplayKit AI works: GKGameModel, GKGameModelPlayer and GKGameModelUpdate | Hacking with iOS

How GameplayKit AI works: GKGameModel, GKGameModelPlayer and GKGameModelUpdate
Implementing GKGameModel: gameModelUpdates(for:) and apply() | Hacking with iOS

Implementing GKGameModel: gameModelUpdates(for:) and apply()
Creating a GameplayKit AI using GKMinmaxStrategist | Hacking with iOS

Creating a GameplayKit AI using GKMinmaxStrategist
Wrap up | Hacking with iOS

Wrap up

Need help?

I put together answers for over 600 of the most frequently asked questions I received from readers into one place: the Swift 5 Knowledge Base. It answers basic and advanced questions, and provides lots of free code you can re-use however you please. If you hit problems, try searching there first.

If you're still having problems, you can post to the Hacking with Swift subredditopen in new window where you can expect an answer fairly quickly, or you can find me on Twitteropen in new window where I'll do my best to help.


Project files

The project files for Hacking with Swift are all available on GitHub, where you can view them, fork them, or download them:

twostraws/HackingWithSwift
The project source code for Hacking with iOS.

이찬희 (MarkiiimarK)
Never Stop Learning.