Article

# A simple Visual Basic Version of Tic Tac Toe in 2 and 3 Dimensions

By , 19 Apr 2004
 Rate this:

## Introduction

This is just a simple Tic Tac Toe game. I've included a Rules Word Doc for anyone who doesn't know the rules, but let me just go ahead and save you the time:

• If you are X's then get three X's in a row
• If you are O's then get three O's in a row

Note that, with 3D, it will show all possible winning combinations if applicable. See picture above.

Pretty confusing stuff huh....ha ha.

This was a class assignment, well at least, just the 2 dimensional part of the program. I went a little over board and did 3D also. It really wasn't that difficult, it was just a lot more extra checking. Basically, you just add each move into an array and check for appropriate winning combinations after every turn. I've added comments in the source code, so it is relatively easy to follow. Hope you enjoy the game.

It's a fun kid's game. You can change the code very simply to personalize it for two people so that it will show the name of the winner. Kids like to see their name on the PC.

A list of licenses authors might use can be found here

Web Developer
United States
Jeff is currently a Graduate student in the Computer and Information Sciences department at East Tennessee State University. He enjoys programming for fun and a challenge. He is currently researching video edge detection for use in Home Automation applications.

 First Prev Next
 Checking Winner C++ flavio.rodriguez 31-Aug-07 21:00
 Why not use the e.Graphics object....? AbooJch 17-May-07 11:43
 help tic tac toe in vc++ peyman13618 14-Jan-06 10:13
 Re: help tic tac toe in vc++ Christian Graus 17-May-07 12:05
 2 and 3 Dimensions? Anonymous 21-Apr-04 7:46
 Re: 2 and 3 Dimensions? Jeff Arrington 21-Apr-04 8:10
 basically it is a game with regular 3X3 matrix tic tac toe it also has a version that is a 3X3X3 matrix same rules just added another level of dimention. Is this what you were asking for?   Jeff Arrington
 Re: 2 and 3 Dimensions? Anonymous 18-Aug-05 19:44
 Last Visit: 31-Dec-99 18:00     Last Update: 9-Mar-14 22:24 Refresh 1