【发布时间】:2015-03-01 14:17:55
【问题描述】:
抱歉,如果问题不清楚。我是编程新手,我正在尝试制作一个类似 JARVIS 的小程序来娱乐。我在 vb.net 中对此进行编码,因为这是我在学校教过的唯一语言。这是我到目前为止提出的代码:
Module Module1
Sub Main()
Dim txtInput As String
txtInput = Console.ReadLine()
Select Case txtInput
Case Is = "hello jarvis", "hello"
Console.WriteLine("Hello Sir")
Case Is = "jarvis"
Console.WriteLine("Yes Sir")
End Select
Select txtInput
Case Is = "what time is it", "what's the time", "current time"
End Select
Console.ReadLine()
End Sub
结束模块
我正在努力做到这一点,以便我可以继续向它提出不同的案例问题,并且每次都会给出不同的回应。现在,我只能问它一个问题,它会给我一个输出。这可能有一个简单的答案,但正如我所说,我实际上是在 2-3 周前开始编程的。
提前致谢。
【问题讨论】:
-
使用循环将新输入读入
txtInput,直到出现“退出”之类的内容