• Log in or sign up for an account here: https://www.sythe.org/login

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.

:)
 
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
 
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:
 
Thanks Nullware + Covey. I used covey's idea and it worked :D

<3
 
Well if his dick fails then you just don't have one. In nice big print we have:


In regards to Question 12 I think what you want is this.
Code:
 If picture1.picture = "images\0.jpg" then
        msgbox "The picture is visible"
 End if

For Question 13 I would say just put it in a timer and enable that timer whenever the game is started. If for some reason that can't work for you just post so in the thread and I'll try to think of something else.

i said his moms dick fails just end this shit.

-~=-~=~-~=-~=~ENDED-~=-~=~-~=-~=~(post not closed,this argument is)
 
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
 
Just put
Code:
exit sub
after each choice
Refer to:
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


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)
 
haha thanks alot halojunkie and Jazz :)

Ill test it when i get home from school. And maybe add more questions.
 
New question added.

Its working better now. :)
 
Nice, i'd help but it all seems to be covered.
 
Q16.
Maybe use
Picture1.Picture=LoadPicture("")
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 -.-
 
Thanks, OWG and covey they worked. :D

Now i have another problem =/
 
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.
 
hmmm it sort of works, but not exactly well.

Ill wait until someone else posts. Thanks anyway :)
 
Now that's all sorted out, i have another problem. When i finish the game of tic tac tie/ naughts and crosses it brings up a messagebox asking if i want to play again, i need to be able to start the whole program again when i click yes, otherwise it fucks up.
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.
 
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 :)
 
Runescape Gamblingrunescape gambling
Back
Top