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)

1  
abstract sclass AI_Random_abstract extends AI {
2  
  new Best<Submission> best;
3  
  
4  
  void go {
5  
    if (round() == 1 && best.has()) // resubmit our best from last round
6  
      submit(best.get());
7  
    else {
8  
      Submission guess = guess();
9  
      updateBest(guess, submit(guess));
10  
    }
11  
  }
12  
  
13  
  void updateBest(Submission guess, double score) {
14  
    best.put(guess, score);
15  
  }
16  
  
17  
  abstract Submission guess();
18  
}

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: 390 / 960
Version history: 1 change(s)
Referenced in: [show references]