Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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])
   }
  }


There's a conditional, though?


Yeah 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?


I 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: