RosettaCodeData/Task/Loops-Break/R/loops-break.r

13 lines
211 B
R
Raw Permalink Normal View History

2013-04-10 21:29:02 -07:00
sample0to19 <- function() sample(0L:19L, 1,replace=TRUE)
repeat
{
result1 <- sample0to19()
if (result1 == 10L)
{
print(result1)
break
}
result2 <- sample0to19()
cat(result1, result2, "\n")
}