(aGrid, nX, nY, n)
| 123 | # A dictionary would be more efficient, but it seems to work O.K. |
| 124 | |
| 125 | def Load(aGrid, nX, nY, n): |
| 126 | |
| 127 | # changes value if not set, or else it returns the value |
| 128 | |
| 129 | if aGrid[nX][nY] == -1: |
| 130 | |
| 131 | aGrid[nX][nY] = n |
| 132 | |
| 133 | return n |
| 134 | |
| 135 | return aGrid[nX][nY] |
| 136 | |
| 137 | |
| 138 |