Skip to content

Instantly share code, notes, and snippets.

@masaha03
Created February 18, 2012 00:43
Show Gist options
  • Save masaha03/1856573 to your computer and use it in GitHub Desktop.
Save masaha03/1856573 to your computer and use it in GitHub Desktop.
f <- function(i){
l <- c("Fizz", "Buzz", "FizzBuzz")
ii <- (0==i%%5)*2 + (0==i%%3)*1
print(l[ii])
print(rep(l[ii], 10)[i])
return(ifelse(0<ii, l[ii], i))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment