Azzera filtri
Azzera filtri

How to change 10 cards to jack queen and king

1 visualizzazione (ultimi 30 giorni)
James Keiser
James Keiser il 16 Giu 2021
Commentato: David Hill il 16 Giu 2021
I am making a blackjack game that involves 2 decks. I need to assign the number one cards to Ace's and the 10's to jacks, queens and kings.
my code:
%Making the deck of cards
cardValues = [1:13, 1:13, 1:13, 1:13,1:13, 1:13, 1:13, 1:13];
cardValues(cardValues>10) = 10;
if cardValues >= 10
cardValues = 10;
end
deck = [cardValues];
deck=deck(randperm(length(deck))); %this shuffles the cards

Risposte (0)

Categorie

Scopri di più su Card games in Help Center e File Exchange

Prodotti


Release

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by