Thread: tic tac toe (arggg, I really need help!)

  1. #1
    Unregistered Leeman_s's Avatar
    Join Date
    Oct 2001

    tic tac toe (arggg, I really need help!)

    Ok, im trying to just write a simple program to make a tic tac toe game. Ok, I think i need to use arrays and the like. I'm totally confused on how to start, all i have is a big mess. Here is what I have so far, and there are tons of errors:

    #include <iostream.h>
    #include <conio.h>
    #include <windows.h>
    #include <stdlib.h>
    #include <stdio.h>
    #include <math.h>
    #include <iomanip.h>
    #include <string>
    #include <fstream.h>

    int main() //Line 10
    char marker[10];
    int array[3][3];
    int array1[10];
    int move1[10];
    int move2[10];

    cout<<"1 2 3"<<endl;
    cout<<"4 5 6"<<endl;
    cout<<"7 8 9"<<endl;

    int *ptr1;
    int *ptr2;

    int x=1;
    cout<<"Where do you want to move? "; //Line 20
    return 0;

    Alright, will someone please tell me if im even close to the right kind of idea? Also, since i know im wrong, how would i go about doing a tic tac toe game? ANY HELP WILL HELP ME!!!

  2. #2
    Registered User
    Join Date
    Aug 2001
    In such a simple program you shouldnt even worry about pointers.

    You dont need all those headers.
    iostream is the only one you are useing.

    And use x++; instead of x=x+1;

    But all in all you look like you are on the right track.

  3. #3
    Join Date
    Aug 2001
    Your probably best storing the board in
    a 2D array

    char board[3][3];

    You can then write some short functions to draw
    the board, check for winer, make a move etc.

  4. #4
    Registered User
    Join Date
    Oct 2001
    Here is an example of Tic Tac Toe game:
    Ilia Yordanov, ; C++ Resources

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help me with my simple Tic tac toe prog
    By maybnxtseasn in forum C Programming
    Replies: 2
    Last Post: 04-04-2009, 06:25 PM
  2. tic tac toe crashes :(
    By stien in forum Game Programming
    Replies: 4
    Last Post: 05-13-2007, 06:25 PM
  3. tic tac toe
    By holden in forum A Brief History of
    Replies: 8
    Last Post: 05-09-2004, 09:59 AM
  4. Help with Tic Tac Toe game
    By snef73 in forum C++ Programming
    Replies: 1
    Last Post: 04-25-2003, 08:33 AM
  5. tic tac toe (arggg, I really need help!)
    By Leeman_s in forum C++ Programming
    Replies: 1
    Last Post: 10-11-2001, 12:10 PM