art.games
draw chess positions, playing cards and dice
Draws game pieces as text: a chess position, playing cards, and dice faces. Each returns a picture you can print, or place beside other pictures with the frame functions.
Tags: art
chessdraw a chess board from FEN, the standard text notation for a positioncarddraw a playing card, written as its rank and suit like “A♠”, “10h” or “qd”cardsdraw several playing cards side by side, written as for carddicedraw a die showing 1 to 6, or several side by side for a list
Functions
Section titled “Functions”chess(fen?: str) -> str
draw a chess board from FEN, the standard text notation for a position
Only the first part, where the pieces are, is used. Shows the starting position without one
1chess()8 ♜ ♞ ♝ ♛ ♚ ♝ ♞ ♜
7 ♟ ♟ ♟ ♟ ♟ ♟ ♟ ♟
6 · · · ·
5 · · · ·
4 · · · ·
3 · · · ·
2 ♙ ♙ ♙ ♙ ♙ ♙ ♙ ♙
1 ♖ ♘ ♗ ♕ ♔ ♗ ♘ ♖
a b c d e f g h2chess("8/8/8/4k3/8/8/4P3/4K3 w - - 0 1")8 · · · ·
7 · · · ·
6 · · · ·
5 · · ♚ ·
4 · · · ·
3 · · · ·
2 · · ♙ · ·
1 · · ♔ ·
a b c d e f g hSee also card
card(c: str) -> str
draw a playing card, written as its rank and suit like “A♠”, “10h” or “qd”
Suits are ♠♥♦♣ or the letters s h d c, and “?” draws the card’s back
1card("Q♥")┌─────┐
│Q │
│ ♥ │
│ Q│
└─────┘cards(hand: list) -> str
draw several playing cards side by side, written as for card
1cards(["As", "Kh", "?"])┌─────┐ ┌─────┐ ┌─────┐
│A │ │K │ │░░░░░│
│ ♠ │ │ ♥ │ │░░░░░│
│ A│ │ K│ │░░░░░│
└─────┘ └─────┘ └─────┘See also card
dice(faces: int|list) -> str
draw a die showing 1 to 6, or several side by side for a list
1dice(5)┌───────┐
│ ● ● │
│ ● │
│ ● ● │
└───────┘2dice([1, 2, 3])┌───────┐ ┌───────┐ ┌───────┐
│ │ │ ● │ │ ● │
│ ● │ │ │ │ ● │
│ │ │ ● │ │ ● │
└───────┘ └───────┘ └───────┘More examples
Section titled “More examples”1# roll three dice and draw them2dice(roll("3d6").rolls)┌───────┐ ┌───────┐ ┌───────┐
│ ● ● │ │ ● │ │ ● │
│ ● ● │ │ │ │ ● │
│ ● ● │ │ ● │ │ ● │
└───────┘ └───────┘ └───────┘3# a royal flush4cards(["10♠", "J♠", "Q♠", "K♠", "A♠"])┌─────┐ ┌─────┐ ┌─────┐ ┌─────┐ ┌─────┐
│10 │ │J │ │Q │ │K │ │A │
│ ♠ │ │ ♠ │ │ ♠ │ │ ♠ │ │ ♠ │
│ 10│ │ J│ │ Q│ │ K│ │ A│
└─────┘ └─────┘ └─────┘ └─────┘ └─────┘5# a chess board at the start of a game6chess()8 ♜ ♞ ♝ ♛ ♚ ♝ ♞ ♜
7 ♟ ♟ ♟ ♟ ♟ ♟ ♟ ♟
6 · · · ·
5 · · · ·
4 · · · ·
3 · · · ·
2 ♙ ♙ ♙ ♙ ♙ ♙ ♙ ♙
1 ♖ ♘ ♗ ♕ ♔ ♗ ♘ ♖
a b c d e f g hExample results generated on 2026-11-04. Ones using now, today or randomness will differ when you run them.