August 15, 2015

Fizz Buzz with GameplayKit

A great idea found at knowing.net and backported to swift.

Fizz buzz is a simple game and GameplayKit API making it equally simple to describe the rules. Untyped state dictionary can definitely use some “swiftification”, but overall, code is quite simple. Here it is:

Output is

1
2
fizz 
4
buzz
...

I’m looking forward to seeing gaming and not only frameworks emerging on top of GameplayKit! Foundation is very promising.