+ 2

Help me test out this very simple Ai

Suggestions on what to add is appreciated https://code.sololearn.com/chYK2idxPF93/?ref=app

11th Sep 2017, 6:52 PM
Derek Leiro
Derek Leiro - avatar
11 Respuestas
+ 3
Thank you that was very helpful. I'll get right on it by tomorrow @edi
11th Sep 2017, 7:47 PM
Derek Leiro
Derek Leiro - avatar
+ 3
I may need some help creating the loop, how can i implement it? @Edi
11th Sep 2017, 7:50 PM
Derek Leiro
Derek Leiro - avatar
+ 3
Looks like the while loop doesn't work properly. Any other ways to achieve this?
12th Sep 2017, 2:40 AM
Derek Leiro
Derek Leiro - avatar
+ 3
It repeating the phrase "how can i help you" then says "unhandled exception"
12th Sep 2017, 6:47 PM
Derek Leiro
Derek Leiro - avatar
+ 2
I am very new at coding and this is the second most complex C# progam i have made. I want it to be more complex and smarter. Lets join brains and help each other
11th Sep 2017, 6:55 PM
Derek Leiro
Derek Leiro - avatar
+ 2
I noticed that switch statements can't take any operrand like AND/OR. So i have to stick with else if :(
11th Sep 2017, 7:52 PM
Derek Leiro
Derek Leiro - avatar
0
when there are a lot of conditions you should definitely use the "switch case" construct, it's more readable and maintainable than "else if". Also, to avoid worrying whether the user types capital letters you can just use the "toLower" method so that the string is always lower-case. Also, put the code in a loop so that the user can go on with the conversation. I suggest you not using "var" when not necessary.
11th Sep 2017, 7:45 PM
Edi Lipovac
Edi Lipovac - avatar
0
no problem, ask if you need further assistance :)
11th Sep 2017, 7:48 PM
Edi Lipovac
Edi Lipovac - avatar
0
why do you need to use logical operators?
11th Sep 2017, 8:32 PM
Edi Lipovac
Edi Lipovac - avatar
0
here's the looped version with some extras: https://code.sololearn.com/ctB9cce8Khy0/#cs (i tested the code on Visual Studio, not sure if it works on SoloLearn)
11th Sep 2017, 8:57 PM
Edi Lipovac
Edi Lipovac - avatar
0
as I said, I tested the code and it works perfectly. Can you be more specific about the problem you're having?
12th Sep 2017, 5:52 AM
Edi Lipovac
Edi Lipovac - avatar