From 85132d3c59616479c2287206cd32552353d7b207 Mon Sep 17 00:00:00 2001 From: Rhys Lloyd Date: Mon, 18 May 2026 11:36:15 -0700 Subject: [PATCH] kiki doesn't make sense --- card_game/src/lib.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/card_game/src/lib.rs b/card_game/src/lib.rs index a4f809c..8f4eab3 100644 --- a/card_game/src/lib.rs +++ b/card_game/src/lib.rs @@ -60,8 +60,8 @@ impl Suit { pub const fn is_red(self) -> bool { self as u8 & 0b01 != 0 } - /// Is the suit shape spikey. (Bouba/kiki) - pub const fn is_kiki(self) -> bool { + /// Suit value is 2 bits, is_red is the low bit. + pub const fn suit_high_bit(self) -> bool { self as u8 & 0b10 != 0 } } @@ -146,9 +146,9 @@ impl Card { Rank::new(masked).unwrap() } pub const fn suit(&self) -> Suit { - let red = self.is_red(); - let kiki = self.is_kiki(); - match (kiki, red) { + let low_bit = self.is_red(); + let high_bit = self.suit_high_bit(); + match (high_bit, low_bit) { (false, false) => Suit::Spades, (false, true) => Suit::Hearts, (true, false) => Suit::Clubs, @@ -159,8 +159,8 @@ impl Card { pub const fn is_red(&self) -> bool { self.0.get() & 0b010000 != 0 } - /// Is the suit shape spikey. (Bouba/kiki) - pub const fn is_kiki(&self) -> bool { + /// Suit value is 2 bits, is_red is the low bit. + pub const fn suit_high_bit(&self) -> bool { self.0.get() & 0b100000 != 0 } pub const fn deck(&self) -> Deck {