VB.NET School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a VB.NET Expert!

Join 300,475 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 1,744 people online right now. Registration is fast and FREE... Join Now!




Simple game, debug problems

 

Simple game, debug problems, I need someone to look at it

fxcapt

24 Oct, 2007 - 11:26 AM
Post #1

New D.I.C Head
*

Joined: 24 Oct, 2007
Posts: 2


My Contributions
It is almost finished, I have one error that I can't seem to fix. Thank You for looking and commenting!Attached File  TTT4.zip ( 34.97k ) Number of downloads: 96


User is offlineProfile CardPM
+Quote Post


MRJ

RE: Simple Game, Debug Problems

24 Oct, 2007 - 12:02 PM
Post #2

D.I.C Head
Group Icon

Joined: 13 Oct, 2007
Posts: 88



Thanked: 2 times
My Contributions
Well, I'd like to help you out with your problem, but there is just 2 minor issues.

First is that you haven't given any description at all, just posted source. Now being new here and wanting to help, I downloaded the source and took a look and apart from a missing 'End Class' it compiles fine.

which bring me to the second issue. I'm not sure what the rules of the game are supposed to be so I can't see if there is a logic problem. I could go through the close to 100 lines of if statements ( well 50 the other half are exit subs) to figure it out, but I'm not that patient.

So if you care to elaborate on the problem I'd be happy to help.

Also I think this is in the wrong forum, it should be in VB.net

This post has been edited by MRJ: 24 Oct, 2007 - 12:03 PM
User is offlineProfile CardPM
+Quote Post

longr59

RE: Simple Game, Debug Problems

24 Oct, 2007 - 12:42 PM
Post #3

New D.I.C Head
*

Joined: 20 Sep, 2007
Posts: 31


My Contributions
I noticed the missing end class already stated and the Private Sub Form1_Load statement needs to be under the Public class Form1 declaration
User is offlineProfile CardPM
+Quote Post

fxcapt

RE: Simple Game, Debug Problems

25 Oct, 2007 - 08:38 AM
Post #4

New D.I.C Head
*

Joined: 24 Oct, 2007
Posts: 2


My Contributions
QUOTE(MRJ @ 24 Oct, 2007 - 01:02 PM) *

Well, I'd like to help you out with your problem, but there is just 2 minor issues.

First is that you haven't given any description at all, just posted source. Now being new here and wanting to help, I downloaded the source and took a look and apart from a missing 'End Class' it compiles fine.

which bring me to the second issue. I'm not sure what the rules of the game are supposed to be so I can't see if there is a logic problem. I could go through the close to 100 lines of if statements ( well 50 the other half are exit subs) to figure it out, but I'm not that patient.

So if you care to elaborate on the problem I'd be happy to help.

Also I think this is in the wrong forum, it should be in VB.net

This is the description doc. I think I am pretty close.Attached File  TicTacTechno.doc ( 129.5k ) Number of downloads: 67


QUOTE(fxcapt @ 25 Oct, 2007 - 09:36 AM) *

QUOTE(MRJ @ 24 Oct, 2007 - 01:02 PM) *

Well, I'd like to help you out with your problem, but there is just 2 minor issues.

First is that you haven't given any description at all, just posted source. Now being new here and wanting to help, I downloaded the source and took a look and apart from a missing 'End Class' it compiles fine.

which bring me to the second issue. I'm not sure what the rules of the game are supposed to be so I can't see if there is a logic problem. I could go through the close to 100 lines of if statements ( well 50 the other half are exit subs) to figure it out, but I'm not that patient.

So if you care to elaborate on the problem I'd be happy to help.

Also I think this is in the wrong forum, it should be in VB.net

This is the description doc. I think I am pretty close.Attached File  TicTacTechno.doc ( 129.5k ) Number of downloads: 67



User is offlineProfile CardPM
+Quote Post

MRJ

RE: Simple Game, Debug Problems

25 Oct, 2007 - 11:22 AM
Post #5

D.I.C Head
Group Icon

Joined: 13 Oct, 2007
Posts: 88



Thanked: 2 times
My Contributions
I'm sorry to say that once again there is more information then I've really got time to go through... What I really need is a description of what it's not doing that it should be doing. The design doc is good but it's long and has elements that you haven't implemented, like the New game button. Still I do have a few pointers.

First is your Button Events
CODE

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If sender.text = "" Then
            sender.text = "1"
        ElseIf sender.text = "1" Then
            sender.text = "2"
        ElseIf sender.text = "3" Then
            sender.text = "4"

        End If
    End Sub


You don't need one for every button, you can point each button to the same event. That will remove alot of unneeded code and make fixing errors faster.

Also there seems to be an error in the if statement as it is now it will increment the buttons number from blank to 1, from 1 to 2, and from 3 to 4.

This is how I think it should work.
CODE


    Private Sub ButtonClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click, Button8.Click, Button7.Click, Button6.Click, Button5.Click, Button4.Click, Button3.Click, Button2.Click, Button16.Click, Button15.Click, Button14.Click, Button13.Click, Button12.Click, Button11.Click, Button10.Click, Button1.Click

        If sender.text = "" Then
            sender.text = "1"
        ElseIf sender.text = "1" Then
            sender.text = "2"
        ElseIf sender.text = "2" Then
            sender.text = "3"
        ElseIf sender.text = "3" Then
            sender.text = "4"
        ElseIf sender.text = "4" Then
            sender.text = "1"
        End If

    End Sub


Your other big issue is checker. It will only check the first if statement then exit, you need to update to have each if statement look like this:
CODE

If Button1.Text = Button2.Text Or Button1.Text = Button3.Text Or Button1.Text = Button4.Text Then
            MsgBox("You have a problem in row 1")    
            Exit Sub
End If


or use

CODE

        If Button1.Text = Button2.Text Or Button1.Text = Button3.Text Or Button1.Text = Button4.Text Then
            MsgBox("You have a problem in row 1")            
        ElseIf Button1.Text = Button9.Text Or Button1.Text = Button13.Text Then
            MsgBox("You have a problem in column 1")          
        ElseIf Button1.Text = Button6.Text Then
.
.
.

end if


After that is fixed you can then review the logic of the checks to see whats wrong.
User is offlineProfile CardPM
+Quote Post

ferrari12508

RE: Simple Game, Debug Problems

10 Nov, 2007 - 03:00 PM
Post #6

D.I.C Lover
Group Icon

Joined: 2 Nov, 2007
Posts: 1,113



Thanked: 3 times
Dream Kudos: 150
My Contributions
end class is missing
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/8/09 03:28AM

Live VB.NET Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month