Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Hacksaar
Haxotel
Commits
26b196bc
Commit
26b196bc
authored
Aug 01, 2014
by
Constantin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
initial treasure placement
parent
0e9065c0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
game.py
game.py
+4
-0
No files found.
game.py
View file @
26b196bc
...
...
@@ -3,6 +3,7 @@ import selectors
import
socket
import
labyrinth
import
random
import
treasure
class
Game
:
def
__init__
(
self
,
labyrinthFileName
,
adminPW
,
logFileName
=
None
,
port
=
1234
):
...
...
@@ -10,6 +11,9 @@ class Game:
self
.
admins
=
[]
with
open
(
labyrinthFileName
,
'r'
)
as
f
:
self
.
labyrinth
=
labyrinth
.
Labyrinth
(
game
=
self
,
stream
=
f
)
treasure
=
treasure
.
Treasure
()
ttile
=
random
.
choice
(
self
.
labyrinth
.
getFreeTiles
())
self
.
labyrinth
.
createThing
(
treasure
,
ttile
)
self
.
sock
=
socket
.
socket
()
self
.
sock
.
bind
((
'0.0.0.0'
,
port
))
self
.
sock
.
listen
(
100
)
...
...
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