Playing cards: Difference between revisions

→‎{{header|J}}: use unicode symbols rather than text
(→‎{{header|Perl 6}}: Mark incorrect. Ace & 10 omitted from pack.)
(→‎{{header|J}}: use unicode symbols rather than text)
Line 730:
 
NB. Class objects
Ranks=: >_2 ;]\ 7 u:'Ace TwoA Three2 Four3 Five4 Six5 Seven6 Eight7 Nine8 Ten910 JackJ QueenQ KingK'
Suits=: >7 ;u:'Spades Hearts Diamonds Clubs♦♣♥♠'
DeckPrototype=: (] #: i.@:*/)Ranks ,&# Suits
 
Line 741:
destroy=: codestroy
 
sayCards=: ({&Ranks@{., ' of ', {&Suits@{:)"1
 
shuffle=: monad define
Line 775:
1
sayCards 2 dealCards__pc 5 NB. deal two hands of five cards
8♥
Nine of Hearts
5♠
Three of Clubs
3♥
Seven of Clubs
J♠
Ten of Hearts
2♥
Three of Diamonds
 
4♣
Seven of Diamonds
8♣
Nine of Spades
7♠
King of Diamonds
6♠
Queen of Hearts
2♠
Six of Clubs
$TheDeck__pc NB. deck size has been reduced by the ten cards dealt
42 2
892

edits