472,353 Members | 1,705 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

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:)
Nov 11 '21 #1
1 14745
Smitty099099
3 2Bits
Private Function Roll1() As Integer
Randomize()
Return Int(Rnd() * 11)
End Function
Mar 3 '22 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

12
by: Mark Constant | last post by:
I have a drop-down list now and I got it so when something is selected from the drop down list it calls a JavaScript function. I want it so the...
138
by: theodp | last post by:
--> From http://www.techdirt.com/articles/20040406/1349225.shtml Microsoft Patents Saving The Name Of A Game Contributed by Mike on Tuesday,...
5
by: A_StClaire_ | last post by:
annoying one. can anyone spot the issue? it appears communityCards can't be accessed via my static function but I don't know why... Game.h: ...
1
by: fowle040 | last post by:
I underlined and bold print my files. I need to know how to make this code into a working game. The object of the game is to have two players 1-...
1
hpbutterbeer
by: hpbutterbeer | last post by:
We have a Machine Project and my brain is currently in a clouded state. Sorry, I'm just a beginner in C Programming... Text twist is a windows...
19
by: foolsmart2005 | last post by:
I have written a snake game. There are 2 levels in the game(I finished 1st level). It can run in VC++ without problem but, when I run it on the...
13
tpgames
by: tpgames | last post by:
I'm not sure what search terms to put in to find a sample JavaScript that will give me what I need. I have a Scrambled word game whereby the ONLY...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.