Skip to content

Instantly share code, notes, and snippets.

@MikeMKH
Created June 27, 2017 11:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MikeMKH/fc21cf4d2771f8dc8366d95ab9f6c82a to your computer and use it in GitHub Desktop.
Save MikeMKH/fc21cf4d2771f8dc8366d95ab9f6c82a to your computer and use it in GitHub Desktop.
FizzBuzz kata in R
fizzy <- seq(0, 100, 3)
buzzy <- seq(0, 100, 5)
fizzbuzzy <- fizzy[fizzy %in% buzzy]
fizzbuzz <- 0:100
fizzbuzz[fizzbuzz %in% fizzbuzzy] <- "FizzBuzz"
fizzbuzz[fizzbuzz %in% fizzy] <- "Fizz"
fizzbuzz[fizzbuzz %in% buzzy] <- "Buzz"
fizzbuzz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment