+ 2
Help me test out this very simple Ai
Suggestions on what to add is appreciated https://code.sololearn.com/chYK2idxPF93/?ref=app
11 Réponses
+ 3
Thank you that was very helpful. I'll get right on it by tomorrow @edi
+ 3
I may need some help creating the loop, how can i implement it? @Edi
+ 3
Looks like the while loop doesn't work properly. Any other ways to achieve this?
+ 3
It repeating the phrase "how can i help you" then says "unhandled exception"
+ 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
+ 2
I noticed that switch statements can't take any operrand like AND/OR. So i have to stick with else if :(
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.
0
no problem, ask if you need further assistance :)
0
why do you need to use logical operators?
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)
0
as I said, I tested the code and it works perfectly. Can you be more specific about the problem you're having?