Playing cards: Difference between revisions

Content added Content deleted
(→‎{{header|PHP}}: changed Deck::deal() to deal FIFO in stead of LIFO)
m (→‎version 2: added more whitespace to the output. -- ~~~~)
Line 2,643: Line 2,643:
call shuffleDeck; say 'shuffled deck:' theDeck /*shuffled deck. */
call shuffleDeck; say 'shuffled deck:' theDeck /*shuffled deck. */
call dealHands 5,4 /*5 cards, 4 hands*/
call dealHands 5,4 /*5 cards, 4 hands*/
say; say right('[north]' hand.1,50)
say; say; say right('[north]' hand.1,50)
say; say '[west]' hand.4 right('[east]' hand.2,60)
say; say '[west]' hand.4 right('[east]' hand.2,60)
say; say right('[south]' hand.3,50)
say; say right('[south]' hand.3,50)
say; say 'remainder of deck:' theDeck
say; say; say; say 'remainder of deck:' theDeck
exit /*stick a fork in it, we're done.*/
exit /*stick a fork in it, we're done.*/
/*──────────────────────────────────BUILDDECK subroutine────────────────*/
/*──────────────────────────────────BUILDDECK subroutine────────────────*/
Line 2,679: Line 2,679:
new deck: A♥ 2♥ 3♥ 4♥ 5♥ 6♥ 7♥ 8♥ 9♥ 10♥ J♥ Q♥ K♥ A♦ 2♦ 3♦ 4♦ 5♦ 6♦ 7♦ 8♦ 9♦ 10♦ J♦ Q♦ K♦ A♣ 2♣ 3♣ 4♣ 5♣ 6♣ 7♣ 8♣ 9♣ 10♣ J♣ Q♣ K♣ A♠ 2♠ 3♠ 4♠ 5♠ 6♠ 7♠ 8♠ 9♠ 10♠ J♠ Q♠ K♠
new deck: A♥ 2♥ 3♥ 4♥ 5♥ 6♥ 7♥ 8♥ 9♥ 10♥ J♥ Q♥ K♥ A♦ 2♦ 3♦ 4♦ 5♦ 6♦ 7♦ 8♦ 9♦ 10♦ J♦ Q♦ K♦ A♣ 2♣ 3♣ 4♣ 5♣ 6♣ 7♣ 8♣ 9♣ 10♣ J♣ Q♣ K♣ A♠ 2♠ 3♠ 4♠ 5♠ 6♠ 7♠ 8♠ 9♠ 10♠ J♠ Q♠ K♠
shuffled deck: A♣ 3♠ 5♥ J♣ K♦ 10♥ 9♣ Q♥ 2♣ 3♦ Q♠ A♠ 4♥ 8♠ K♠ 10♣ 8♦ 6♥ 7♦ 3♥ 3♣ Q♣ 9♦ 9♥ J♠ A♥ Q♦ 4♦ J♦ 5♠ 10♠ 4♠ 9♠ A♦ 2♦ 2♥ 6♠ 7♣ K♥ 8♥ 6♦ 8♣ 4♣ 5♦ 7♥ 6♣ 7♠ K♣ 5♣ 2♠ 10♦ J♥
shuffled deck: A♣ 3♠ 5♥ J♣ K♦ 10♥ 9♣ Q♥ 2♣ 3♦ Q♠ A♠ 4♥ 8♠ K♠ 10♣ 8♦ 6♥ 7♦ 3♥ 3♣ Q♣ 9♦ 9♥ J♠ A♥ Q♦ 4♦ J♦ 5♠ 10♠ 4♠ 9♠ A♦ 2♦ 2♥ 6♠ 7♣ K♥ 8♥ 6♦ 8♣ 4♣ 5♦ 7♥ 6♣ 7♠ K♣ 5♣ 2♠ 10♦ J♥



[north] A♣ K♦ 2♣ 4♥ 8♦
[north] A♣ K♦ 2♣ 4♥ 8♦
Line 2,685: Line 2,686:


[south] 5♥ 9♣ Q♠ K♠ 7♦
[south] 5♥ 9♣ Q♠ K♠ 7♦



remainder of deck: 3♣ Q♣ 9♦ 9♥ J♠ A♥ Q♦ 4♦ J♦ 5♠ 10♠ 4♠ 9♠ A♦ 2♦ 2♥ 6♠ 7♣ K♥ 8♥ 6♦ 8♣ 4♣ 5♦ 7♥ 6♣ 7♠ K♣ 5♣ 2♠ 10♦ J♥
remainder of deck: 3♣ Q♣ 9♦ 9♥ J♠ A♥ Q♦ 4♦ J♦ 5♠ 10♠ 4♠ 9♠ A♦ 2♦ 2♥ 6♠ 7♣ K♥ 8♥ 6♦ 8♣ 4♣ 5♦ 7♥ 6♣ 7♠ K♣ 5♣ 2♠ 10♦ J♥