Playing cards: Difference between revisions

Content deleted Content added
Tikkanz (talk | contribs)
m →‎{{header|J}}: <nowiki> tags no longer required
Line 1,094: Line 1,094:
DeckPrototype=: |. ,/(i.#N0),."1 0 i.#N1
DeckPrototype=: |. ,/(i.#N0),."1 0 i.#N1
sayCards=: ((N0{~{.),' of ',(N1{~{:))"1
sayCards=: ((N0{~{.),' of ',(N1{~{:))"1
startNewDeck<nowiki>''</nowiki>
startNewDeck ''
)
)


Line 1,127: Line 1,127:
<lang j> load 'coutil'
<lang j> load 'coutil'
load 'c:\documents and settings\user_name\j602-user\playingcards.ijs'
load 'c:\documents and settings\user_name\j602-user\playingcards.ijs'
pc=: <nowiki>''</nowiki> conew 'rcpc'
pc=: '' conew 'rcpc'
$TheDeck__pc
$TheDeck__pc
52 2
52 2
shuffle__pc<nowiki>''</nowiki>
shuffle__pc ''
1
1
sayCards__pc 2 dealCards__pc 5 NB. deal two hands of five cards
sayCards__pc 2 dealCards__pc 5 NB. deal two hands of five cards
Line 1,146: Line 1,146:
$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 <nowiki>''</nowiki>
destroy__pc ''
1</lang>
1</lang>