simple python connect 4 game. why doesnt this test work?
<p>Everything about this code seems to work perfectly, except the tests for diagonal wins. The tests for vertical and horizontal wins seem to be exactly the same concept, and they work perfectly. </p>

<p>The comments should mostly explain it, but the test should basically iterate through the board and check for x's in the bottom left hand corner (the only place that a right facing diagonal can start). it then goes up and to the right one space four times to check for a four in a row.</p>

<p>Here is the function in question.</p>

<pre><code>#for diagonal
#not working! WHYYYY
def winnertest3():
    for i in range(3):
        for e in range(4):
            print i,e
            if board[i][e]=='X' and board[i+1][e+1]=='X' and board[i+2][e+2]=='X' and board[i+3][e+3]=='X':
                print "X wins!!!!"
                return 'over'
    return 'on'
</code></pre>

<p><a href="http://github.com/keevie/Computer-Science/blob/master//board1.py" rel="nofollow">http://github.com/keevie/Computer-Science/blob/master//board1.py</a></p>
