Card game and simulation library and tools. Part of the OneJoker project.

Project maintained by Lee Daniel Crocker
Lee's blog is etceterology.

onejoker
CC-0: To the extent possible under law, I, Lee Daniel Crocker waive all copyright and related or neighboring rights to all creative works original to me.

Using the library in your Java code

Java

Your Java programs will have to import the classes, and also load the library. More details of the classes and functions available are in the Java API document. Here’s a short example:

import com.onejoker.cardlib.*;

public class Hello {
    static {
        System.loadLibrary("ojcard");
    }
    public static void main(String[] args) {
        CardList deck = new CardList(52), hand = new CardList(5);
        deck.fill();
        deck.shuffle();

        for (int i = 0; i < 5; ++i) hand.add(deck.pop());
        System.out.println(hand);
    }
}