Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Nick Kozisek
ants_vs_some_bees
Commits
998d9f5b
Commit
998d9f5b
authored
Mar 01, 2018
by
Brady James Garvin
Browse files
Fixed spacing in doctests.
parent
fb8526be
Changes
1
Hide whitespace changes
Inline
Side-by-side
ants_vs_some_bees.py
View file @
998d9f5b
...
...
@@ -224,30 +224,25 @@ class Bee(Insect):
_count_ants_in_tunnel will count the number of Ants in the tunnel
starting at the Place given. For an empty tunnel, it will return zero:
>>> Bee._count_ants_in_tunnel(a)
0
But for an occupied tunnel it will return a positive count:
>>> a.add_insect(Ant(None, 0))
>>> Bee._count_ants_in_tunnel(a)
1
And the count will include Ants anywhere in the tunnel:
>>> d.add_insect(Ant(None, 0))
>>> Bee._count_ants_in_tunnel(a)
2
Note however that Ants before the given Place are not counted, even if
the tunnel could have started earlier:
>>> Bee._count_ants_in_tunnel(b)
1
And that Ants past a branching point are not counted either:
>>> e0.add_insect(Ant(None, 0))
>>> Bee._count_ants_in_tunnel(a)
2
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment