Warning: session_start(): open(/var/lib/php/sessions/sess_i8o79ft4kifgivbp9rrnbgvbsn, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
!7
!include #1006891 // AI Game & API
p {
instruction = "Close the window:";
pGame();
}
//////////////////////////////////////
// Test AIs. Just add your own here //
//////////////////////////////////////
AI > ClickAnyBLOB {
static ImageSurface is;
void go {
L blobs = segment(image);
is = showImage(is, "BLOBS", rgbMarkedRects(image, blobs));
submit(random(blobs));
}
}
!include #1006892 // MemorizeBrightBLOB
//////////////////
// PUZZLE MAKER //
//////////////////
static L mainImages;
static Puzzle makePuzzle() {
if (mainImages == null)
mainImages = loadImages(#1006879, #1006889);
L solutions = ll(
pointsRect(522, 162, 540, 179),
pointsRect(449, 70, 466, 84));
// select image
int i = random(l(mainImages));
RGBImage mainImage = mainImages.get(i);
Rect solution = solutions.get(i);
// select random portion
Rect clip = selectRandomPartContaining(mainImage, solution, w, h);
RGBImage img = mainImage.clip(clip);
solution = translateRect(solution, -clip.x, -clip.y);
// return puzzle
ret new Puzzle(img, ll(solution));
}