Dim MyValue, YourChance, YourValue as Integer Randomize MyValue = Int((10 × Rnd) + 1) ‘乘号改为星号 YourChance = 3 do while YourChance > 0 Call InputYourValue If YourChance = 0 Then Exit do loop Msgbox “Be lucky next time” ‘双引号为半角 end
Sub InputYourValue Input YourValue if YourValue = MyValue Then Msgbox “算你厉害” ‘双引号为半角 end else if YourValue < MyValue Then Msgbox “请输入一个更大的数” ‘双引号为半角 else Msgbox “请输入一个更小的数” ‘双引号为半角 end if end if YourChance = YourChance - 1 End Sub