add more code for 54 (WIP)
This commit is contained in:
+17
-2
@@ -1,5 +1,4 @@
|
||||
#![allow(dead_code, unused_imports)]
|
||||
|
||||
use std::{
|
||||
cmp::max,
|
||||
collections::{HashMap, HashSet},
|
||||
@@ -73,6 +72,22 @@ enum Value {
|
||||
Ace,
|
||||
}
|
||||
|
||||
const VALUES: [Value; 13] = [
|
||||
Value::Two,
|
||||
Value::Three,
|
||||
Value::Four,
|
||||
Value::Five,
|
||||
Value::Six,
|
||||
Value::Seven,
|
||||
Value::Eight,
|
||||
Value::Nine,
|
||||
Value::Ten,
|
||||
Value::Jack,
|
||||
Value::Queen,
|
||||
Value::King,
|
||||
Value::Ace,
|
||||
];
|
||||
|
||||
impl Value {
|
||||
fn from_char(c: char) -> Self {
|
||||
match c {
|
||||
@@ -185,7 +200,7 @@ impl CardTrait for Cards {
|
||||
}
|
||||
|
||||
fn have_consecutive_values(&self) -> bool {
|
||||
self[0].value + 1
|
||||
VALUES.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user