Card game and simulation library and tools. Part of the OneJoker project.
Project maintained by Lee Daniel Crocker
Lee's blog is etceterology.
For card, rank, and suit constant comparisons, use the OJ
definitions when possible as these are compile-time constants. The macros OJ_CARD()
, OJ_RANK()
and OJ_SUIT()
will also evaluate to constants if their arguments are, though they can be used with variables as well.
Note that there is both an OJR_JOKER
, which is the rank of both jokers, and an OJ_JOKER
, which is the card value of the single (or black) joker. Note also that because card values are ordered the way they are, you can often compare ranks without having to calculate OJ_RANK()
at all. For example:
Here’s a basic “Hello, world.” app using the C API: