Hi everyone,

I'm a college student who is new to this forum. I have an assignment to create a connect four game which I have basically finished, but I can not figure out how to lock the column on the game after it is full. I have been trying for hours and I do not want to give up on it. The code for the game is below, and it runs great except for that one bug. Does anyone on here have any suggestions? Please do not give me code as I feel that that would be dishonest on the assignment, but I am hoping that someone could give me an idea of what to do.

Thanks in advance,
Nick

//Still need to add rule so column is locked once there are 7 items in it.
Code:
using System;
using System.Collections.Generic;
namespace IntroCS
{
    public class connectFour
    {
        public static int[,] board = new int[7, 7];
        // 2 dimensional array for the board
        public static int moves = 0;
        //Move counter  Will only allow for up to 49 moves
        public static bool p1win = false;
        public static bool p2win = false;
        //When these are true, the game will end
        public static int p1move;
        public static int p2move;
        public static String input = null;
        public static bool placed = false;
        public static String printBoard(int[,] theBoard)
        {
            String board = null;
            for (int x = 0; x < 7; x++)
            {
                for (int y = 0; y < 7; y++)
                {
                    if (theBoard[x, y] == 0)
                        board = board + "_ ";
                    else if (theBoard[x, y] == 1)
                        board = board + "o ";
                    else if (theBoard[x, y] == 2)
                        board = board + "x ";
                }
                board = board + "\n";
            }
            return board;
        }

        static void Main()
        {
            for (int x = 0; x < 7; x++)
            {
                for (int y = 0; y < 7; y++)
                {
                    board[x, y] = 0;
                }
            }

            Console.WriteLine(printBoard(board));
            Console.WriteLine("1 2 3 4 5 6 7");
            Console.WriteLine("Welcome to Connect Four!");
            while (moves < 49 && p1win == false && p2win == false)
            {
                
                    p1move = PromptIntInRange("Player One's move", 1, 7);
                    p1move = p1move - 1;
                    counter[p1move] = counter[p1move] + 1;
                    placed = false;
                
                for (int i = 6; placed == false && i >= 0; i--)
                {
                    if (board[i, p1move] == 0)
                    {
                        board[i, p1move] = 1;
                        placed = true;
                        printBoard(board);
                        moves++;
                        p1win = winCheck(board, p1move, i, 1);
                    }
                }
                if (!(moves == 49) && !(p1win == true))
                {
                    Console.WriteLine(printBoard(board));
                    Console.WriteLine("1 2 3 4 5 6 7");
                    p2move = PromptIntInRange("Player Two's move", 1, 7);
                    p2move = p2move - 1;
                    counter[p2move] = counter[p2move] + 1;
                    placed = false;
                    for (int i = 6; placed == false && i >= 0; i--)
                    {
                        if (board[i, p2move] == 0)
                        {
                            board[i, p2move] = 2;
                            placed = true;
                            Console.WriteLine(printBoard(board));
                            Console.WriteLine("1 2 3 4 5 6 7");
                            moves++;
                            p2win = winCheck(board, p2move, i, 2);
                        }
                    }
                }
            }
            if (p1win == true)
            {
                Console.WriteLine(printBoard(board));
                Console.WriteLine("1 2 3 4 5 6 7");
                Console.WriteLine("Player 1 wins");
            }
            else if (p2win == true)
            {
                Console.WriteLine(printBoard(board));
                Console.WriteLine("1 2 3 4 5 6 7");
                Console.WriteLine("Player 2 wins");
            }
            else if (p1win == false && p2win == false && moves == 49)
            {
                Console.WriteLine(printBoard(board));
                Console.WriteLine("1 2 3 4 5 6 7");
                Console.WriteLine("Draw, Game Over");
            }
        }
        public static bool winCheck(int[,] theBoard, int column, int row, int x)
        {
            bool win = false;
            if (row < 4)
            {
                if (theBoard[row + 3, column] == x && theBoard[row + 2, column] == x && theBoard[row + 1, column] == x && theBoard[row, column] == x)
                {
                    win = true;
                }
                if (row > 0)
                {
                    if (theBoard[row + 2, column] == x && theBoard[row + 1, column] == x && theBoard[row + 0, column] == x && theBoard[row - 1, column] == x)
                    {
                        win = true;
                    }
                }
                if (row > 1)
                {
                    if (theBoard[row + 1, column] == x && theBoard[row + 0, column] == x && theBoard[row - 1, column] == x && theBoard[row - 2, column] == x)
                    {
                        win = true;
                    }
                }
                if (row > 2)
                {
                    if (theBoard[row, column] == x && theBoard[row - 1, column] == x && theBoard[row - 2, column] == x && theBoard[row - 3, column] == x)
                    {
                        win = true;
                    }
                }
            }
            if (column < 4)
            {
                if (theBoard[row, column + 1] == x && theBoard[row, column + 2] == x && theBoard[row, column + 3] == x)
                {
                    win = true;
                }
            }
            if (column < 5 && column > 0)
            {
                if (theBoard[row, column - 1] == x && theBoard[row, column + 1] == x && theBoard[row, column + 2] == x)
                {
                    win = true;
                }
            }
            if (column > 1 && column < 6)
            {
                if (theBoard[row, column - 2] == x && theBoard[row, column - 1] == x && theBoard[row, column + 1] == x)
                {
                    win = true;
                }
            }
            if (column > 2)
            {
                if (theBoard[row, column - 3] == x && theBoard[row, column - 2] == x && theBoard[row, column - 1] == x)
                {
                    win = true;
                }
            }
            if (column > 2 && row < 4)
            {
                if (theBoard[row + 1, column - 1] == x && theBoard[row + 2, column - 2] == x && theBoard[row + 3, column - 3] == x)
                {
                    win = true;
                }
            }
            if (column < 4 && row > 2)
            {
                if (theBoard[row - 1, column + 1] == x && theBoard[row - 2, column + 2] == x && theBoard[row - 3, column + 3] == x)
                {
                    win = true;
                }
            }
            if (column < 6 && row > 0 && row < 5 && column > 1)
            {
                if (theBoard[row - 1, column + 1] == x && theBoard[row + 1, column - 1] == x && theBoard[row + 2, column - 2] == x)
                {
                    win = true;
                }
            }
            if (row < 6 && column > 0 && row > 1 && column < 5)
            {
                if (theBoard[row + 1, column - 1] == x && theBoard[row - 1, column + 1] == x && theBoard[row - 2, column + 2] == x)
                {
                    win = true;
                }
            }
            if (column < 4 && row < 4)
            {
                if (theBoard[row + 1, column + 1] == x && theBoard[row + 2, column + 2] == x && theBoard[row + 3, column + 3] == x)
                {
                    win = true;
                }
            }
            if (column > 2 && row > 2)
            {
                if (theBoard[row - 1, column - 1] == x && theBoard[row - 2, column - 2] == x && theBoard[row - 3, column - 3] == x)
                {
                    win = true;
                }
            }
            if (column > 0 && row > 0 && column < 5 && row < 5)
            {
                if (theBoard[row - 1, column - 1] == x && theBoard[row + 1, column + 1] == x && theBoard[row + 2, column + 2] == x)
                {
                    win = true;
                }
            }
            if (column > 1 && row > 1 && column < 6 && row < 6)
            {
                if (theBoard[row + 1, column + 1] == x && theBoard[row - 1, column - 1] == x && theBoard[row - 2, column - 2] == x)
                {
                    win = true;
                }
            }
            return win;
        }
        public static bool isRowFull(int count)
        {
            if (count == 7)
                return true;
            else
                return false;
        }
        public static int PromptIntInRange(string prompt, int lowLim, int highLim)
        {
            string longPrompt = string.Format("{0} ({1} through {2}) ",
                                              prompt, lowLim, highLim);
            int number = PromptInt(longPrompt);
            while (number < lowLim || number > highLim)
            {
                Console.WriteLine("{0} is out of range!", number);
                number = PromptInt(longPrompt);
            }
            return number;
        }
        public static int PromptInt(string prompt)
        {
            string nStr = PromptLine(prompt).Trim();
            while (!IsIntString(nStr))
            {
                Console.WriteLine("Bad int format!  Try again.");
                nStr = PromptLine(prompt).Trim();
            }
            return int.Parse(nStr);
        }
        public static bool IsIntString(string s)
        {
            if (s.StartsWith("-"))
            {
                s = s.Substring(1);
            }
            return IsDigits(s);
        }
        public static string PromptLine(string prompt)
        {
            Console.Write(prompt);
            return Console.ReadLine();
        }
        public static bool IsDigits(string s)
        {
            foreach (char ch in s)
            {
                if (ch < '0' || ch > '9')
                {
                    return false;
                }
            }
            return (s.Length > 0);
        }
    }


}