It keeps giving me this elif syntax error in line 103 and I have NO idea where it's coming from. UGH!!!
#!/usr/bin/python
import os.path
#nxn board, in this case n = 10
n = 10
#will hold the positions similar to n-queens
allPositions = []
#current state of board used for comparisons
state = []
#defining captured and inaRow
blackPairCap = 0
whitePairCap = 0
blackInaRow = 0
whiteInaRow = 0
#the initial state of the board is all blank
#im storing each row of the board as a list
#this is pretty much only for displaying the board
row0 = []
row1 = []
row2 = []
row3 = []
row4 = []
row5 = []
row6 = []
row7 = []
row8 = []
row9 = []
#similar to the n-queens problem,
#i'll make an allDirections list so i can test later for things such as
#if it's next to another piece of itself or the opponent
allDirections = [[-1, 0],[1, 0],[0, -1],[0, 1],[-1, -1],[-1, 1],[1, -1],[1, 1]]
#creating all rules without precond or anything
def createPositions():
for i in range(0,n):
for j in range(0,n):
allPositions.append([i,j])
#winner
def winner():
if (blackPairCap == 5):
print "White is the winner!"
return True
elif (whitePairCap == 5):
print "Black is the winner!"
return True
elif (blackInaRow >= 5):
print "Black is the winner!"
return True
elif (whiteInaRow >= 5):
print "White is the winner!"
return True
else:
inGameMenu()
#for next function
player1 = ""
player2 = ""
comp1 = ""
comp2 = ""
#current players
currentPlayers = []
#save files list
FILES = []
#startGameMenu
def startGameMenu():
print "Do you have a save file that you would like to run the game from?\n"
saveFile = raw_input("y or n")
saveFile = str(saveFile)
if saveFile == "y":
fileName = raw_input("What is the name of the save file (with extension)? \n")
FILES.append(fileName)
f = open(fileName, 'r')
for line in f:
if line == 0:
row0.extend([line[0],line[1],line[2],line[3],line[4],line[5],line[6],line[7],line[8],line[9]])
if line == 1:
row0.extend([line[0],line[1],line[2],line[3],line[4],line[5],line[6],line[7],line[8],line[9]])
if line == 2:
row0.extend([line[0],line[1],line[2],line[3],line[4],line[5],line[6],line[7],line[8],line[9]])
if line == 3:
row0.extend([line[0],line[1],line[2],line[3],line[4],line[5],line[6],line[7],line[8],line[9]])
if line == 4:
row0.extend([line[0],line[1],line[2],line[3],line[4],line[5],line[6],line[7],line[8],line[9]])
if line == 5:
row0.extend([line[0],line[1],line[2],line[3],line[4],line[5],line[6],line[7],line[8],line[9]])
if line == 6:
row0.extend([line[0],line[1],line[2],line[3],line[4],line[5],line[6],line[7],line[8],line[9]])
if line == 7:
row0.extend([line[0],line[1],line[2],line[3],line[4],line[5],line[6],line[7],line[8],line[9]])
if line == 8:
row0.extend([line[0],line[1],line[2],line[3],line[4],line[5],line[6],line[7],line[8],line[9]])
if line == 9:
row0.extend([line[0],line[1],line[2],line[3],line[4],line[5],line[6],line[7],line[8],line[9]])
f.close()
inGameMenu()
elif saveFile == "n":
print "Welcome to Pente!\n"
print "Would you like to play a new game?\n"
answer = raw_input("y or n:")
answer = str(answer)
if (answer == "y"):
numPlayers = raw_input("How many players are going to be playing? (1-4):\n")
numPlayers = int(numPlayers)
for p in range(0,numPlayers):
print "Would you like to be Player 1, Player 2, PC 1, or PC 2?\n"
player = raw_input("p1, p2, pc1, or pc2:")
player = str(player)
if (player == "p1"):
currentPlayers.append(player1)
elif (player == "p2"):
currentPlayers.append(player2)
elif (player == "pc1"):
currentPlayers.append(comp1)
elif (player == "pc2"):
currentPlayers.append(comp2)
print "Which color would you like to play as?\n"
color = raw_input("b (black) or w (white):")
color = str(color)
if (color == "b"):
currentPlayers[p] = "black"
elif (color == "w"):
currentPlayers[p] = "white"
inGameMenu()
#defining players and their colors
#inGameMenu
def inGameMenu():
return
#inGameMenu from save file
def saveFileGame():
return
#startGameMenu()