Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Create graphic displaying standard playing cards
ResourceFunction["PlayingCardGraphic"][n] displays the nth card in a standard deck of playing cards, where 0 represents a card that is face down. | |
ResourceFunction["PlayingCardGraphic"][n,suit] displays the nth card in a specific suit where "♠", "♡", "♢" and "♣" represent the standard playing card suits. | |
ResourceFunction["PlayingCardGraphic"][{card1,card2,…,cardn}] displays a hand of playing cards where each card is represented as a number from 0 to 52 or as a list of the form {n,suit}. |
Display a playing card:
In[1]:= | ![]() |
Out[1]= | ![]() |
Display several cards together:
In[2]:= | ![]() |
Out[2]= | ![]() |
Display a card with a custom suit symbol:
In[3]:= | ![]() |
Out[3]= | ![]() |
Display a card face down:
In[4]:= | ![]() |
Out[4]= | ![]() |
"CardColor" controls the color of the playing card:
In[5]:= | ![]() |
Out[5]= | ![]() |
FontFamily, FontColor and FontSize control the corner labels:
In[6]:= | ![]() |
Out[6]= | ![]() |
RoundingRadius controls the card shape:
In[7]:= | ![]() |
Out[7]= | ![]() |
"CardSpreadAngle" controls the amount of curvature in a hand:
In[8]:= | ![]() |
Out[8]= | ![]() |
"CardOffset" controls how each card in a hand is separated from the next:
In[9]:= | ![]() |
Out[9]= | ![]() |
In[10]:= | ![]() |
Out[10]= | ![]() |
In[11]:= | ![]() |
Out[11]= | ![]() |
Deal a random poker hand:
In[12]:= | ![]() |
Out[12]= | ![]() |
Wolfram Language 11.3 (March 2018) or above
This work is licensed under a Creative Commons Attribution 4.0 International License