So Im Using The Case Statement In My Chat Bot Application And From My Code Below You Will See The Line "Do You Think I Am Nice" , Now , im trying to make it so that if you type in anything other than "yes" or "no" then it says "I Did Not Understand That". I tried using a case else statement and that did not work . any ideas ?
Code:Console.ForegroundColor = ConsoleColor.Yellow Console.WriteLine("Do You Think I Am Nice ?") Select Case Console.ReadLine.ToLower Case "yes", "no" Console.WriteLine("Thank You , I'm Glad You Like me :) , Do You Like Thanksgiving ?") Response3 = Console.ReadLine.ToUpper If Response3 = "yes" Then Console.WriteLine("Me Too , I Wish I Could Eat Turkey Though ....") Console.WriteLine("Since I Am A Computer") ElseIf Response3 = "no" Then Console.WriteLine("Nice") Else Console.ForegroundColor = ConsoleColor.Red Console.WriteLine("I Didn't Understand That.") Console.WriteLine("-----------------------------") Console.ReadLine() End End If Case "no", "nah" Console.ForegroundColor = ConsoleColor.Yellow Console.WriteLine(":( , Im Sorry , I'll Get You Flowers To Make Up For It , Do You Like Flowers ?") Response4 = Console.ReadLine().ToLower If Response4 = "yes" Then Console.WriteLine("Okay I'll Talk To You Later , Im Off To Get Sunflowers , Bye") ElseIf Response4 = "no" Then Console.WriteLine("Okay , Ill Try To Be A Better Robot , Bye") Else Console.ForegroundColor = ConsoleColor.Red Console.WriteLine("I Didn't Understand That") Console.WriteLine("-----------------------------") Console.ReadLine() End End If End Select Console.ReadLine() End Sub End Module




Reply With Quote
