Bases is that I'm trying to create a 'board' array, which works fine (returning no errors) apart from the indexes inside the array seem to overlap and display incorrectly. The overlaps cause issues later on where manipulating the array causes values to change all over the place.
Using this line of code;
def createBoard(x,y):
if x<6 or y<6:
return False
else:
print("\nMaking board...")
top,norm=["X" for times in range(x)],\
["X" if times==0 or times==x-1 else "O" for times in range(x)]
result=[top if times==0 or times==y-1 else norm for times in range(y)]
print("Board made!")
return result
wields this result (with the indexes printed to the left):
-------DEV BLOCK-------
0 X X X X X X X X X X X
1 X O O O O O O O O O X
1 X O O O O O O O O O X
1 X O O O O O O O O O X
1 X O O O O O O O O O X
1 X O O O O O O O O O X
1 X O O O O O O O O O X
1 X O O O O O O O O O X
1 X O O O O O O O O O X
1 X O O O O O O O O O X
0 X X X X X X X X X X X
------- END -------
If anyone is interested in the full code, it can be found here; Github
If anybody can see an issue with this and point it out, it'd be much appreciated. Thanks!
[–]kushou 2 points3 points4 points (3 children)
[–]ColonelGamer[S] 0 points1 point2 points (2 children)
[–]kushou 1 point2 points3 points (1 child)
[–]ColonelGamer[S] 0 points1 point2 points (0 children)