Skip to content

Instantly share code, notes, and snippets.

@cecimerelo
cecimerelo / playingCards.md
Created January 8, 2017 11:05
We have crete a program in Perl 6, in which we can pick a card and shuffle the deck of cards over and over again.

PLAYING CARDS


Here we have the code of the program. <((1,2,3,4,5,6,7,8,9,10,'J','Q','K') X ("♠","♥","♦","♣")).roll> <((1,2,3,4,5,6,7,8,9,10,'J','Q','K') X ("♠","♥","♦","♣")).pick(52)>

<roll> is used for picking any card randomly. `` is used for shuffeling all the deck of cards.

PLAYING CARDS


Here we have the code of the program. <((1,2,3,4,5,6,7,8,9,10,'J','Q','K') X ("♠","♥","♦","♣")).roll>

<((1,2,3,4,5,6,7,8,9,10,'J','Q','K') X ("♠","♥","♦","♣")).pick(52)>

<roll> is used for picking any card randomly.