Warning: session_start(): open(/var/lib/php/sessions/sess_mjnrv95brmaqc534ijd0kg3pac, 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
static int circles = 1;
!include #1006931 // AI Game & API
p-autorestart {
newImageText = "New Letter!";
gameTitle = "A. I. Game 8.5";
reproZoom = 1;
makeInstruction();
pGame();
swing {
setImage(loadImage(#1101188)); // Instagram logo
final JSpinner spinner = jSpinner(circles, 1, 100);
addToWindowPack_keepWidth(is, withMargin(jRightAligned(withLabel("Number of circles to use:", spinner))));
onChange(spinner, r {
circles = intFromSpinner(spinner);
makeInstruction(); restartAIs();
});
clickButton(last(aiButtons)); // Start the winner AI!
}
}
svoid makeInstruction {
setInstruction("Reproduce this image with " + n2(circles, "circle") + ":");
}
sclass Submission extends BackgroundPlus {
*() {}
*(BackgroundPlus b) { copyFields(b, this); check(); }
void check {
assertEqualsQuick(circles, l(things));
}
}
!include #1014964 // Random letter puzzle maker
///////////////
// RENDERERS //
///////////////
static RGBImage renderImage(Submission s) { ret new RGBImage(renderImage1(s)); }
static BufferedImage renderImage1(Submission s) { ret renderBackgroundPlusCircles(w, h, s); }
static BufferedImage renderWithHints(Submission s) { ret renderBackgroundPlusCircles_withHints(w, h, s); }
/////////////////////////////////
// AIs. Just add your own here //
/////////////////////////////////
AI_Random_abstract > AI_Random {
Submission guess() {
ret Submission(randomBackgroundPlusCirclesNearCenter(w, h, circles));
}
}
AI_RandomWithVariation_abstract > AI_RandomWithVariation {
AI_RandomWithVariation() { super(new AI_Random); }
Submission vary(Submission s) {
ret varyBackgroundPlusCirclesNearCenter(s, w, h);
}
}
!include #1014957 // AI_Racer