Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Cells:
- def __init__(self):
- self.cells = {}
- def setItem(self, r, c, value):
- if r not in self.cells:
- self.cells[r] = {}
- self.cells[r][c] = value
- def getItem(self, r, c):
- if r not in self.cells:
- return None
- if c not in self.cells[r]:
- return None
- return self.cells[r][c]
- def getNumber(self, r, c):
- v = self.getItem(r, c)
- if v is None:
- return 0
- return v
- def getCells(self):
- return self.cells
- def setItemErrors(self, r, c, step, value):
- if r not in self.cells:
- self.cells[r] = {}
- if c not in self.cells[r]:
- self.cells[r][c] = {}
- self.cells[r][c][step] = value
- def getItemErrors(self, r, c, step):
- if r not in self.cells:
- return None
- if c not in self.cells[r]:
- return None
- if step not in self.cells[r][c]:
- return None
- return self.cells[r][c][step]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement