RosettaCodeData/Task/Menu/R/menu.r
2019-09-12 10:33:56 -07:00

9 lines
232 B
R

showmenu <- function(choices = NULL)
{
if (is.null(choices)) return("")
ans <- menu(choices)
if(ans==0) "" else choices[ans]
}
str <- showmenu(c("fee fie", "huff and puff", "mirror mirror", "tick tock"))
str <- showmenu()