Skip to content

Instantly share code, notes, and snippets.

@kos59125
Last active August 29, 2015 14:11
Show Gist options
  • Save kos59125/2c888ca037e70afcae6b to your computer and use it in GitHub Desktop.
Save kos59125/2c888ca037e70afcae6b to your computer and use it in GitHub Desktop.
library(magrittr)
takewhile <- function(zoi, count=0L) {
count <- count + 1L
if (eval(zoi)) {
return(count)
} else {
return(takewhile(zoi, count))
}
}
quote(
list(c("今日", "ぞい"), c("も"), c("1", "ぞい"), c("日", "ぞい"), c("がん", "ぞい"), c("ばる", "ぞい"), c("ぞい!")) %>%
sapply(sample, size=1L) %>%
paste(collapse="") %T>%
cat(fill=TRUE) %>%
equals("今日も1日がんばるぞい!")
) %>%
takewhile() %>%
cat("がんばるまで", ., "zoi でした", fill=TRUE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment