For a class project my partner and I have created a Rock Paper Scissors simulation using Markov Chain. We have the input for what the computer does, but we don't know how we can keep track of the score.
How can we use VBA or maybe a function to get the score after each round?
We've tried things in VBA we tried different functions. But there is no data to summarize it.
Sub Score()
Dim sVariable As String
Dim iNumber As Integer
Dim iPC As Variant
Dim iPlayer As Variant
sVariable = Sheets("Model").Range("D10")
iPC = Sheets("Model").Range("E6") + 1
iPlayer = Sheets("Model").Range("F6") + 1
iNumber = 1
If sVariable = "PC Winner!" Then
Sheets("Model").Range("E6") = iPC
ElseIf sVariable = "Player Winner!" Then
Sheets("Model").Range("F6") = iPlayer
End If
End Sub
That code is the closest we have gotten and we added a button to make it run since it doesn't do it automatically. But now every time we add the score the move changes for the PC because of the random function we have for the Markov data. We want to keep the score and reset it everytime the game is over.