Add some doc strings
This commit is contained in:
parent
fb1066f716
commit
a0594d1561
1 changed files with 11 additions and 2 deletions
13
sudoku.py
13
sudoku.py
|
@ -18,14 +18,23 @@ class Sudoku:
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def size(self):
|
def size(self):
|
||||||
|
'''
|
||||||
|
The size of the board. This dictates the length of one side of the boxes that the board is subdivided into.
|
||||||
|
'''
|
||||||
return self._size
|
return self._size
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def row_size(self):
|
def row_size(self):
|
||||||
|
'''
|
||||||
|
The length of a row or column, or the area of a box in the grid.
|
||||||
|
'''
|
||||||
return self.size ** 2
|
return self.size ** 2
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def grid_size(self):
|
def grid_size(self):
|
||||||
|
'''
|
||||||
|
The total number of squares in the grid.
|
||||||
|
'''
|
||||||
return self.size ** 4
|
return self.size ** 4
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -38,8 +47,8 @@ class Sudoku:
|
||||||
@property
|
@property
|
||||||
def possible_values(self):
|
def possible_values(self):
|
||||||
'''
|
'''
|
||||||
The set of valid values for any grid square, not accounting for values made invalid by already being
|
The set of valid values for any grid square. This method does not account for values made invalid by already
|
||||||
present in a peer of that square.
|
being present in a peer of a given square.
|
||||||
'''
|
'''
|
||||||
return set(range(1, self.row_size + 1))
|
return set(range(1, self.row_size + 1))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue