Last active
December 23, 2015 18:49
-
-
Save genghisjahn/6678838 to your computer and use it in GitHub Desktop.
Golang source code for my FizzBuzzGo blog post.
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
sfb "fizzbuzzgo/fizzbuzzlib" | |
) | |
func main() { | |
fbp := sfb.FizzBuzzProcessor{GetItems()} | |
for i := 1; i <= 100; i++ { | |
result:=fbp.GetResult(i) | |
fmt.Printf("\n%v",result) | |
} | |
} | |
func GetItems() sfb.Items{ | |
fbpno:=sfb.FizzBuzzNumberOnly{} | |
var _ = fbpno | |
fbps:=sfb.FizzBuzzPerfectSquare{} | |
fbpalin:=sfb.FizzBuzzPalindrome{} | |
fb42:=sfb.FizzBuzzIs42{} | |
fbdiv15:=sfb.FizzBuzzDivisor{15,"FizzBuzz"} | |
fbdiv5:=sfb.FizzBuzzDivisor{5,"Buzz"} | |
fbdiv3:=sfb.FizzBuzzDivisor{3,"Fizz"} | |
return sfb.Items{fbps,fb42,fbpalin,fbdiv15,fbdiv5,fbdiv3,} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment