Creating a graphic tic tac toe game in VB6

Level:
Level2

Written By TheVBProgramer.

PROGRAMMING EXERCISE

Tic-Tac-Toe

 

Write a VB application that will enable a human player to play a classic game of Tic-Tac-Toe against the computer.

Requirements

 

The application should begin with a form that contains the following elements:

-          A label saying "Welcome to Tic-Tac-Toe"

-          Two option buttons enclosed in a frame. The captions for the option buttons should be "X" and "O". The caption for the frame should be "Select 'X' or 'O' and click OK".

-          A command button with the caption "OK".

When the user clicks OK, exit this form and display the main form (the game board).

 

At the start of each game, the application should select who should go first at random, and display an appropriate message to the user in a message box (either "You go first this time." or "This time, I will go first.")

 

The game board should be set up with an array of label controls indexed 0 through 8. When a player clicks one of the available labels, an "X" or an "O" (depending on the user's initial selection) should appear in that label. Then the computer should make its move.

 

When the program detects a win, a line should be drawn through the "three in a row". If the player wins, the message "YOU WIN !!!" should flash across the game board; if the computer wins, the message "YOU LOSE!!!" (or "I WIN!!!" or "COMPUTER WINS!!!") should flash across the game board. If the game ends in a tie, the message "IT'S A TIE!!!" should flash across the game board. (Hint: To get the flashing message, use a label in conjunction with a timer and toggle the label's Visible property on and off.)

 

The program should provide options to play a new game and to quit.

 

The program should provide keep four counts: games played, games won, games lost, and games tied. These counts should be displayed on the form.

 

The overall appearance of the application should be tasteful and suggest "fun". Experiment with various colors and fonts until you get it the way you want it.

 

The Computer's AI Algorithm

 

Your program should implement the following algorithm to try to make the computer win:

 

(1) Examine the board for a winning move, and if you find one, make that move – otherwise proceed to step (2).

(2) Examine the board to see if your opponent has a winning move, and if so, select that square to block, otherwise proceed to step (3).

(3) If the center square is available, select it, otherwise proceed to step (4).

(4) If you are already occupying the center square, and a side square is available, take the side square, otherwise proceed to step (5).

(5) If a corner square is available, then take it, otherwise, take the next available square.

 

Note: When the above algorithm is implemented, it is possible for a smart player to beat the computer if the player is able to go first. If you switch steps (4) and (5), it may be impossible for a player to win; the best they can do is tie.

 

Tic-Tac-Toe

(screenshots of my version of the solution)

 

 

 

 

 

Download the solution for this project here.

 

If you enjoyed this post, subscribe for updates (it's free)

About Report

I wantttt A Report Of 20-30 Pages
For A project "Calculator" & "Tic-tac-Toe"

Loveyou MJ

Loveyou MJ

The code

Here is the code for my hard version. You can't select which you are (you are always X) yet. there are also other forms but these are just a normal version a title page and help page. Sorry no comments in the code. Feel free to use this code but please give credit to Kaite

There are 9 labels that make up the board.

Private Sub win()

lbl1.Caption = ""
lbl2.Caption = ""
lbl3.Caption = ""
lbl4.Caption = ""
lbl5.Caption = ""
lbl6.Caption = ""
lbl7.Caption = ""
lbl8.Caption = ""
lbl9.Caption = ""

lblwinsno.Caption = Val(lblwinsno.Caption) + 1
hardwinform.lblwin.Caption = "You win!"
playform.Visible = False
hardwinform.Visible = True

End Sub
Private Sub lose()

lbl1.Caption = ""
lbl2.Caption = ""
lbl3.Caption = ""
lbl4.Caption = ""
lbl5.Caption = ""
lbl6.Caption = ""
lbl7.Caption = ""
lbl8.Caption = ""
lbl9.Caption = ""

lbllosesno.Caption = Val(lbllosesno.Caption) + 1
hardwinform.lblwin.Caption = "You Lose!"
playform.Visible = False
hardwinform.Visible = True
End Sub

Private Sub tie()
lbl1.Caption = ""
lbl2.Caption = ""
lbl3.Caption = ""
lbl4.Caption = ""
lbl5.Caption = ""
lbl6.Caption = ""
lbl7.Caption = ""
lbl8.Caption = ""
lbl9.Caption = ""

lbltiesno.Caption = Val(lbltiesno.Caption) + 1
hardwinform.lblwin.Caption = "Tie!"
playform.Visible = False
hardwinform.Visible = True

End Sub
Private Sub check()

If lbl3.Caption = "X" And lbl5.Caption = "X" And lbl7.Caption = "X" Then
Call win
ElseIf lbl3.Caption = "O" And lbl5.Caption = "O" And lbl7.Caption = "O" Then
Call lose

ElseIf lbl1.Caption = "X" And lbl5.Caption = "X" And lbl9.Caption = "X" Then
Call win
ElseIf lbl1.Caption = "O" And lbl5.Caption = "O" And lbl9.Caption = "O" Then
Call lose

ElseIf lbl1.Caption = "X" And lbl2.Caption = "X" And lbl3.Caption = "X" Then
Call win
ElseIf lbl1.Caption = "O" And lbl2.Caption = "O" And lbl3.Caption = "O" Then
Call lose

ElseIf lbl4.Caption = "X" And lbl5.Caption = "X" And lbl6.Caption = "X" Then
Call win
ElseIf lbl4.Caption = "O" And lbl5.Caption = "O" And lbl6.Caption = "O" Then
Call lose

ElseIf lbl7.Caption = "X" And lbl8.Caption = "X" And lbl9.Caption = "X" Then
Call win
ElseIf lbl7.Caption = "O" And lbl8.Caption = "O" And lbl9.Caption = "O" Then
Call lose

ElseIf lbl1.Caption = "X" And lbl4.Caption = "X" And lbl7.Caption = "X" Then
Call win
ElseIf lbl1.Caption = "O" And lbl4.Caption = "O" And lbl7.Caption = "O" Then
Call lose

ElseIf lbl3.Caption = "X" And lbl6.Caption = "X" And lbl9.Caption = "X" Then
Call win
ElseIf lbl3.Caption = "O" And lbl6.Caption = "O" And lbl9.Caption = "O" Then
Call lose

ElseIf lbl2.Caption = "X" And lbl5.Caption = "X" And lbl8.Caption = "X" Then
Call win
ElseIf lbl2.Caption = "O" And lbl5.Caption = "O" And lbl8.Caption = "O" Then
Call lose

End If
If lbl1.Caption <> "" And lbl2.Caption <> "" And lbl3.Caption <> "" And lbl4.Caption <> "" And lbl5.Caption <> "" And lbl6.Caption <> "" And lbl7.Caption <> "" And lbl8.Caption <> "" And lbl9.Caption <> "" Then
Call tie
End If

End Sub
Private Sub priority5()

If lbl2.Caption = "" Then
lbl2.Caption = "O"
Call check
ElseIf lbl4.Caption = "" Then
lbl4.Caption = "O"
Call check
ElseIf lbl6.Caption = "" Then
lbl6.Caption = "O"
Call check
ElseIf lbl8.Caption = "" Then
lbl8.Caption = "O"
Call check
End If

End Sub
Private Sub priority3()

If lbl1.Caption = "" Then
lbl1.Caption = "O"
Call check
ElseIf lbl3.Caption = "" Then
lbl3.Caption = "O"
Call check
ElseIf lbl7.Caption = "" Then
lbl7.Caption = "O"
Call check
ElseIf lbl9.Caption = "" Then
lbl9.Caption = "O"
Call check
Else: Call priority5

End If

End Sub
Private Sub priority4()

If lbl5.Caption = "" Then
lbl5.Caption = "O"
Call check
Else: Call priority4
End If

End Sub
Private Sub priority2()

If lbl3.Caption = "X" And lbl5.Caption = "X" And lbl7.Caption = "" Then
lbl7.Caption = "O"
Call check
ElseIf lbl5.Caption = "X" And lbl3.Caption = "" And lbl7.Caption = "X" Then
lbl3.Caption = "O"
Call check
ElseIf lbl5.Caption = "" And lbl3.Caption = "X" And lbl7.Caption = "X" Then
lbl5.Caption = "O"
Call check

ElseIf lbl1.Caption = "X" And lbl5.Caption = "X" And lbl9.Caption = "" Then
lbl9.Caption = "O"
Call check
ElseIf lbl1.Caption = "X" And lbl5.Caption = "" And lbl9.Caption = "X" Then
lbl5.Caption = "O"
Call check
ElseIf lbl1.Caption = "" And lbl5.Caption = "X" And lbl9.Caption = "X" Then
lbl1.Caption = "O"
Call check

ElseIf lbl1.Caption = "X" And lbl2.Caption = "X" And lbl3.Caption = "" Then
lbl3.Caption = "O"
Call check
ElseIf lbl1.Caption = "X" And lbl2.Caption = "" And lbl3.Caption = "X" Then
lbl2.Caption = "O"
Call check
ElseIf lbl1.Caption = "" And lbl2.Caption = "X" And lbl3.Caption = "X" Then
lbl1.Caption = "O"
Call check

ElseIf lbl4.Caption = "X" And lbl5.Caption = "X" And lbl6.Caption = "" Then
lbl6.Caption = "O"
Call check
ElseIf lbl4.Caption = "X" And lbl5.Caption = "" And lbl6.Caption = "X" Then
lbl5.Caption = "O"
Call check
ElseIf lbl4.Caption = "" And lbl5.Caption = "X" And lbl6.Caption = "X" Then
lbl4.Caption = "O"
Call check

ElseIf lbl7.Caption = "X" And lbl8.Caption = "X" And lbl9.Caption = "" Then
lbl9.Caption = "O"
Call check
ElseIf lbl7.Caption = "X" And lbl8.Caption = "" And lbl9.Caption = "X" Then
lbl8.Caption = "O"
Call check
ElseIf lbl7.Caption = "" And lbl8.Caption = "X" And lbl9.Caption = "X" Then
lbl7.Caption = "O"
Call check

ElseIf lbl1.Caption = "X" And lbl4.Caption = "X" And lbl7.Caption = "" Then
lbl7.Caption = "O"
Call check
ElseIf lbl1.Caption = "X" And lbl4.Caption = "" And lbl7.Caption = "X" Then
lbl4.Caption = "O"
Call check
ElseIf lbl1.Caption = "" And lbl4.Caption = "X" And lbl7.Caption = "X" Then
lbl1.Caption = "O"
Call check

ElseIf lbl3.Caption = "X" And lbl6.Caption = "X" And lbl9.Caption = "" Then
lbl9.Caption = "O"
Call check
ElseIf lbl3.Caption = "X" And lbl6.Caption = "" And lbl9.Caption = "X" Then
lbl6.Caption = "O"
Call check
ElseIf lbl3.Caption = "" And lbl6.Caption = "X" And lbl9.Caption = "X" Then
lbl3.Caption = "O"
Call check

ElseIf lbl2.Caption = "X" And lbl5.Caption = "X" And lbl8.Caption = "" Then
lbl8.Caption = "O"
Call check
ElseIf lbl2.Caption = "X" And lbl5.Caption = "" And lbl8.Caption = "X" Then
lbl5.Caption = "O"
Call check
ElseIf lbl2.Caption = "" And lbl5.Caption = "X" And lbl8.Caption = "X" Then
lbl2.Caption = "O"
Call check

Else: Call priority3
End If

End Sub
Private Sub priority1()

If lbl3.Caption = "O" And lbl5.Caption = "O" And lbl7.Caption = "" Then
lbl7.Caption = "O"
Call check
ElseIf lbl5.Caption = "O" And lbl3.Caption = "" And lbl7.Caption = "O" Then
lbl3.Caption = "O"
Call check
ElseIf lbl5.Caption = "" And lbl3.Caption = "O" And lbl7.Caption = "O" Then
lbl5.Caption = "O"
Call check

ElseIf lbl1.Caption = "O" And lbl5.Caption = "O" And lbl9.Caption = "" Then
lbl9.Caption = "O"
Call check
ElseIf lbl1.Caption = "O" And lbl5.Caption = "" And lbl9.Caption = "O" Then
lbl5.Caption = "O"
Call check
ElseIf lbl1.Caption = "" And lbl5.Caption = "O" And lbl9.Caption = "O" Then
lbl1.Caption = "O"
Call check

ElseIf lbl1.Caption = "O" And lbl2.Caption = "O" And lbl3.Caption = "" Then
lbl3.Caption = "O"
Call check
ElseIf lbl1.Caption = "O" And lbl2.Caption = "" And lbl3.Caption = "O" Then
lbl2.Caption = "O"
Call check
ElseIf lbl1.Caption = "" And lbl2.Caption = "O" And lbl3.Caption = "O" Then
lbl1.Caption = "O"
Call check

ElseIf lbl4.Caption = "O" And lbl5.Caption = "O" And lbl6.Caption = "" Then
lbl6.Caption = "O"
Call check
ElseIf lbl4.Caption = "O" And lbl5.Caption = "" And lbl6.Caption = "O" Then
lbl5.Caption = "O"
Call check
ElseIf lbl4.Caption = "" And lbl5.Caption = "O" And lbl6.Caption = "O" Then
lbl4.Caption = "O"
Call check

ElseIf lbl7.Caption = "O" And lbl8.Caption = "O" And lbl9.Caption = "" Then
lbl9.Caption = "O"
Call check
ElseIf lbl7.Caption = "O" And lbl8.Caption = "" And lbl9.Caption = "O" Then
lbl8.Caption = "O"
Call check
ElseIf lbl7.Caption = "" And lbl8.Caption = "O" And lbl9.Caption = "O" Then
lbl7.Caption = "O"
Call check

ElseIf lbl1.Caption = "O" And lbl4.Caption = "O" And lbl7.Caption = "" Then
lbl7.Caption = "O"
Call check
ElseIf lbl1.Caption = "O" And lbl4.Caption = "" And lbl7.Caption = "O" Then
lbl4.Caption = "O"
Call check
ElseIf lbl1.Caption = "" And lbl4.Caption = "O" And lbl7.Caption = "O" Then
lbl1.Caption = "O"
Call check

ElseIf lbl3.Caption = "O" And lbl6.Caption = "O" And lbl9.Caption = "" Then
lbl9.Caption = "O"
Call check
ElseIf lbl3.Caption = "O" And lbl6.Caption = "" And lbl9.Caption = "O" Then
lbl6.Caption = "O"
Call check
ElseIf lbl3.Caption = "" And lbl6.Caption = "O" And lbl9.Caption = "O" Then
lbl3.Caption = "O"
Call check

ElseIf lbl2.Caption = "O" And lbl5.Caption = "O" And lbl8.Caption = "" Then
lbl8.Caption = "O"
Call check
ElseIf lbl2.Caption = "O" And lbl5.Caption = "" And lbl8.Caption = "O" Then
lbl5.Caption = "O"
Call check
ElseIf lbl2.Caption = "" And lbl5.Caption = "O" And lbl8.Caption = "O" Then
lbl2.Caption = "O"
Call check

ElseIf lbl1.Caption = "X" And lbl5.Caption = "" Then
lbl5.Caption = "O"
ElseIf lbl9.Caption = "X" And lbl5.Caption = "" Then
lbl5.Caption = "O"
ElseIf lbl1.Caption = "X" And lbl9.Caption = "X" And lbl8.Caption = "" Then
lbl8.Caption = "O"
ElseIf lbl1.Caption = "X" And lbl9.Caption = "X" And lbl2.Caption = "" Then
lbl2.Caption = "O"

ElseIf lbl3.Caption = "X" And lbl5.Caption = "" Then
lbl5.Caption = "O"
ElseIf lbl7.Caption = "X" And lbl5.Caption = "" Then
lbl5.Caption = "O"
ElseIf lbl3.Caption = "X" And lbl7.Caption = "X" And lbl8.Caption = "" Then
lbl8.Caption = "O"
ElseIf lbl3.Caption = "X" And lbl7.Caption = "X" And lbl2.Caption = "" Then
lbl2.Caption = "O"

Else: Call priority2
End If

End Sub

Private Sub CPU()

Call priority1

End Sub

Private Sub Label1_Click()

End Sub

Private Sub cmdhelp_Click()

helpform.cmdplay.Caption = "Continue - Hard"
hardform.Visible = False
helpform.Visible = True

End Sub

Private Sub Form_Load()

End Sub

Private Sub lbl1_Click()

If lbl1.Caption = "" Then
lbl1.Caption = "X"
Call check
Call CPU
Else: MsgBox "Invalid move"
End If

End Sub

Private Sub lbl2_Click()
If lbl2.Caption = "" Then
lbl2.Caption = "X"
Call check
Call CPU
Else: MsgBox "Invalid move"
End If

End Sub

Private Sub lbl3_Click()
If lbl3.Caption = "" Then
lbl3.Caption = "X"
Call check
Call CPU
Else: MsgBox "Invalid move"
End If

End Sub

Private Sub lbl4_Click()

If lbl4.Caption = "" Then
lbl4.Caption = "X"
Call check
Call CPU
Else: MsgBox "Invalid move"
End If

End Sub

Private Sub lbl5_Click()

If lbl5.Caption = "" Then
lbl5.Caption = "X"
Call check
Call CPU
Else: MsgBox "Invalid move"
End If

End Sub

Private Sub lbl6_Click()

If lbl6.Caption = "" Then
lbl6.Caption = "X"
Call check
Call CPU
Else: MsgBox "Invalid move"
End If

End Sub

Private Sub lbl7_Click()

If lbl7.Caption = "" Then
lbl7.Caption = "X"
Call check
Call CPU
Else: MsgBox "Invalid move"
End If

End Sub

Private Sub lbl8_Click()

If lbl8.Caption = "" Then
lbl8.Caption = "X"
Call check
Call CPU
Else: MsgBox "Invalid move"
End If

End Sub

Private Sub lbl9_Click()

If lbl9.Caption = "" Then
lbl9.Caption = "X"
Call check
Call CPU
Else: MsgBox "Invalid move"
End If

End Sub

sir can u pls send the source

sir can u pls send the source code

code

hello sir i really like the tic tac toe even tried by myself but somehow there's some error with the code that m unable to rectify.. kindly help me with the code on my mail id 'mayushah11@gmail.com'
thank you..

can u plz send me the code for this game?

can u plz send me the code for this game? thnx

game vb code

pls.... give me the sorce vb code of tic-tac-toe.......... pls send this in my e-mail id.......

sir plz send me the source

sir plz send me the source code of tic tac toe game on my email id monika_cap_gupta@yahoo.com

Tic Tac Toe

Can you please send me the code
Email: kweier720@aol.com

Thanks

cool

its great pls send me the code its urgent

Code

Please sent the code to my email! magwurtz@cox.net
Thank you!

Great game .

can you give me the codes of this game ,

I gonna use it for my school projects.

send the codes in this email address . jaspher_casungcad@yahoo.com.

Thx :)

tic tac toe code

Can you please send me a copy of the code for this game. thaks.

code please

please send me a code of tic tac toe of visual basic 6 plsssssssss....this is my email thunder_emperor85@y.c

code

pls send me the code...10q...

hi

can i have the code of tic tac toe???we really need this one,,,tnx

source code for matrix processor

Sir, my name is henry, i want to make a matrix processor of (A*B,A-B,A+B) ,and i need a source code for this program
so i could learn more,i will really appreciate if you can help me using visual basics.Thanks.pls send it to my email on
henry_agunu@yahoo.com.God bless you,i need it for my project .

pls send me code plsssssssssss!

pls send me code of this game i want for my project as early as possible plssssssss send me now

plz look at the end of last print short here on this page for so

"Download the solution for this project here."
just click here and get the solution

can u help me???

can u plz send the source code ?...
plzzzzzzzzz........
i need it for our project really badly..

here's my email add: mizty_zue_08@yahoo.com

HELP ME PLEASE!! :(

PLEASE SEND ME THE CODES. THIS IS FOR MY PROJECT IN COMPUTER... SEND ME THE CODES PLEASE! my email is koreanovela_addictus@yahoo.com.ph

THANK YOU :D

the code

Hi plsssss send to me the codes of this tic tac toe game. tnx! :))
my email is daniel123_94talob@yahoo.com

gud day plz send me a code

gud day plz send me a code of tic tac toe this is my email dhatzcompania@yahoo.com

codes

kindly send to me the codes ??i need it for my case study.. plssss.. thanks a lot

hi

good day!
can u plz send the code???
this is my account mae.gellesania@yahoo.com
Tnx and god bless

God

God Bless??????????????????????????????????

i need this code

would you be so kind to send me that code at evans.nikita@rocketmail.com thanks

i need this code..can u

i need this code..can u please view your codes or send it to my email at jess_gurl1112@yahoo.com.ph..thanks

Hi, it's super, I m also

Hi,
it's super, I m also develop some game so The source code will help to appriciate and understand itw workings more

chansvar@gmail.com
thank u

i really need this code

i really need this code please email me @ jeffrey_lavarro@yahoo.com
thnx

i need vb6 code in this tic

i need vb6 code in this tic tac toe pls send my email argelmoreno@yahoo.com..thank you!

Are you too lazy to read the

Are you too lazy to read the article? There is a link to a zipped file containing the code at the end of the article.

PlZZZZZZZz

can u send me the codes?? i just really need it for my project

please send me the codes

please send this programs code, and i will appreciate it very much. my email address Ramseymunyua@yahoo.com. thank you.

plz

i really need the coding for this. my email is ac_Dcjacob@hotmail.com thanx

Please

i need this one for my project... thank you

i'am interested with this 1..

I'm interested with this kind of program...
please send me the codes of this program at my email add...
annvendi20@yahoo.com

thanks a lot vb6.us clan

plz send me vb6 code of

plz send me vb6 code of tictac toe

name

The name says it all.

Regarding Tic tac toe game.

I want to get the source code (in C++)of Tic-tac-toe game.In this game the player is supposed to play with computer and should always loose.It means that computer must always wins.
Can u please get it for me!!!!
Thanxs.

How to make game tic tac toe with 2 player??

I have project from my lecturer,,,

that is game tic tac toe with 2 player,,

you can help me??

can you give me source code dari game tic tac toe with visual basic 6.0..

i wish,,,it,,,

thank's.. ^^

hi, can u please send me

hi,

can u please send me the code to this game. my email is sports_freak_2011@yahoo.com

thank you.

The Source code is at the

The Source code is at the bottom....

But it's...

But the source code is labeled as "Solution" Just click the link and then download the zip file.

please give the codes of tictactoe

can you please give the codes of tictactoe!!!

please send it to my email:

holy_boy07@yahoo.com

hi!

can u please give the code for the tictac toe..
please..
i need it badly..
email the code to me..
here is my email address
angeluzh_26@yahoo.com

Please send me the code..My

Please send me the code..My e-mail ID is lak104@gmail.com..Thanks..

can i have the source code

can i have the source code for this game plz

Hay How You Doing? I Was

Hay How You Doing? I Was Wounder Could You Please Send Me The Code To This Game To jjperkins2007@yahoo.com

can you send me these codes

Hi can you send me those codes please i realy like that and i want to study them more!!!

i need that code

can u please send me the code.. i want to study that code..THANXX..
freak_throy@yahoo.com

please send me the code/project

I'm learning game programming right now, and I'm doing it for my campus' task, can you send me the code and the project please. thank you
my em-mail : tekunofuriku@gmail.com

please

please send me this codes needed in this program.......... please!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

SCCT

SKYSTAR COLLEGE OF 'C'INFORMATION TECHNOLOGIES

Please

can u please send me this game and how to make it with codes and all thanx heaps...
send it to Josh_bentley_27@hotmail.com

ssst

pls send me the code my email is dark_khent@yahoo.com

could you?!

could you please send me the code for the tic tac toe..or could you please send me the file itself so that i could have the whole copy of the program? Thnx

hi

can i ask for the codes? pls send 8 2 my email add.
cuz..8s already wonderfull,and i want to try 8!

thankS!

PLZZZ SEND ME THE CODE OF

PLZZZ SEND ME THE CODE OF THIS PROGRAM MY EMAIL IS swastikaconan@yahoo.com
AS SOON AS AUGUST 2009 TY......

I need d source code in vb

Hi,
Its realy wonderfu. I would really love to have the source code in Visual Basic for this fine tic tac toe game. The source code will help to appriciate and understand itw workings more.
my email addre is urssincerelyolise@yahoo.com
thank you.

it's cool

please send me the source codes i love to learn..(chathuridias@ymail.com)
thank u

hello

plzzzzzzzzzzzz send me the code of this game on scorpionwafa@yahoo.com pleaseeeeeeeeeeeeeeeeeeeeeeeeeeee

hello

plzzzzzzzzzzzz send me the code of this game on scorpionwafra@yahoo.com pleaseeeeeeeeeeeeeeeeeeeeeeeeeeee

tic

I have no idea why everyone keeps asking for the code when it's clearly there!

The thing I like about your project is how amazingly tidy and more importantly efficient your code is. I was programming my own tictactoe game and came across this one. Mine had fairly much the same layout, except you can't choose whether you will be x's or o's, as x always goes first. But that said, I have masses of code in comparison, and I haven't even started coded the procedure for the computer to calculate it's move.

That said, I used images rather than labels for the game board, which although it looks nicer, it didn't help my code.

However I wasn't at all impressed by the layout or colour scheme. It's too bright and colourful and gives a tacky design impression, it should be toned down or faded IMO. It looks like your typical '90's homemade website!

However it's still a nice program, and very well programmed, and I learned a few things from your code that will come in useful.

I would be happy to share mine when it's complete if you wanted a look?

Could you please send me

Could you please send me this code as well. Its much appreciated!

Thanks!!

Can I please have the code

Can I please have the code to this game? I suck at computer science and my grade depends on it. thankx

Do you have code for VB8?

Do you have code for VB8?

The code

the code can be found in the area that says: ...Download the solution for this project here.......

Pls send me the code

Pls send me the code..thanks

can you please send me also

can you please send me also the code?

can i have that code?

can i have the code of that program?
please, send it to my email address..

thanks! :))

Hi

Hi sir can i ask how did you come up with that game im a die hard fan of game makers and dreamed of being a game creator someday. . Can i also have a code of the tic tac toe so i could study it and learn more. . thank you so much. . heres my email sir elhgameaccount@yahoo.com

P.S: your the man. . hope i could be like you someday. .

i really dont see why u guys

i really dont see why u guys keep asking for the code i mean theres the source right in fornt of u!!!

pls....

send me the code of tic tac toe game in visual basic6.0

vb6

can you kindly give the source code of this game plz.... for give me plz send this to paulo_red17@yahoo.com

hello cool game!

please send me the code thanks in advance
----> paasaawaay_daaw_aako@yahoo.com

hey send me the source code pls

please send me the code for this game using the following address: m4coi@yahoo.com

code

gnkHi nice article ,could you please forward me the code on visual basic 6.0 for this game tic tac toe on my e-mail id please as soon as possible

its very nice

can i have the code...?
pls send to this email.. ayhle_000@yahoo.com

Helllp!

please send me the code for this game using the following address: ollycgp123@blueyonder.co.uk

coucould you please send me

coucould you please send me the code to my email jordan__34@hotmail.com thankyou so much

Plz send me the code

Hi ,
can u pls send me the code of the project to my email id miteshnibjiya@gmail.com
Thanks,
Mitesh Kumar

please send me the code thanks

please send me the code of tic tac toe., thanks..,
abelardo_jorge_j@yahoo.com

Code please mtandy9@aol.com

Code please mtandy9@aol.com =)

help

please help me with the coding for the game i need some help
xD

hey buddy what kinda help do

hey buddy what kinda help do you need
i am here to solve it for you:
Kri$

Plzz can you send code for

Plzz can you send code for tic tac toe on 7472268@gmail.com

Help

sir,
please help me to solve my problem... my problem is, how to configure USB port to connect VB 6.0? i am using barcode scanner for our time and attendance monitoring system... bar code is our unique id number to log-in and out.... can you give an example? please........
thanks...!

code

hi please send me source code............

help me....!!!!

can u plzz give me d codes.......................d pic is just not enought.......plzzzzz............help me.....!!!!!!

pls..help me!!!!

hi!!!!can u give me the code?? i will try to make it and understand this program....pic.is not enough
kindly send it to me plssss....in my email add:alanruiz_18@yahoo.com
thank u in advance>>>>>.

can i have the code??

can u plz send the code
here:

czsah.xxvi@yahoo.com
mhz26zarine

can I get the code

could you send me the code for this please?

my email is suckafish1118@yahoo.com

Hi i was wondering if i

Hi i was wondering if i could get the code, i have a version i am trying to do and i was wondering if i could compare mine to urs. my email is cyrogenicgamer@gmail.com

CODES

kindly send to my e-mail ad the vb code of this this game. please forgive my request. this is my account dranrebavenido@yahoo.com........
thank very much....

okay

i hav nthn 2 say =)
actually me 2...^_^

we're actually we are 2 people....

please

can i have the source code

aw

Could you send me the code for this game/program!!
hatakekakashi_15@yahoo.com

oh!!!............

@@
can u send the source code
I'm just curious about it ........
...............................................

weh...

hahaha...

about tic-tac-toe

please se nd me the code.
i just want to learn
anjali_khanna21@rediffmail.com

Hey anjali i would like you

Hey anjali
i would like you to write to me to kris_whatsup@yahoo.com to get the code!
Kri$
New York

vb codes

kindly send to my e-mail ad the vb code of this this game. please forgive my request. this is my account chelle_qou14@yahoo.com........
thank very much....

how??????

can someone tell me to know where i can study this type of programming?????? a website where they offer tutorials... plsssssssssssssssss................ pls e-mail me at "devil_triperz@yahoo.com" for ur answers....

You are here

This site offers hundreds of tutorials. Browse around and learn (you might start with the Beginner's Guide on the left)

wooohhhh...

wooohhh... i was curious abt the code....can u teach hw to create a game like dat...?...i wnt 2 learn... tnx...

AI

I was wondering if you had one with more complex AI? If you do, could you post the source code for it?
For my own tic tac toe, I was thinking of allowing the computer to "think" several steps ahead.
Meaning, the computer loops through the possible moves it can make. Then it loops through the possible moves the player can make after that. In each possible move the player can make, the computer then runs through the remainder of the moves it can make.
At each step, if the computer can win, then it executes that plan, otherwise it chooses the spot that doesn't allow the player to win. Of course, the computer's first move will probably take ages to complete, but the player never wins...
You could then adapt this to 4X4 tic tac toe. Probably take aeons to make a move then, but heck.

sorry wrong info its

sorry wrong info
its supposed to be
1 2 3
4 5 6
7 8 9
okay u take number 1
n then computer takes 5
u take 9
n computer takes 3 thinking what r u doing
u take 7 n then computer takes 4
and says oh no im going to lose
take 8 to ensure ur win :D
good luck with that

Hey buddy array starts from

Hey buddy array starts from 0 and not from 1.So its 0 to 8.

not that hard? i just

not that hard? i just won?
if u go first
get the top left corner
the computer will take the middle
n then u take the bottom left corner
the computer will take one corner
u will take the other n then u can win easily

send me the source code

send me the source code

The source file includes

The source file includes stage 4 and 5 switched, and its impossible to win

therefore from my comment

therefore from my comment above its possible to win
but only if u go first XD