Hacker News new | ask | show | jobs
by ashfn 333 days ago
Hey all, I found a cool way to convert text into a specific order of a deck of playing cards. I detailed the instructions of how it works in the blog post but a brief overview would be that it uses Lehmer codes which allow you to uniquely identify each permutation of a set i.e. each of the many many ways a deck of cards can be shuffled/arranged
1 comments

TIL about Lehmer codes... and "poker encoding" ;)

(I just prefer poker to solitaire...)

Someone else mentioned that the orientation of the cards (up or down) and possibly even the front-back facingness of the card (facing up, facing down) would add another 2 possible bits to the available encoding space. (Of course, at that point you'd have to also encode which side of the whole deck is the "top"...)

My own thought was to add par2 to make it robust against small errors... at the cost of some transmission space!

> Of course, at that point you'd have to also encode which side of the whole deck is the "top"...)

An asymmetrical joker could indicate which short edge is "right way up", while also indicating which card is the first or last of the deck.

> "...which side of the whole deck is the 'top'..."

A dark line drawn across the top of the deck would be enough. Though it would ruin the stealth factor of the cards.

Also, the pattern on the back of some playing decks isn't symmetrical, so that could be used as well.

Decode it both ways and see which isn't gibberish.
Use a casino decommissioned deck. They typically have either a hole punched in them, or a corner cut off. Either way it won't be symmetric, but still perfectly plausible as a cheap deck of cards.
Yeah that would make an interesting addition. I was thinking about error correction so if you swapped two cards it would be okay but was struggling with how it would work, but I think it would be quite fun to add :)