Skip to content

Commit

Permalink
✏️ Typo
Browse files Browse the repository at this point in the history
  • Loading branch information
bal7hazar committed Jan 3, 2024
1 parent c59ff25 commit a552424
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/src/random/deck.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ struct Deck {

/// Errors module.
mod errors {
const NO_CARD_LEFT: felt252 = 'Deck: no card left';
const TOO_MUCH_CARD: felt252 = 'Deck: too much cards';
const NO_CARDS_LEFT: felt252 = 'Deck: no cards left';
const TOO_MANY_CARDS: felt252 = 'Deck: too many cards';
}

/// Trait to initialize, draw and discard a card from the Deck.
Expand Down Expand Up @@ -79,7 +79,7 @@ impl DeckImpl of DeckTrait {
}

fn from_bitmap(seed: felt252, number: u32, mut bitmap: u128) -> Deck {
assert(number <= 128, errors::TOO_MUCH_CARD);
assert(number <= 128, errors::TOO_MANY_CARDS);
let mut deck = DeckTrait::new(seed, number);
let mut card: u8 = 1;
loop {
Expand All @@ -98,7 +98,7 @@ impl DeckImpl of DeckTrait {
#[inline(always)]
fn draw(ref self: Deck) -> u8 {
// [Check] Enough cards left.
assert(self.remaining > 0, errors::NO_CARD_LEFT);
assert(self.remaining > 0, errors::NO_CARDS_LEFT);
// [Compute] Draw a random card from remainingcs cards.
let mut state = PoseidonTrait::new();
state = state.update(self.seed);
Expand Down

0 comments on commit a552424

Please sign in to comment.