Skip to content

Commit

Permalink
re-adding PR checks, and fixing black/archives errors (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpetrucciani authored Oct 10, 2021
1 parent 6fa9d05 commit a700cf3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
---
name: test

on: [push]
on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
archives:
Expand Down
12 changes: 8 additions & 4 deletions gamble/models/cards.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,8 @@ class Ranks:
"""
@desc hand ranks for poker
"""
ROYAL_FLUSH = Rank(value=9, name='royal flush')

ROYAL_FLUSH = Rank(value=9, name="royal flush")
STRAIGHT_FLUSH = Rank(value=8, name="straight flush")
FOUR_OF_A_KIND = Rank(value=7, name="four of a kind")
FULL_HOUSE = Rank(value=6, name="full house")
Expand Down Expand Up @@ -351,7 +352,7 @@ def get(cls, text: str) -> "Hand":
@property
def rank(self) -> Rank:
"""
@cc 9
@cc 10
@desc get the rank of this hand
@ret a rank object representing the rank of this hand
"""
Expand Down Expand Up @@ -391,9 +392,12 @@ def is_royal_flush(self) -> bool:
@desc check if the hand is a royal flush
@ret true if royal flush
"""
return self.is_flush and self.is_straight \
and self.cards[0].value == Card.Values.ACE \
return (
self.is_flush
and self.is_straight
and self.cards[0].value == Card.Values.ACE
and self.cards[-1].value == Card.Values.KING
)

@property
def is_straight_flush(self) -> bool:
Expand Down

0 comments on commit a700cf3

Please sign in to comment.