Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

55
LINES

< > BotCompany Repo | #1014997 // A. I. Game 8.6 / Single Color [OK, if rather simple :)]

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Uses 3874K of libraries. Click here for Pure Java version (11229L/81K).

!7

!include #1006931 // AI Game & API

p-autorestart {
  newImageText = "New Letter!";
  gameTitle = "A. I. Game 8.6";
  reproZoom = 1;
  makeInstruction();
  pGame();
  swing {
    clickButton(last(aiButtons)); // Start the winner AI!
  }
}

svoid makeInstruction {
  setInstruction("Reproduce this image with a single color:");
}

sclass Submission {
  RGB color;
  
  *() {}
  *(RGB *color) {}
}

!include #1014964 // Random letter puzzle maker 

///////////////
// RENDERERS //
///////////////

static RGBImage renderImage(Submission s) { ret new RGBImage(renderImage1(s)); }
static BufferedImage renderImage1(Submission s) { ret newBufferedImage(w, h, toColor(s.color)); }
static BufferedImage renderWithHints(Submission s) { ret renderImage1(s); }

/////////////////////////////////
// AIs. Just add your own here //
/////////////////////////////////

AI_Random_abstract > AI_Random {
  Submission guess() {
    ret Submission(randomColor());
  }
}

AI_RandomWithVariation_abstract > AI_RandomWithVariation {
  AI_RandomWithVariation() { super(new AI_Random); }
  
  Submission vary(Submission s) {
    ret Submission(varyColor(s.color));
  }
}

!include #1014957 // AI_Racer

Author comment

Began life as a copy of #1014980

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

-
Snippet ID: #1014997
Snippet name: A. I. Game 8.6 / Single Color [OK, if rather simple :)]
Eternal ID of this version: #1014997/6
Text MD5: cd4c82595eba23c46abf9be41ffce9e6
Transpilation MD5: b010dc7446cf10caa83a58ad98a5192f
Author: stefan
Category: javax / gui / a.i.
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-05-06 23:18:47
Source code size: 1236 bytes / 55 lines
Pitched / IR pitched: No / No
Views / Downloads: 478 / 1191
Version history: 5 change(s)
Referenced in: