Results 1 to 2 of 2

Thread: yatzee/dice problem

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 1999
    Location
    New York
    Posts
    32

    Post

    Ok, im makeing a yatzee type game and i'm having a little trouble with checking for matches. If you have any ideas on how i can get it work or just improve my code, that would be great. here's what i have so far:

    dim matches(5)
    for i =cmddice.lbound to cmddice.ubound
    for j=cmddice.lbound to cmddice.ubound
    if i<>j and cmddice(i).caption = cmddice(j).caption then
    matches(cmddice(i).caption)=matches(cmddice(i).caption)+1
    end if
    next i
    next i

    Thats what im trying to use to determine how many dice i have of each value. what should i do?

  2. #2
    Lively Member
    Join Date
    May 1999
    Posts
    89

    Post

    Hey i just programed a game that had the same thing.

    this is from a craps game i programmed. You have to have a hidden image(0) when the dice is equal.

    imgDice(die1).Visible = True
    If die2 <> die1 Then
    imgDice(die2).Visible = True
    Else
    imgDice(0).Picture imgDice(die2).Picture
    imgDice(0).Visible = True
    End If

    If you like i can send the code for the application.

    Regards,

    Scott

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