Results 1 to 7 of 7

Thread: multiple if's ... quick question

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2004
    Posts
    9

    multiple if's ... quick question

    Let's say im creating a tic-tac-toe's game or a slot machine. For it to be won there has got to be 3 of the same pictures in a row (circles/x's for tic-tac-toe or bar/bar/bar for the slots). The problem im having here is that i cannot code such a posible condition.

    i was just introduced this year to programming and i would love to continue learning.

    any tips or help?

    jdbb

  2. #2
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263
    What are you using for the control for the image? Not much info to go on here...

    Control arrays would come to my mind first as a solution. Put one control on the FORM and then COPY/PASTE it back onto the form a second time. You will be asked if you want to create a "control array" - which is basically a clone of the first control - using array-like properties to index them.

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2004
    Posts
    9
    sorry i did not make myself clear....i meant once the game is won i want to make it stop...how do i code such a posible condition where:

    if image1=image2=image3 then
    text1.text = "you have won"

    ???

  4. #4
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263
    VB Code:
    1. If image1 = image2 and image2 = image3 Then
    2.    Text1.Text = "You have won"
    3.    ... code to stop/restart or exit the program goes here...
    4. End If

  5. #5

    Thread Starter
    New Member
    Join Date
    Aug 2004
    Posts
    9
    thx man...such a begginer i am

  6. #6

  7. #7

    Thread Starter
    New Member
    Join Date
    Aug 2004
    Posts
    9
    thanks man...its a bit to complex for me right now...

    the most i can do is a mediocre bingo program that i posted like an hour ago (i think is the link after this one)

    check it out and see if you can help me

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