Thread: Connect four game - Works and would like input

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Sep 2011
    Posts
    13

    Connect four game - Works and would like input

    This game was originally a Tictactoe game if you couldn't tell already.

    I know that there are things I could add to the game such as computer strategy instead of a random move, or perhaps a menu at the start. I posted this to get some input on what I have so far, so I just used the basics.

    If anyone wants to comment on programming style it would help a lot.

    * EDIT *

    The code is in the post below. When I edited the code it no longer formatted it correctly so I opened a new post to have the proper formatting.

    * EDIT *

    The game can be easily converted to a tictactoe style by changing these constructor values to:

    Code:
    xMax = 3;
    yMax = 3;
    rowSize = 3;
    droppieces = false;
    The board can be resized as seen above. You may play the computer, another human, or watch the computer play the computer. Up to 9 players can play in any human / computer configuration.

    For example, to have player 1 be human, player 2 be a computer, player 3 be human, and player 4 be a computer with player 3 starting:

    Code:
    numberPlayers = 4;      // how many players?
    player = 3;             // who starts?
    
    playerType[1] = 1;      // player # 1 is human
    playerType[2] = 0;      // player # 2 is computer
    playerType[3] = 1;      // player # 3 is human
    playerType[4] = 0;      // player # 4 is computer
    If you would like the computer to move for you press '-1', yes, it's a hack, but I just wanted to make sure it had that functionality for now.
    Last edited by simpleblue; 10-16-2011 at 07:18 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Connect four game help
    By kenneth_888 in forum C++ Programming
    Replies: 2
    Last Post: 05-28-2007, 08:42 AM
  2. New Connect Four Game
    By PJYelton in forum Game Programming
    Replies: 4
    Last Post: 01-17-2003, 10:13 AM
  3. Connect 4 game
    By sundeeptuteja in forum Game Programming
    Replies: 6
    Last Post: 08-12-2002, 11:09 PM
  4. Advanced connect four game
    By Ion Blade in forum C++ Programming
    Replies: 10
    Last Post: 07-28-2002, 07:52 AM
  5. Connect Four game...need help
    By Ion Blade in forum C++ Programming
    Replies: 2
    Last Post: 06-18-2002, 06:18 PM