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

10
LINES

< > BotCompany Repo | #1031254 // maxPt - max of 2 or more Pt's

JavaX fragment (include) [tags: use-pretranspiled]

Transpiled version (5080L) is out of date.

static Pt maxPt(Pt a, Pt b) {
  ret a == null ? b : b == null ? a : Pt(max(a.x, b.x), max(a.y, b.y));
}

static Pt maxPt(Iterable<Pt> l) {
  Pt max = null;
  fOr (p : l)
    max = maxPt(max, p);
  ret max;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1031254
Snippet name: maxPt - max of 2 or more Pt's
Eternal ID of this version: #1031254/4
Text MD5: d96fb4cc68f29f0f0049492eff88bea0
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-03-18 22:38:18
Source code size: 216 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 81 / 136
Version history: 3 change(s)
Referenced in: [show references]