Last active
August 29, 2015 14:10
-
-
Save skriptble/27f8419f1ac4d66143ea to your computer and use it in GitHub Desktop.
FizzyBuzzyNumbers!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func FizzyBuzzyNumbers() transducers.ValueStream { | |
fizzyBuzzyCurr := 0 | |
return func() (value interface{}, done bool) { | |
if fizzyBuzzyCurr < 100 { | |
fizzyBuzzyCurr++ | |
return fizzyBuzzyCurr, false | |
} | |
return nil, true | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func FizzyBuzzyEduction() transducers.ValueStream { | |
return transducers.Eduction(transducers.Range(99), transducers.Map(transducers.Inc)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment