Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wwwanlingxiao
system-design-primer
Commits
b156e48e
Commit
b156e48e
authored
Mar 18, 2018
by
cclauss
Committed by
Donne Martin
Mar 18, 2018
Browse files
Add missing self variables to Deck of Cards solution (#145)
parent
01789430
Changes
1
Hide whitespace changes
Inline
Side-by-side
solutions/object_oriented_design/deck_of_cards/deck_of_cards.py
View file @
b156e48e
...
...
@@ -68,7 +68,7 @@ class Hand(object):
def
score
(
self
):
total_value
=
0
for
card
in
card
:
for
card
in
self
.
card
s
:
total_value
+=
card
.
value
return
total_value
...
...
@@ -102,9 +102,9 @@ class Deck(object):
self
.
deal_index
=
0
def
remaining_cards
(
self
):
return
len
(
self
.
cards
)
-
deal_index
return
len
(
self
.
cards
)
-
self
.
deal_index
def
deal_card
():
def
deal_card
(
self
):
try
:
card
=
self
.
cards
[
self
.
deal_index
]
card
.
is_available
=
False
...
...
Write
Preview
Supports
Markdown
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