Card game and simulation library and tools. Part of the OneJoker project.
Project maintained by Lee Daniel Crocker
Lee's blog is etceterology.
C programs need only include the single header file ojcardlib.h
, and link against the shared library (libojcard.so
on Linux, ojcard.dll
on Windows). The library will initialize itself properly, including properly seeding the random number generator. If you build the library yourself and link it statically, you will have to initialize the library yourself, like this:
The argument 0 tells the library to seed the RNG from system entropy, which is what you want in most cases. If you pass a nonzero value, that will be used to seed the RNG, which will then generate a reproducible sequence sometimes useful for testing. It is safe to call this initialization function even if it has been called previously (as it would be by the shared library).