Unicode card deck

Exerpt from wikipedia;

Playing Cards[1][2]
Official Unicode Consortium code chart
 
(PDF)
  0 1 2 3 4 5 6 7 8 9 A B C D E
U+1F0Ax ๐Ÿ‚  ๐Ÿ‚ก ๐Ÿ‚ข ๐Ÿ‚ฃ ๐Ÿ‚ค ๐Ÿ‚ฅ ๐Ÿ‚ฆ ๐Ÿ‚ง ๐Ÿ‚จ ๐Ÿ‚ฉ ๐Ÿ‚ช ๐Ÿ‚ซ ๐Ÿ‚ฌ ๐Ÿ‚ญ ๐Ÿ‚ฎ
U+1F0Bx ๐Ÿ‚ฑ ๐Ÿ‚ฒ ๐Ÿ‚ณ ๐Ÿ‚ด ๐Ÿ‚ต ๐Ÿ‚ถ ๐Ÿ‚ท ๐Ÿ‚ธ ๐Ÿ‚น ๐Ÿ‚บ ๐Ÿ‚ป ๐Ÿ‚ผ ๐Ÿ‚ฝ ๐Ÿ‚พ
U+1F0Cx ๐Ÿƒ ๐Ÿƒ‚ ๐Ÿƒƒ ๐Ÿƒ„ ๐Ÿƒ… ๐Ÿƒ† ๐Ÿƒ‡ ๐Ÿƒˆ ๐Ÿƒ‰ ๐ŸƒŠ ๐Ÿƒ‹ ๐ŸƒŒ ๐Ÿƒ ๐ŸƒŽ
U+1F0Dx ๐Ÿƒ‘ ๐Ÿƒ’ ๐Ÿƒ“ ๐Ÿƒ” ๐Ÿƒ• ๐Ÿƒ– ๐Ÿƒ— ๐Ÿƒ˜ ๐Ÿƒ™ ๐Ÿƒš ๐Ÿƒ› ๐Ÿƒœ ๐Ÿƒ ๐Ÿƒž
/*
 * I recently wrote a short example program on how to generate
 * unicode characters.
 *
 * I'll try to contain the whole post in the source of this file for
 * the sake of keeping it short.
 */
#include <locale.h>
#include <stdio.h>

#define CLEAN(X) (((((X ^ CARD) & ~SPADES) & ~HEARTS) & ~DIAMONDS) & ~CLUBS)

enum {
    CARD     = 0x1f000,

    SPADES   = 0xa0,
    HEARTS   = 0xb0,
    DIAMONDS = 0xc0,
    CLUBS    = 0xd0,

    ACE      = 0x1,
    JACK     = 0xb,
    KNIGHT   = 0xc,
    QUEEN    = 0xd,
    KING     = 0xe,
};

int
new_card(void) {
    int rnd;
    int ret = CARD;

    /* replace this with whichever way you usually get a random int */
    rnd = arc4random();

    /* randomly select suit */
    switch (abs(rnd % 4)) {
    case 0:
        ret |= SPADES;
        break;
    case 1:
        ret |= HEARTS;
        break;
    case 2:
        ret |= DIAMONDS;
        break;
    case 3:
        ret |= CLUBS;
        break;
    }

    /* add a random number between 1-15 to return */
    ret += abs(rnd % 14) + 1;

    /* if return is a knight, recursively run until it isn't */
    if (CLEAN(ret) == KNIGHT)
        ret = new_card();

    return ret;
}

int
main(int argc, char **argv) {
    setlocale(LC_ALL, "");

    printf("%lc\n", new_card());

    /*
     * CARD     = 0x1f000 == 0b11111000000000000 | (OR)
     * HEARTS   = 0x000b0 == 0b00000000010110000 | (OR)
     * QUEEN    = 0x0000d == 0b00000000000001101 | (OR)
     *          = 0x1f0bd == 0b11111000010111101 == U+1F0BD == ๐Ÿ‚ฝ
     */
    printf("%lc\n", CARD | HEARTS | QUEEN);

    return 0;
}