Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pingouins
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Felton Samuel
pingouins
Commits
c4fb6ead
Commit
c4fb6ead
authored
9 years ago
by
Bariatti Francesco
Browse files
Options
Downloads
Patches
Plain Diff
drawState main loop executed only when executed as a program
parent
592340da
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/drawState.py
+20
-19
20 additions, 19 deletions
tools/drawState.py
with
20 additions
and
19 deletions
tools/drawState.py
+
20
−
19
View file @
c4fb6ead
...
...
@@ -34,24 +34,25 @@ def drawPenguin(penguin):
}
print
(
"
Pos: {pos}, A:{A}, B:{B}, C:{C}, D:{D}, E:{E}, F:{F}, Tot: {tot}
"
.
format
(
**
args
))
try
:
while
True
:
read
=
[]
print
(
"
Enter state:
"
)
if
__name__
==
"
__main__
"
:
try
:
while
True
:
line
=
input
()
if
line
==
""
:
break
read
.
append
(
line
)
read
=
[]
print
(
"
Enter state:
"
)
while
True
:
line
=
input
()
if
line
==
""
:
break
read
.
append
(
line
)
state
=
json
.
loads
(
''
.
join
(
read
))
drawBitboard
(
state
[
"
bitboards
"
][
"
onefish
"
],
state
[
"
bitboards
"
][
"
twofish
"
],
state
[
"
bitboards
"
][
"
threefish
"
])
print
(
"
Red penguins
"
)
for
i
in
range
(
4
):
drawPenguin
(
state
[
"
penguins
"
][
"
red
"
][
i
])
print
(
"
Blue penguins
"
)
for
i
in
range
(
4
):
drawPenguin
(
state
[
"
penguins
"
][
"
blue
"
][
i
])
state
=
json
.
loads
(
''
.
join
(
read
))
drawBitboard
(
state
[
"
bitboards
"
][
"
onefish
"
],
state
[
"
bitboards
"
][
"
twofish
"
],
state
[
"
bitboards
"
][
"
threefish
"
])
print
(
"
Red penguins
"
)
for
i
in
range
(
4
):
drawPenguin
(
state
[
"
penguins
"
][
"
red
"
][
i
])
print
(
"
Blue penguins
"
)
for
i
in
range
(
4
):
drawPenguin
(
state
[
"
penguins
"
][
"
blue
"
][
i
])
except
KeyboardInterrupt
:
print
(
"
\n
May the fish be with you.
"
)
except
KeyboardInterrupt
:
print
(
"
\n
May the fish be with you.
"
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment