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)

sclass ScoreBoard<A> {
  double fullScore;
  new Map<A, Double> scores;
  
  void print() {
    printAsciiHeading("Score board (full score: " + fullScore + ")");
    new L<S> l;
    for (A key : keys(sortByValueDesc(scores))) {
      double score = scores.get(key);
      l.add(key + " = " + score + " (" + ratioToIntPercent_floor(score, fullScore) + "%)");
    }
    pnl(l);
  }
}

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: 527 / 1098
Version history: 2 change(s)
Referenced in: #1034167 - Standard Classes + Interfaces (LIVE, continuation of #1003674)