Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

I think this is right…


Tholek
 Share

Recommended Posts

Well it's Visual Studio, I think its the same.

This is for my chapter 3 of my learn with me  tutorial just wanted to know if this was correct.

This is for Tic-Tac-Toe also known has Noughts & Crosses

```
Private Sub Button1_Click(ByVal sender As System.Object._
ByVal e As System.EventArgs) Handles Button1.Click,_
Button2.Click, Button3.Click, Button4.Click, button5.Click,_
Button6.Click, Button7.Click, Button8.Click, button9.Click,_
sender.Text=Token
sender.Enabled=False
CheckWinner()
End Sub

```
Tell me if I messed up anywhere, please.
Link to comment
Share on other sites

> Visual Studio? .NET? erm if this was VB6, i don't know what you've done.. well i think you didn't show the complete code of the program.

Visual Studio 2008\. thats fine.. That's true I didn't. :P

> I code in vb.net so to me it looks like he made it send you something if you press any of those buttons… Want to show more of the code and name some of those?

That's Correct.. I have not yet completed it.

These are first with two global variables and Form1_Load functions which calls restartGame(). (I think this is correct)

```
Dim Token As Char
Dim Player As Integer
Dim Winner As Boolean

Private Sub Form1_Load(ByVal sender As System.Object,_
ByVal e As System.EventArgs) Handles MyBase.Load
RestartGame()
End Sub

```
Next up are the two event handlers for the restart and quit buttons.

```
Private Sub Button10_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Button11.click
REM quit button
End
End Sub

```
This is what I wrote that I think will happen. The CheckWinner() function will go through the rows, columns, and diagonals looking for matching Xs or Os to find a winner but only if there is one.
Link to comment
Share on other sites

  • 4 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...