MCPcopy Create free account
hub / github.com/geekcomputers/Python / _sum_up

Method _sum_up

BlackJack_game/blackjack_simulate.py:235–243  ·  view source on GitHub ↗
(ranks)

Source from the content-addressed store, hash-verified

233 return cook_ranks
234
235 def _sum_up(ranks):
236 rank_one = sum(ranks)
237 rank_eleven = sum([11 if rank == 1 else rank for rank in ranks])
238 # Over or has 2 Ace
239 if (ranks[::-1] == ranks) and (1 in ranks):
240 return 11 + len(ranks) - 1
241 if rank_eleven <= BLACK_JACK:
242 return rank_eleven
243 return rank_one
244
245 points = _extract_rank()
246 self.point = _sum_up(points)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected