Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,5 +1,4 @@
|
|||
eight_ball <- function()
|
||||
{
|
||||
eight_ball <- function() {
|
||||
responses <- c("It is certain", "It is decidedly so", "Without a doubt",
|
||||
"Yes, definitely", "You may rely on it", "As I see it, yes",
|
||||
"Most likely", "Outlook good", "Signs point to yes", "Yes",
|
||||
|
|
@ -9,24 +8,14 @@ eight_ball <- function()
|
|||
"My reply is no", "My sources say no", "Outlook not so good",
|
||||
"Very doubtful")
|
||||
|
||||
question <- ""
|
||||
|
||||
cat("Welcome to 8 ball!\n\n", "Please ask yes/no questions to get answers.",
|
||||
" Type 'quit' to exit the program\n\n")
|
||||
" Type 'quit' to exit the program\n\n", sep="")
|
||||
|
||||
while(TRUE)
|
||||
{
|
||||
repeat {
|
||||
question <- readline(prompt="Enter Question: ")
|
||||
if(question == 'quit')
|
||||
{
|
||||
break
|
||||
}
|
||||
randint <- runif(1, 1, 20)
|
||||
cat("Response: ", responses[randint], "\n")
|
||||
if(question == 'quit') break
|
||||
cat("Response: ", sample(responses, 1), "\n", sep="")
|
||||
}
|
||||
}
|
||||
|
||||
if(!interactive())
|
||||
{
|
||||
eight_ball()
|
||||
}
|
||||
if(!interactive()) eight_ball()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue