Playing cards: Difference between revisions

Content added Content deleted
(→‎{{header|J}}: define sayCards and DeckPrototype in parent class, simplify creation of new deck.)
Line 1,129: Line 1,129:
'''Example use:'''
'''Example use:'''
<lang j> load '~user/playingcards.ijs'
<lang j> load '~user/playingcards.ijs'
coinsert 'rcpc' NB. inserts rcpc class in the path of current locale
coinsert 'rcpc' NB. insert rcpc class in the path of current locale
pc=: newDeck ''
pc=: newDeck ''
$TheDeck__pc
$TheDeck__pc
Line 1,147: Line 1,147:
Queen of Hearts
Queen of Hearts
Six of Clubs
Six of Clubs
$TheDeck__pc NB. deck size has been reduced by the ten cards dealt
$TheDeck__pc NB. deck size has been reduced by the ten cards dealt
42 2
42 2
destroy__pc ''
destroy__pc ''