Java implementation of knights tour