Adblock breaks this site

A few simple questions. :)

Discussion in 'Programming General' started by WoW Sucks, Nov 1, 2007.

  1. WoW Sucks

    WoW Sucks Global Moderator
    Banned

    Joined:
    Jan 21, 2007
    Posts:
    3,708
    Referrals:
    3
    Sythe Gold:
    0
    A few simple questions. :)

    @ Covey. This isn't for my assignment, this is just to help me learn. I only asked if you would help me do an assignment. Thanks for the help above :) Sorry that Jazz beat you too it.

    @ Jazz, as i said in the first post, i have to learn VB6 for my college work, and my teacher doesn't know VB, so i thought the best thing to do would be to come here and ask, and you all have kindly helped me, which i would also do for you if you needed anything. I asked for the highscored code because i was interested in how it worked, and to see if i could make a different version, an easier one to understand and it turned out that i couldn't but that's the only thing i havn't used.

    As for the things im making, its just a jumble of ideas which ive done as much as possible on (from help from this thread) which ive either decided not to do any more of because it won't benefit me, or ive gotten stuck and not thought it was worth asking here.

    I ALWAYS try to figure things out for myself and i only ask here if i have no idea at all (or some idea that i need fixing). The first few questions were asked because of my stupidity where i'd forgotten to add essential things to make the program compile such as speach marks.

    I don't want you to think im taking advantage, because im really not. Ill explain what i have to do for my school project if you'd like, to show that most of these questions havn't been asked because of it.

    Once again i appreciate the help but i don't think your answer to question 12 is what i needed. But ill try it anyway :p

    PS: I find this the easiest way for me to learn. :D


    ----------------------------------------------------------------------------

    EDIT: Ok this is an update to question 12:

    Im trying to make a tic tac toe game (well that's the American name) and i this is the code im using (yes its probably extremely nooby but i dnt care :))

    Code:
    Edited to shorten post.
    I need to make an if statement that looks to see if images\0.jpg or images\1.jpg has been loaded or not. Because i need to make it so, if you get 3 X's or 3 O's in a row, then it shows a message box.

    To start with i was going to use something like:

    Code:
     
    
    if picture1.picture = "images\0.jpg" and picture2.picture = "images\0.jpg" and  picture3.picture = "images\0.jpg" then
    
         msgbox "You have won"
    end if
    
    I was going to do that for each combination, which would be long winded, but the easiest way for me.

    :)
     
  2. Covey

    Covey Creator of EliteSwitch
    Retired Sectional Moderator Visual Basic Programmers

    Joined:
    Sep 9, 2005
    Posts:
    4,510
    Referrals:
    9
    Sythe Gold:
    9
    Discord Unique ID:
    807246764155338833
    Discord Username:
    Covey#1816
    A few simple questions. :)

    Code:
    Private Sub Picture9_Click()
        If Option1.Value = True Then
            Picture9.Picture = LoadPicture("images\0.jpg")
            Line(9) = 0
            Picture9.Enabled = False
            Call player2
            Exit Sub
        End If
        
        If Option2.Value = True Then
            Picture9.Picture = LoadPicture("images\1.jpg")
            Line(9) = 1
            Picture9.Enabled = False
            Call player1
        End If
    End Sub
     
  3. Nullware

    Nullware Guru

    Joined:
    Jan 30, 2007
    Posts:
    1,761
    Referrals:
    4
    Sythe Gold:
    0
    A few simple questions. :)

    How about just having a variable store that information. When you load the picture just set a value into that variable.

    Either have it as boolean where true would represent "x" and false "o" or vice versa. Or have it as a string or integer value and save values in it that would let you know whether your picture box loaded the "x" or the "o".

    EDIT: Ahhhhh Covey beat me by mere seconds and he posted source code. You win this round...:rolleyes:
     
  4. WoW Sucks

    WoW Sucks Global Moderator
    Banned

    Joined:
    Jan 21, 2007
    Posts:
    3,708
    Referrals:
    3
    Sythe Gold:
    0
    A few simple questions. :)

    Thanks Nullware + Covey. I used covey's idea and it worked :D

    <3
     
  5. bojanglesman

    bojanglesman Member

    Joined:
    Nov 4, 2007
    Posts:
    32
    Referrals:
    0
    Sythe Gold:
    0
    A few simple questions. :)

    i said his moms dick fails just end this shit.

    -~=-~=~-~=-~=~ENDED-~=-~=~-~=-~=~(post not closed,this argument is)
     
  6. jdsfighter

    jdsfighter Forum Addict
    Visual Basic Programmers

    Joined:
    Jan 21, 2007
    Posts:
    603
    Referrals:
    0
    Sythe Gold:
    0
    A few simple questions. :)

    Ok the problem you are have with your tic tac toe is the following:

    You put
    Code:
    If box(1) And box(2) And box(3) = 2 Then
    When it should be
    Code:
    If box(1)=2 And box(2)=2 And box(3) = 2 Then
     
  7. Covey

    Covey Creator of EliteSwitch
    Retired Sectional Moderator Visual Basic Programmers

    Joined:
    Sep 9, 2005
    Posts:
    4,510
    Referrals:
    9
    Sythe Gold:
    9
    Discord Unique ID:
    807246764155338833
    Discord Username:
    Covey#1816
    A few simple questions. :)

    Everyone > You.
    Noone likes you, please leave.
     
  8. halojunkie

    halojunkie Active Member

    Joined:
    Dec 17, 2005
    Posts:
    232
    Referrals:
    0
    Sythe Gold:
    0
    A few simple questions. :)

    Just put
    Code:
    exit sub
    after each choice
     
  9. Jazz00006

    Jazz00006 Apprentice
    Visual Basic Programmers

    Joined:
    Aug 26, 2005
    Posts:
    807
    Referrals:
    0
    Sythe Gold:
    0
    A few simple questions. :)

    Refer to:

    Apart from that, the following code will work, there is no need to exit the subroutine. (Bad coding practice)


    WøW §u¢ks: I have no problem helping you since you're not a 1 poster leecher asking for a whole project, just curious.

    Keep the questions coming (Make them a bit harder too)
     
  10. WoW Sucks

    WoW Sucks Global Moderator
    Banned

    Joined:
    Jan 21, 2007
    Posts:
    3,708
    Referrals:
    3
    Sythe Gold:
    0
    A few simple questions. :)

    haha thanks alot halojunkie and Jazz :)

    Ill test it when i get home from school. And maybe add more questions.
     
  11. WoW Sucks

    WoW Sucks Global Moderator
    Banned

    Joined:
    Jan 21, 2007
    Posts:
    3,708
    Referrals:
    3
    Sythe Gold:
    0
    A few simple questions. :)

    New question added.

    Its working better now. :)
     
  12. Ti-Tronic

    Ti-Tronic Active Member
    Banned

    Joined:
    Nov 2, 2007
    Posts:
    142
    Referrals:
    0
    Sythe Gold:
    0
    A few simple questions. :)

    Nice, i'd help but it all seems to be covered.
     
  13. Covey

    Covey Creator of EliteSwitch
    Retired Sectional Moderator Visual Basic Programmers

    Joined:
    Sep 9, 2005
    Posts:
    4,510
    Referrals:
    9
    Sythe Gold:
    9
    Discord Unique ID:
    807246764155338833
    Discord Username:
    Covey#1816
    A few simple questions. :)

    i dont know how to clear a picture box but to exit the program totally use "end"
     
  14. 0wnedwithgaxe

    0wnedwithgaxe Apprentice

    Joined:
    Jul 16, 2006
    Posts:
    919
    Referrals:
    0
    Sythe Gold:
    0
    A few simple questions. :)

    Q16.
    Maybe use
    Worked for me.
    And maybe use the "End" command instead of the UnLoad Me.

    Sorry if it didin't help, I'm a beginner as well :)

    Edit://Ahh Covey got ahead of me -.-
     
  15. WoW Sucks

    WoW Sucks Global Moderator
    Banned

    Joined:
    Jan 21, 2007
    Posts:
    3,708
    Referrals:
    3
    Sythe Gold:
    0
    A few simple questions. :)

    Thanks, OWG and covey they worked. :D

    Now i have another problem =/
     
  16. halojunkie

    halojunkie Active Member

    Joined:
    Dec 17, 2005
    Posts:
    232
    Referrals:
    0
    Sythe Gold:
    0
    A few simple questions. :)

    The only way I can think of to do that would be.
    Code:
    Shell App.Path & "/exename.exe
    
    End
    
    I'm on my phone so let me know if that gives you any errors.
     
  17. WoW Sucks

    WoW Sucks Global Moderator
    Banned

    Joined:
    Jan 21, 2007
    Posts:
    3,708
    Referrals:
    3
    Sythe Gold:
    0
    A few simple questions. :)

    hmmm it sort of works, but not exactly well.

    Ill wait until someone else posts. Thanks anyway :)
     
  18. Nullware

    Nullware Guru

    Joined:
    Jan 30, 2007
    Posts:
    1,761
    Referrals:
    4
    Sythe Gold:
    0
    A few simple questions. :)

    If you need to start the whole program again to be able to start a new game it sounds like your program is not very ideally designed anyway and I would probably recommend some re-coding and re-analyzing. You should be able to start a new game with a command button or something that way clicking "OK" in your message box could just call that command button sub or whatever your new game trigger is.
     
  19. WoW Sucks

    WoW Sucks Global Moderator
    Banned

    Joined:
    Jan 21, 2007
    Posts:
    3,708
    Referrals:
    3
    Sythe Gold:
    0
    A few simple questions. :)

    It's not very well coded, i know that. Its the only way i know how to do it though, so i don't really have any choice.

    Using a command button would be exactly the same as using a messagebox result, and it would give the same error.

    I might give up on this and start something new... Time to think of something else :)
     
  20. Jazz00006

    Jazz00006 Apprentice
    Visual Basic Programmers

    Joined:
    Aug 26, 2005
    Posts:
    807
    Referrals:
    0
    Sythe Gold:
    0
    A few simple questions. :)

    I'd ask you to post source....
     
< echo in C | Need tutor on Programming >


 
 
Adblock breaks this site