Dim num As Integer Dim guess As Integer Dim response As String Do num = Int(Rnd() * 100) + 1 Do Do guess = InputBox("Enter guess (1-100)") If guess < 1 Or guess > 100 Then MsgBox("! ENTER 1-100 !") End If Loop While guess < 1 Or guess > 100 If guess > num Then MsgBox("too high") ElseIf guess < num Then MsgBox("too low") Else MsgBox("you got it!") End If Loop While guess <> num response = InputBox("Play again ? y/n") Loop While response = "y" MsgBox("Thanks for playing! Bye!") End Sub Dim num As Integer Dim nextnum As Integer Dim money As Integer Dim bet As Integer Dim choice As String Dim correct As String money = 100 num = Int(Rnd() * 100) + 1 Do MsgBox("The current card is " + num.ToString()) Do bet = InputBox("You have " + money.ToString() + " How much you betting?") Loop While bet < 50 Or bet > money Do choice = InputBox("Higher or lower? h/l ") Loop While choice <> "h" And choice <> "l" nextnum = Int(Rnd() * 100) + 1 MsgBox("And the next card is a " + nextnum.ToString()) If nextnum > num And choice = "h" Then MsgBox("You're right!") money = money + bet correct = "yes" ElseIf nextnum < num And choice = "l" Then MsgBox("You're right!") money = money + bet correct = "yes" Else MsgBox("Game over for you!") correct = "nope" End If num = nextnum 'this is important! The card just flipped becomes the main card! Loop While correct = "yes" MsgBox("You are leaving with $" + money.ToString()) End Sub Dim stones As Integer Dim num As Integer Dim winner As String stones = Int(Rnd() * 15) + 10 winner = "no one" Do 'first player makes move MsgBox("There are " + stones.ToString() + " stones") Do num = InputBox("Player 1, remove how many stones? 1-4") Loop While num < 1 Or num > 4 Or num > stones stones = stones - num If stones = 0 Then MsgBox("Player 1 picked the last stone up!") winner = "player two" End If 'second player makes move if player one didn't win If winner = "no one" Then MsgBox("There are " + stones.ToString() + " stones") Do num = InputBox("Player 2, remove how many stones? 1-4") Loop While num < 1 Or num > 4 Or num > stones stones = stones - num If stones = 0 Then MsgBox("Player 2 picked the last stone up!") winner = "player one" End If End If Loop While winner = "no one" MsgBox("The winner is " + winner)