Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions code/dlgo/goboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,7 @@ def get_go_string(self, point):
Returns None if the point is empty, or a GoString if there is
a stone on that point.
"""
string = self._grid.get(point)
if string is None:
return None
return string
return self._grid.get(point)

def __eq__(self, other):
return isinstance(other, Board) and \
Expand Down
5 changes: 1 addition & 4 deletions code/dlgo/goboard_fast.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,7 @@ def get_go_string(self, point):
Returns None if the point is empty, or a GoString if there is
a stone on that point.
"""
string = self._grid.get(point)
if string is None:
return None
return string
return self._grid.get(point)

def __eq__(self, other):
return isinstance(other, Board) and \
Expand Down
5 changes: 1 addition & 4 deletions code/dlgo/goboard_slow.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,7 @@ def get(self, point): # <1>
return string.color

def get_go_string(self, point): # <2>
string = self._grid.get(point)
if string is None:
return None
return string
return self._grid.get(point)
# <1> Returns the content of a point on the board: a Player if there is a stone on that point or else None.
# <2> Returns the entire string of stones at a point: a GoString if there is a stone on that point or else None.
# end::board_utils[]
Expand Down