
Code: Alles auswählen
def px(matrix, x, y):
paint_mapping = {0: paint_black, 1: paint_white}
for x, row in enumerate(matrix):
for y, bcolor in enumerate(row):
print(bcolor, x, y)
px(matrix, 25, 25)
1 0 0
0 0 1
1 0 2
0 0 3
1 1 0
0 1 1
0 1 2
1 1 3
def px(matrix, x, y):
paint_mapping = {0: paint_black, 1: paint_white}
for x, row in enumerate(matrix):
for y, bcolor in enumerate(row):
print(bcolor)
px(matrix, 10, 10)
1
0
1
0
1
0
0
1
for x, row in enumerate(matrix):
print(row)
[1, 0, 1, 0]
[1, 0, 0, 1]