Home>
def drawBoard(board): # Draw the board data structure.
tensDigitsLine= ' ' #Create space for numbers down the left side of the field.
for i in range(1,6):
tensDigitsLine += (' ' * 9) + str(i)
#Display the numbers at the top of the field.
print(tensDigitsLine)
print(' '+('0123456789' * 6))
print()
#Display each of the 15 rows
for row in range(15):
if row< 10:
extraSpace= ' '
else:
extraSpace= ''
boardRow= ' '
for column in range(60):
boardRow += board[column][row]
-
Answer # 1
I don't know what kind of data you are passing to this function and what dimensions they are, but in this line you have one of the indexes that goes beyond the bounds of the array
boardRow += board[column][row]
, orcolumn
, orrow
, try to remove first one, then the other, and see which error occurs. -
Answer # 2
I don't know what kind of data you are passing to this function and what dimensions they are, but in this line you have one of the indexes that goes beyond the bounds of the array
boardRow += board[column][row]
, orcolumn
, orrow
, try to remove first one, then the other, and see which error occurs.
Related questions
- python : Pass one list to another list, then update the second list when the first one changes?
- Compare custom list and list of lists (comparing lists of different lengths) Python
- TypeError: 'list' object is not callable. Literally today I started learning Python and telebot API and I don’t understand what
- python : How to add an element from list 1 to a dictionary in list 2?
- python : Why does list.remove() incorrectly remove elements in a loop?
- python : Sending a file using telegramAPI
- Program for finding synonyms of Russian words python
- javascript : How to pass value of js variables to python(eel)?
- python : How to create a window in the game for example (dota2)
Do you understand the meaning of this error and why it occurs in your code?
MaxU2022-02-02 15:23:01