Function Problem - Bowling Game

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chrisd123
    New Member
    • Nov 2021
    • 1

    Function Problem - Bowling Game

    I need to create two functions to determine the score of a frame of bowling using rnd to generate random numbers.
    I have tried variations of the following:
    Private Function Roll1()
    Dim r1 As Integer
    r1 = CInt(10 * Rnd())
    Return r1
    End Function

    Private Function Roll2()
    Dim r1, r2 As Integer
    If r1 = Roll1() Then
    r2 = CInt(10 * Rnd()) And
    (r1 + r2 >= 10)
    End If
    Return r2
    End Function

    However, it keeps retiurning a value of 0, can someone please provide some guidance.

    Thanks in advance:)
  • Smitty099099
    New Member
    • Mar 2022
    • 5

    #2
    Private Function Roll1() As Integer
    Randomize()
    Return Int(Rnd() * 11)
    End Function

    Comment

    Working...