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

14
LINES

< > BotCompany Repo | #1010414 // ScoreBoard - score table with double scores

JavaX fragment (include)

1  
sclass ScoreBoard<A> {
2  
  double fullScore;
3  
  new Map<A, Double> scores;
4  
  
5  
  void print() {
6  
    printAsciiHeading("Score board (full score: " + fullScore + ")");
7  
    new L<S> l;
8  
    for (A key : keys(sortByValueDesc(scores))) {
9  
      double score = scores.get(key);
10  
      l.add(key + " = " + score + " (" + ratioToIntPercent_floor(score, fullScore) + "%)");
11  
    }
12  
    pnl(l);
13  
  }
14  
}

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: #1010414
Snippet name: ScoreBoard - score table with double scores
Eternal ID of this version: #1010414/3
Text MD5: d97a2556d6b3fa3ab2b919f343b5c92f
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-09-15 19:54:08
Source code size: 394 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 456 / 1020
Version history: 2 change(s)
Referenced in: [show references]