im trying to make a connect four program built for two players and i cant seem get it

This is a discussion on im trying to make a connect four program built for two players and i cant seem get it within the C Programming forums, part of the General Programming Boards category; Code: #include <stdio.h> #include <math.h> int main(void) { int player1, player2; double count; { printf ("Welcome To Connect Four\n"); } ...

  1. #1
    Registered User
    Join Date
    Nov 2012
    Posts
    9

    im trying to make a connect four program built for two players and i cant seem get it

    Code:
    #include <stdio.h>
    #include <math.h>
    int main(void)
    {
     int player1, player2; 
     double count;
     {
      printf ("Welcome To Connect Four\n");
     }
     count = 0;
     while (count < 6)
     {
      printf ("+---+---+---+---+---+---+---+\n|   |   |   |   |   |   |   |\n");
      count = count + 1;
     }
     printf ("+-1-+-2-+-3-+-4-+-5-+-6-+-7-+\n");
      
     printf ("Enter Name of Player 1:");
     scanf ("%d", &player1);
     printf ("Enter Name of Player 2:");
     scanf ("%d", &player2);
     printf ("Welcome %d and %d.\n"), player1, player2;
    }

  2. #2
    SAMARAS std10093's Avatar
    Join Date
    Jan 2011
    Location
    Nice, France
    Posts
    2,681
    C post in C++ thread.

    Also mind that you did not explain why you are not happy with your code.
    Code - functions and small libraries I use


    It’s 2014 and I still use printf() for debugging.


    "Programs must be written for people to read, and only incidentally for machines to execute. " —Harold Abelson

  3. #3
    Registered User
    Join Date
    Nov 2012
    Posts
    9
    sorry :/ well when i put in the name i can only put numbers in and i cant even put anything for the second player.

  4. #4
    Registered User
    Join Date
    Jun 2011
    Posts
    2,370
    You've literally made no progress on this code since the last time you posted it.
    Also, please make sure your code is indented properly.
    Read this, too: How To Ask Questions The Smart Way

  5. #5
    Registered User
    Join Date
    Jun 2011
    Posts
    2,370
    Quote Originally Posted by EarthDevistator View Post
    sorry :/ well when i put in the name i can only put numbers in and i cant even put anything for the second player.
    You have been given advice on this in post #4 of your previous post (see link above).

  6. #6
    Registered User
    Join Date
    Mar 2012
    Posts
    110
    I don't get it, is it supposed to be four in a row? If so you need to store the board in some data structure.

  7. #7
    Registered User
    Join Date
    Nov 2012
    Posts
    9
    forgot about the other post lol sorry.

  8. #8
    Registered User
    Join Date
    Jun 2011
    Posts
    2,370
    Maybe the moderators will merge the threads.

  9. #9
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,304
    From the look of what you have so far one could easily conclude that you have no experience with functions, arrays, if statements, or just about any of the other stuff that is needed in anything beyond a hello world program. Everything you have so far could be learnt in about your first hour of learning to program.

    Please post something that demonstrates you have somewhere near the knowledge required to make this program. If not, then I'm afraid that this is a bit much to ask, and you really need to start off with something simpler and learn the concepts first.
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to connect a C program to Oracle Database?
    By Cnewbi in forum C Programming
    Replies: 4
    Last Post: 01-06-2012, 08:15 AM
  2. how to connect a c program with a website?
    By danishzaidi in forum C Programming
    Replies: 7
    Last Post: 12-17-2011, 07:56 AM
  3. (C++) Winsock connect and listen program. Need Help!
    By azjherben in forum Networking/Device Communication
    Replies: 2
    Last Post: 04-05-2009, 07:44 PM
  4. Replies: 1
    Last Post: 10-13-2004, 12:15 PM
  5. Replies: 2
    Last Post: 03-25-2002, 04:49 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21