RosettaCodeData/Task/Menu/R/menu.r

10 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()