3 ms·
package main import ( "fmt" "math/rand" ) var fb [4]string = [4]string{"", "fizz", "buzz", "fizzbuzz"} var lucky int64 = 176064004 func main(
by LanceH 11mo ago
package main
import (
"fmt"
"math/rand"
)
var fb [4]string = [4]string{"", "fizz", "buzz", "fizzbuzz"}
var lucky int64 = 176064004
func main() {
for i := 1; i <= 100; i++ {
if i%15 == 1 {
rand.Seed(lucky)
}
fmt.Printf("%d: %s\n", i, fb[rand.Int63()%4])
}
}
- frosting1337 11mo agoThere's a conditional, though?
- albedoa 11mo agoYeah this is weird. It's against the rules to speculate about whether a commenter read the article, but what about the title of the article?
- LanceH 11mo agoI did, in fact, read the article. I've offered my subversive FizzBuzz as an alternative. It's not according to the article's rules, but it's definitely against the grain of the normal FizzBuzz.