Remove debugging print and improve style

This commit is contained in:
Nguyễn Gia Phong 2019-10-13 17:45:44 +07:00
parent 7d346a219a
commit e2149b18c2
3 changed files with 5 additions and 8 deletions

View File

@ -17,7 +17,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with Brutal Maze. If not, see <https://www.gnu.org/licenses/>.
__version__ = '0.8.27'
__version__ = '0.8.28'
import re
from argparse import ArgumentParser, FileType, RawTextHelpFormatter

View File

@ -139,9 +139,8 @@ class Maze:
room, visited = [(MIDDLE, MIDDLE)], set()
while room:
bit = room.pop()
print(bit)
if not self.isdisplayed(*bit): break
if bit not in visited:
if not self.isdisplayed(*bit): break
visited.add(bit)
for x, y in around(*bit):
if self.map[x][y] == EMPTY: room.append((x, y))
@ -480,10 +479,8 @@ class Maze:
queue, visited = deque([(self.destx, self.desty)]), set()
while queue:
x, y = queue.pop()
if (x, y) not in visited:
visited.add((x, y))
else:
continue
if (x, y) in visited: continue
visited.add((x, y))
dx, dy = MIDDLE - x, MIDDLE - y
if dx**2 + dy**2 <= 2:
# Succeeded on finding a path

View File

@ -7,7 +7,7 @@ with open('README.rst') as f:
setup(
name='brutalmaze',
version='0.8.27',
version='0.8.28',
description="Minimalist thrilling shoot 'em up game",
long_description=long_description,
url='https://github.com/McSinyx/brutalmaze',