Dec-31-2017, 05:23 PM
row6="| | | | | | | |" row5="| | | | | | | |" row4="| | | | | | | |" row3="| | | | | | | |" row2="| | | | | | | |" row1="| | | | | | | |" dboard=[row6,row5,row4,row3,row2,row1] l="-----------------------------" def drawboard(): print("| 1 | 2 | 3 | 4 | 5 | 6 | 7 |") print(l) for x in dboard: print(x) print(l) def columncheck(c): x=5 pos=False while pos != True: if dboard[x][(4*c)-1]== " ": pos=True elif dboard[x][(4*c)-1] != " ": x-=1 return xThat is my part of my code. It will be a connect 4 game, the function should check if the most bottom row full. Hopefully that adds some context. The problem is that no matter what, the function columncheck©, will ALWAYS return five, whether the position is taken or not.