![]() |
||
---|---|---|
templates | ||
README.md | ||
app.py | ||
dockerfile | ||
makefile | ||
requirements.txt |
README.md
Flask card trick
Background
I used this as part of a little card trick for a friend's birthday.
About
This is a simple Flask server that displays a unicode playing card (see table below) which can be preset or updated. The default card is a card back (🂠).
Usage
-
Requesting the route
/
will display the current card (default is a blank card back). -
The card can be set by requesting the route
/u<new_card>
(u
is short for update), wherenew_card
is a case-insensitive card name consisting of an index and suit (see table below).Example values:
3c
(for 3 of Clubs),10d
(for 10 of Diamonds) oras
(for Ace of Spades). -
The 2nd step can be repeated as many times as desired.
-
Requesting the route
/r
will reset to the blank card back.
Unicode cards
new_card |
a (Ace) |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 or 0 |
j (Jack) |
q (Queen) |
k (King) |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s (Spades) |
🂡 | 🂢 | 🂣 | 🂤 | 🂥 | 🂦 | 🂧 | 🂨 | 🂩 | 🂪 | 🂫 | 🂭 | 🂮 |
h (Hearts) |
🂱 | 🂲 | 🂳 | 🂴 | 🂵 | 🂶 | 🂷 | 🂸 | 🂹 | 🂺 | 🂻 | 🂽 | 🂾 |
d (Diamonds) |
🃁 | 🃂 | 🃃 | 🃄 | 🃅 | 🃆 | 🃇 | 🃈 | 🃉 | 🃊 | 🃋 | 🃍 | 🃎 |
c (Clubs) |
🃑 | 🃒 | 🃓 | 🃔 | 🃕 | 🃖 | 🃗 | 🃘 | 🃙 | 🃚 | 🃛 | 🃝 | 🃞 |