|
-
Nov 24th, 1999, 05:40 PM
#1
Thread Starter
New Member
I am making a slot machine for a uni assignment, it involves generating 3 random numbers 1-4 in 3 labels, with the topscore being 4, in order to score credits depends on how many 4's u get, 3 4's = 30 credits, 2 4's = 15 credits, 1 4 = 5 credits. When i get certain numbers to obtain a score I want it to add to an existing total which is in a label, i need to include every possibility to obtain the score i.e. num1 and num3 = 15 credits, what's the best way to do this? If u want to look at my code, then feel free to ask
-
Nov 24th, 1999, 06:09 PM
#2
Frenzied Member
Now shall I preach about the fact that you ought to try and work it out yourself?
It's pretty trivial
I was going to past some code but I changed my mind!
Try and work it out
Here's one method
Use an array of labels
loop though the array checking the caption of each incrementing a counter if the caption = 4
then use a select on the counter,
and return a value dependent on that
------------------
Mark Sreeves
Analyst Programmer
[email protected]
A BMW Group Company
-
Nov 24th, 1999, 08:29 PM
#3
Addicted Member
Good answer Mark.
------------------
Jorge Ledo
[email protected]
Portugal
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|