This commit is contained in:
2024-04-19 20:04:58 -04:00
parent ca47f2df2b
commit 6ab8839d6c
6 changed files with 186 additions and 6 deletions

View File

@@ -16,7 +16,7 @@ pub enum HandType {
}
#[derive(PartialEq)]
struct PokerHand {
pub struct PokerHand {
cards: Vec<PlayingCard>,
}
@@ -143,7 +143,7 @@ impl PartialOrd for PokerHand {
}
impl PokerHand {
fn new(mut cards: Vec<PlayingCard>) -> Self {
pub fn new(mut cards: Vec<PlayingCard>) -> Self {
assert!(cards.len() == 5);
// Sorted highest card first
@@ -172,7 +172,7 @@ impl PokerHand {
count
}
fn hand_type(&self) -> HandType {
pub fn hand_type(&self) -> HandType {
if is_straight_flush(self) {
return HandType::StraightFlush;
}