我当前的代码
公开课形式1
将 randomObject 调暗为新的 Random()
Dim alphaRand As Integer = randomObject.Next(65, 91) Dim alpha As String = Me.textAlphabet.Text.ToUpper Dim asciicode As Integer = Asc(alpha) If asciicode = alphaRand Then Me.lblAlphaResult.Text = "Congratulation! Your guess: " & textAlphabet.Text & " is correct,you win" Me.cmdAlphaNewGame.Enabled = True Me.cmdAlphaGuess.Enabled = False ElseIf asciicode < alphaRand Then Me.lblAlphaResult.Text = "You guess is too low.Try again" ElseIf asciicode > alphaRand Then Me.lblAlphaResult.Text = "Your guess is too high.Try again" End If End Sub
结束类
* randomObject.Next(65, 91) ' 这意味着它只根据 asciicode 生成 AZ 的随机 alpha ,那么只有元音呢?*
我可以使用数组 Dim vowels As String() = {"A", "E", "I", "O", "U"} 之类的东西,然后从我的字符串中生成随机字母供我稍后猜测