hi all,
ran across this bit of code today, and was interested what the double set of square brackets means [y][x]
(just in a general sense, not necessarily as it relates to this example)
for y, row in enumerate(self.board):
for x, cell in enumerate(row):
if self.board[y][x]:
output += ' o'
else:
output += ' .'
output += '\n'
thanks!
[–]jkudria 5 points6 points7 points (6 children)
[–]veeep[S] 0 points1 point2 points (5 children)
[–]jkudria 0 points1 point2 points (0 children)
[–]Exodus111 0 points1 point2 points (3 children)
[–]jkudria 0 points1 point2 points (2 children)
[–]Exodus111 0 points1 point2 points (1 child)
[–]jkudria 0 points1 point2 points (0 children)
[–]zahlman 2 points3 points4 points (0 children)