Random Number Generator Coding
In my database I want to give players ratings but based 3 levels. Good, Mediocre or Poor. If I select Good then it should give ratings between 7 and 9, mediocre 5 and 7 and poor 3 and 5.
eg
Name Level Passing Free Kicks Tackling Shooting
Beckham Good 9 9 7 8
Re: Random Number Generator Coding
Hmmm... Yes....
So is there a question in there somewhere? :)
Re: Random Number Generator Coding
something like this perhaps:
VB Code:
Private Enum LEVEL
Poor = 3
Mediocre = 5
Good = 7
End Enum
Private Sub Form_Load()
Debug.Print GenRating(Good), GenRating(Good), GenRating(Good)
Debug.Print GenRating(Mediocre), GenRating(Mediocre), GenRating(Mediocre)
Debug.Print GenRating(Poor), GenRating(Poor), GenRating(Poor)
End Sub
Private Function GenRating(ByVal eLevel As LEVEL) As Long
GenRating = Int(Rnd * 3) + eLevel
End Function
Re: Random Number Generator Coding
I have it sorted now. I described the function I wanted a reply to enable me to do. It wasn't that difficult to see. I am new to Visual Basic and was really wanting someone to use their expertise to help me, looks as if nobody is interested so I am going to do it myself and as I hit problems post them here.
Re: Random Number Generator Coding
Hmmm... I'm sorry if I offended you, that wasn't my intention I just didn't understand what you wanted to do. Bushmobile however seems to have understood it and did give you a reply.