Skip to main content

Wrap up

Less than 1 minuteSwiftiOSArticle(s)bloghackingwithswift.comcrashcourseswiftxcodeappstoreios

Wrap up 관련

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

Wrap up | Hacking with iOS

Wrap up

I realize technique projects can be a little dry, but I hope you can see some real advantages to using GameplayKit randomization over other solutions. Not only does it offer a wider range of functionality (shuffled and Gaussian distributions are awesome!) but it makes your code much simpler, and also has the guarantee of being provably random.

Of course, if you're stuck supporting prior versions of iOS, you'll need to mix and match GameplayKit randomization with calls to arc4random_uniform() and the like.

It bears repeating that this is only a small slice of what GameplayKit offers. If you haven't already read tutorial 34, you should check it out now - it's a tutorial for GKMinmaxStrategist` from `GameplayKit` that shows you how to create an AI for Four in a Row.


이찬희 (MarkiiimarK)
Never Stop Learning.