Results 1 to 3 of 3

Thread: Help is required, plaease!

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 1999
    Location
    Pembroke Dock, Pembrokeshire, Wales
    Posts
    10

    Post

    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

  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845

    Post

    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

  3. #3
    Addicted Member
    Join Date
    Oct 1999
    Location
    Oporto, Portugal
    Posts
    134

    Post

    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
  •  



Click Here to Expand Forum to Full Width