From 63b6effb1d6f692c6edeb617403d2ce8edcdd436 Mon Sep 17 00:00:00 2001 From: Sash Zats Date: Sat, 15 Aug 2015 23:22:29 -0700 Subject: [PATCH] fizz buzz --- _posts/2015-08-15-fizz-buzz.md | 38 ++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 _posts/2015-08-15-fizz-buzz.md diff --git a/_posts/2015-08-15-fizz-buzz.md b/_posts/2015-08-15-fizz-buzz.md new file mode 100644 index 0000000..0cf652b --- /dev/null +++ b/_posts/2015-08-15-fizz-buzz.md @@ -0,0 +1,38 @@ +--- +layout: post +title: Fizz Buzz with GameplayKit +categories: [] +tags: [] +published: True + +--- + +A great idea found at http://www.knowing.net/index.php/2015/08/04/fizzbuzz-with-ios-9-gameplaykit-expert-system-in-c-with-xam-ios and backported to swift. + +[Fizz buzz](https://en.wikipedia.org/wiki/Fizz_buzz) is a simple game. GameplayKit makes it very easy to describe the rules. There is a vast place for improvement when working with state untyped dictionary. It can definitely use some swiftification. Here is the code: + +{% gist zats/0ad1dac35e75587da7e0 fizzbuzz.swift %} + +Output is + +``` +1 +2 +fizz +4 +buzz +fizz +7 +8 +fizz +buzz +11 +fizz +13 +14 +fizz buzz +16 +... +``` + +I'm looking forward to seeing frameworks emerging on top of GameplayKit. \ No newline at end of file