You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
462 B
19 lines
462 B
3 years ago
|
function getBotResponse(input) {
|
||
|
//rock paper scissors
|
||
|
if (input == "rock") {
|
||
|
return "paper";
|
||
|
} else if (input == "paper") {
|
||
|
return "scissors";
|
||
|
} else if (input == "scissors") {
|
||
|
return "rock";
|
||
|
}
|
||
|
|
||
|
// Simple responses
|
||
|
if (input == "hello") {
|
||
|
return "Hello there!";
|
||
|
} else if (input == "goodbye") {
|
||
|
return "Talk to you later!";
|
||
|
} else {
|
||
|
return "Try asking something else!";
|
||
|
}
|
||
|
}
|