Sub Integer) As Integer GetRandomNumber = Int((Upperbound –

Topic: Free samples
Sample donated:
Last updated: September 6, 2019

Sub Setup_Game()Dim DoorCar As IntegerDim rownumber As LongDim _trials_ As LongDim counter As LongCells(rownumber,1).Value = rownumber – 1DoorCar =GetRandomNumber(3)Dim Setup_Doors DoorCar,rownumberChoose_Doorrownumber        If (Cells(4, 13).Value = YES) Then        Chosen_Switch rownumber, True     ElseIf (Cells(4, 13).Value = NO) Then        Chosen_Switch rownumber, False     ElseIf (Cells(4, 13).Value = NO) Then        Random_Switch rownumber     End IfDetermine_Success DoorCar,rownumberNext rownumberEnd SubFunctionGetRandomNumber(Upperbound As Integer) As IntegerGetRandomNumber =Int((Upperbound – 1 + 1)  Rnd + 1)End FunctionSub Setup_Doors(DoorCarAs Integer, rownumber As Long)If DoorCar = 1 Then    Cells(rownumber, 2).Value = Car    Cells(rownumber, 3).Value = Goat    Cells(rownumber, 4).Value = GoatElseIf DoorCar = 2 Then    Cells(rownumber, 2).Value = Goat    Cells(rownumber, 3).Value = Car    Cells(rownumber, 4).Value = GoatElseIf DoorCar = 3 Then    Cells(rownumber, 2).Value = Goat    Cells(rownumber, 3).Value = Goat    Cells(rownumber, 4).Value = CarElse    Cells(rownumber, 2).Value = OOPS     Cells(rownumber, 3).Value = OOPS    Cells(rownumber, 4).Value = OOPSEnd If  End SubSubChoose_Door(rownumber As Integer)Dim Stayed As IntegerIf Door 1 Switched ThenValue = NoSub Choose_Door(rownumberAs Long)Cells(rownumber,6).Value = GetRandomNumber(3)End SubSubRandom_Switch(rownumber As Long)Dim Switched As LongSwitched =GetRandomNumber(2) If Switched = 1 ThenCells(rownumber,7).Value = YESElseCells(rownumber,7).Value = NOEnd If  End SubSubChosen_Switch(rownumber As Long, Choice As Boolean)If Choice = True ThenCells(rownumber,7).Value = YESElseCells(rownumber,7).Value = NOEnd If  End SubSub Determine_Success(DoorCarAs Integer, rownumber As Long)Chosen_Door = Cells(rownumber,6).ValueSwitched_Door =Cells(rownumber, 7).ValueIf Chosen_Door = DoorCarThen        If Switched_Door = NO Then        Cells(rownumber, 8).Value = WON         Else         Cells(rownumber,8).Value = LOST        End If      Else        If Switched_Door = YES Then        Cells(rownumber, 8).Value = WON         Else        Cells(rownumber, 8).Value = LOST End If  End Sub

Choose your subject

x

Hi!
I'm Jessica!

Don't know how to start your paper? Worry no more! Get professional writing assistance from me.

Click here