!7 !include #1007130 // AI Game Include p { showBlunderWindow = false; pGame(); } ////////////////////////////////////// // Test AIs. Just add your own here // ////////////////////////////////////// AI > BWImageCat { new BWImageCategorizer cat; new L texts; static ImageSurface is; void go { cat.allowedDistance = 0.03f; int i = cat.addImage(image()); S guess = get(texts, i); S solution = submit(guess); if (nempty(solution) && empty(guess)) { listSet(texts, i, solution); bool first = is == null; is = showImage(is, shortClassName(this) + ": " + join(texts), mergeImagesHorizontally(cat.rgbImages())); if (first) { setFrameWidth(is, 600); moveToTopRightCorner(is); } } } } static L segment(RGBImage img) { ret autoSegment(new BWImage(img), 3); // 2 is too small } ////////////////// // PUZZLE MAKER // ////////////////// static Puzzle makePuzzle() { S text = randomID(1); ret new Puzzle("Enter the lowercase letter you see:", renderSourceCode_1(text), text); }