| 97 | |
| 98 | |
| 99 | def printField(field): |
| 100 | # Display the field data structure on the screen: |
| 101 | |
| 102 | # Display the x coordinates along the top: |
| 103 | print(' ', end='') |
| 104 | for i in range(WIDTH // 10): |
| 105 | print(str(i) + NINE_SPACES, end='') |
| 106 | print() |
| 107 | print(' ' + ('0123456789' * 10)[:WIDTH]) |
| 108 | |
| 109 | # Print the characters in the field: |
| 110 | for y in range(HEIGHT): |
| 111 | # Print each row, including the y coordinates on the left side: |
| 112 | print(str(y).rjust(2) + ' ', end='') |
| 113 | for x in range(WIDTH): |
| 114 | # Print each character: |
| 115 | print(field[(x, y)], end='') |
| 116 | print() # Print a newline at the end of the row. |
| 117 | |
| 118 | |
| 119 | print('''FLOODFILL |