Welcome to Dream.In.Code
Become a VB.NET Expert!

Join 150,080 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 1,791 people online right now. Registration is fast and FREE... Join Now!




Scoring system VB.Net 2005

 
Reply to this topicStart new topic

Scoring system VB.Net 2005, Scoring system based of Random Number generated

crzyone9584
22 Apr, 2008 - 03:17 AM
Post #1

New D.I.C Head
*

Joined: 22 Apr, 2008
Posts: 2

Im using a random number generated to move two pictures. I have two random number generating. on for picturebox1 and picturebox2 basically. Here is the problem. The random numbers just go straight into the scoring system. So instead of going up by 1 when a is higher than b it shows the number generated. I'm out putting all this in a messgebox which pops up through the click of a button

This is for the random numbers and the incrementing the higher one up by 1 and if they are the same adding 1 to c.

a is picturebox1
b is picturebox2
c is a tie

CODE


    Dim a As Integer = 0
    Dim b As Integer = 0
    Dim c As Integer = 0
    Dim RandomClass As New Random()
    Dim RandomClassb As New Random()

    Dim RandomNumber As Integer
    Dim random1 As Integer

         a = RandomNumber
        RandomNumber = RandomClass.Next(1, 14)

        b = random1
        random1 = RandomClassb.Next(1, 14)

        If a >= b Then
            c += 1
        ElseIf a > b Then
            a += 1
        ElseIf b > a Then
            b += 1
        ElseIf b >= a Then
            c += 1
        End If

MessageBox.Show("Race Results" & vbCrLf & vbCrLf & "Rocket 1: " & a & vbCrLf & vbCrLf & "Rocket 2: " & b & vbCrLf & vbCrLf & "Tie: " & c, _
        "Race Results", MessageBoxButtons.OK, MessageBoxIcon.Information)


Thanks for the help.
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: Scoring System VB.Net 2005
22 Apr, 2008 - 04:23 AM
Post #2

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 9,483



Thanked: 161 times
Dream Kudos: 9075
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
Maybe it's too early and I havent had enough coffee, but Im not quite understanding what's happening versus what you need this to do. Also, this is VB.NET so Im moving it to that forum smile.gif

Maybe it's too early and I haven't had enough coffee, but Im not quite understanding what's happening versus what you need this to do. Also, this is VB.NET so I'm moving it to that forum smile.gif
User is offlineProfile CardPM
+Quote Post

crzyone9584
RE: Scoring System VB.Net 2005
22 Apr, 2008 - 03:57 PM
Post #3

New D.I.C Head
*

Joined: 22 Apr, 2008
Posts: 2

Sorry it was pretty late when i posted ill try to clearify.

I have to picture boxes. Inside these pictureboxes are rockets. I'm using a random number generator to see which one of these pictures will reach the top of the form first. Along with that i'm implamenting a scoring system. the random number will be how it works.

Randomclass and randomnumber is for the variable a which is picture box one
Randomclassb and random1 is for the variable b which is picturebox 2

Now with this exlpained i hope it more clear.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/8/09 11:30PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live VB.NET Help!

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month