Playing cards: Difference between revisions

→‎{{header|J}}: Retain arrays of suits and ranks in class
m (→‎{{header|J}}: Add error message)
(→‎{{header|J}}: Retain arrays of suits and ranks in class)
Line 1,090:
 
NB. Class objects
n0Ranks=.: > ;:'Ace Two Three Four Five Six Seven Eight Nine Ten Jack Queen King'
n1Suits=.: > ;:'Spades Hearts Diamonds Clubs'
DeckPrototype=: |. ,/(i.#n0Ranks),."1 0 i.#n1Suits
 
NB. Class methods
Line 1,101:
destroy=: codestroy
 
sayCards=: ((n0Ranks{~{.),' of ',(n1Suits{~{:))"1
 
shuffle=: monad define
892

edits