Check win function diagonal for connect 4 is not working
<p>Hey guys I wrote a connect four program in C++ but Im having trouble figuring out the issue with my algorithm for finding out the winning move diagonally. Here is the code that I wrote: My horizontal and vertical functions work though</p>

<pre><code>//checks for a horizontal win
    //returns 1 if there's a win
    for(int i=0;i&lt;numrows;i++)
        for(int j=0;j&lt;rowsize-3;j++)
            if(board[i][j]!=" " &amp;&amp; board[i][j]==board[i][j+1] &amp;&amp; board[i][j]==board[i][j+2] &amp;&amp; board[i][j]==board[i][j+3])
                return 1;

    //checks for a vertical win
    //returns one if theres a win
    for(int i=0;i&lt;numrows-3;i++)
        for(int j=0;j&lt;rowsize;j++)
            if(board[i][j] !=" " &amp;&amp; board[i][j]==board[i+1][j] &amp;&amp; board[i][j]==board[i+2][j] &amp;&amp; board[i][j]==board[i+3][j])
                return 1;  



    int numrows=6;
    int rowsize=7;

//checks the right side of a diagonal for a  win
    for(int i=0;i&lt;numrows;i++)
        for(int j=0;j&lt;rowsize;j++)
            if(board[i][j] !=" " &amp;&amp; board[i][j]==board[i+1][j+1] &amp;&amp; board[i][j]==board[i+2][j+2] &amp;&amp; board[i][j]==board[i+3][j+3])
                return 1;


    //checks left diagonal win for a win
    for(int i=0;i&lt;numrows;i++)
        for(int j=0;j&lt;rowsize;j++)
            if(board[i][j] !=" " &amp;&amp; board[i][j]==board[i+1][j-1] &amp;&amp; board[i][j]==board[i+2][j-2] &amp;&amp; board[i][j]==board[i+3][j-3])
            return 1;

//creates a typical 7 by 6 connect four board
    for (int i=0;i&lt;numrows; i++){
        vector&lt;string&gt; row;

        for (int j=0;j&lt;rowsize; j++)
            row.push_back(" ");
        board.push_back(row);
    }
</code></pre>