Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Hacksaar
Haxotel
Commits
0d8cfd1a
Commit
0d8cfd1a
authored
Jul 31, 2014
by
Constantin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor typos
parent
220b7e3e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
labyrinth.py
labyrinth.py
+4
-4
No files found.
labyrinth.py
View file @
0d8cfd1a
...
...
@@ -39,7 +39,7 @@ class Labyrinth:
if
width
is
not
None
:
# empty labyrinth of given size
assert
height
is
not
None
assert
stream
is
None
self
.
tiles
=
[[
Labyrinth
.
Field
(
GroundType
.
FLOOR
,
col
,
row
,
self
)
for
col
in
range
(
width
)]
for
row
in
range
(
height
)]
self
.
tiles
=
[[
Labyrinth
.
Field
(
Labyrinth
.
GroundType
.
FLOOR
,
col
,
row
,
self
)
for
col
in
range
(
width
)]
for
row
in
range
(
height
)]
elif
height
is
not
None
:
assert
False
# width None, height not
elif
stream
is
not
None
:
...
...
@@ -51,10 +51,10 @@ class Labyrinth:
for
rownum
,
line
in
enumerate
(
stream
):
row
=
[]
for
colnum
,
char
in
enumerate
(
line
):
if
char
in
[
' '
,
'0'
]:
row
.
append
(
Labyrinth
.
Field
(
GroundType
.
FLOOR
,
colnum
,
rownum
,
self
))
if
char
in
[
' '
,
'0'
,
'_'
]:
row
.
append
(
Labyrinth
.
Field
(
Labyrinth
.
GroundType
.
FLOOR
,
colnum
,
rownum
,
self
))
elif
char
in
[
'W'
,
'w'
,
'#'
,
'1'
]:
row
.
append
(
Labyrinth
.
Field
(
GroundType
.
WALL
,
colnum
,
rownum
,
self
))
row
.
append
(
Labyrinth
.
Field
(
Labyrinth
.
GroundType
.
WALL
,
colnum
,
rownum
,
self
))
tiles
.
append
(
row
)
return
tiles
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment