!7 // Actually the two parts could be much more general, like not even touching each other, not having the same aspect ratio etc). // No idea if these would then be called "generalized Haar features" or what p-subst { repeat with sleep 1 { currentImage(newBufferedImage(200, 200, Color.gray)); Rect r = randomRect(); Pair p; if (tossCoin()) { r.h &= ~1; // make even p = splitRectInVerticalHalves(r); } else { r.w &= ~1; // make even p = splitRectInHorizontalHalves(r); } if (oneInTwoChance()) p = reversePair(p); fillRect(p.a, Color.black); fillRect(p.b, Color.white); quickShowImage(); } }