Java implementation of the tris game