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

18
LINES

< > BotCompany Repo | #1014959 // AI_Random_abstract

JavaX fragment (include)

abstract sclass AI_Random_abstract extends AI {
  new Best<Submission> best;
  
  void go {
    if (round() == 1 && best.has()) // resubmit our best from last round
      submit(best.get());
    else {
      Submission guess = guess();
      updateBest(guess, submit(guess));
    }
  }
  
  void updateBest(Submission guess, double score) {
    best.put(guess, score);
  }
  
  abstract Submission guess();
}

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: #1014959
Snippet name: AI_Random_abstract
Eternal ID of this version: #1014959/2
Text MD5: ba58b37c2fc274ace50e6284d9b66acd
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-05-06 18:25:42
Source code size: 425 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 391 / 960
Version history: 1 change(s)
Referenced in: #1014960 - AI_RandomWithVariation_abstract
#1034167 - Standard Classes + Interfaces (LIVE, continuation of #1003674)