PDA

Click to See Complete Forum and Search --> : Help is required, plaease!


mr moose
Nov 24th, 1999, 04:40 PM
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

Mark Sreeves
Nov 24th, 1999, 05:09 PM
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

Mark.Sreeves@Softlab.co.uk
A BMW Group Company

JorgeLedo
Nov 24th, 1999, 07:29 PM
Good answer Mark.

------------------
Jorge Ledo
j_ledo@hotmail.com
Portugal