Need help with random picture array VB6

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • swatmajor1
    New Member
    • Oct 2006
    • 40

    #1

    Need help with random picture array VB6

    I have been creating a basic sodoku game as a school assignment. Basically to load a puzzle, a pre-set arrangment of numbers are loaded into a hidden picture box array called "Picsolutio n". What I want it to do is have random picture boxes in the array "PicQuestio n" equal the matching picture boxes in the "Picsolutio n" Array.

    If anyone can help me it would be very Appreciated.

    Swatmajor1

    PS please ignore any bad spelling
    Last edited by swatmajor1; Oct 19 '06, 11:54 AM. Reason: Needed better grammer
  • willakawill
    Top Contributor
    • Oct 2006
    • 1646

    #2
    Originally posted by swatmajor1
    I have been creating a basic sodoku game as a school assignment. Basically to load a puzzle, a pre-set arrangment of numbers are loaded into a hidden picture box array called "Picsolutio n". What I want it to do is have random picture boxes in the array "PicQuestio n" equal the matching picture boxes in the "Picsolutio n" Array.

    If anyone can help me it would be very Appreciated.

    Swatmajor1

    PS please ignore any bad spelling
    Sounds like you are asking for an entire solution rather than assistance to get through where you are stuck. Can you post some code and tell us where you are stuck?

    Comment

    • swatmajor1
      New Member
      • Oct 2006
      • 40

      #3
      Never mind i used a Label, as shown in the code below

      Code:
      Public Sub Random()
          Do Until lblReveal.Caption = 50
              Index = Int(Rnd * 80) - 5
              If Index < 0 Then Index = 0                                 'If the value of Index is less than 0 then sets index value to 0
              If Index > 80 Then Index = 80                               'If the value of Index is greater than 80 then sets index value to 80
              PicQuestion(Index).Picture = picSolusion(Index).Picture     'sets PicQuestion picturebox to the corresponding PicSolusion Picture box
              lblReveal.Caption = lblReveal.Caption + 1
          Loop
          If lblReveal.Caption = 50 Then lblReveal.Caption = 0
      End Sub
      Thanks anyway

      Swatmajor1

      Comment

      Working...