求vb2010的小游戏 打地鼠 猜数字都可以。不要迷宫、五子棋、打砖块。感激不尽

2024-12-04 22:20:44
推荐回答(1个)
回答1:

Private Sub Command1_Click() Dim a As Integer, b As Integer, s As String MsgBox "我记住一个数,你根据我的提示猜猜是这个数是几" Randomize a = Int(Rnd * 100) s = InputBox("写出你猜的数") Do While s <> "" b = Val(s) If a = b Then MsgBox "你真聪明!喊明孙猜对了" Exit Do ElseIf a > b Then MsgBox b & " 有点小了" ElseIf a < b Then MsgBox b & " 有点大了" End If s = InputBox("写出你猜的数") Loop MsgBox "郑链槐老88,下次再玩"End Sub