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

10
LINES

< > BotCompany Repo | #1025246 // allPointsInRect

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

Libraryless. Click here for Pure Java version (2940L/17K).

1  
static L<Pt> allPointsInRect(int w, int h) {
2  
  ret allPointsInRect(rect(w, h));
3  
}
4  
5  
static L<Pt> allPointsInRect(Rect r) {
6  
  int w = r.w, h = r.h;
7  
  L<Pt> l = emptyList(w*h);
8  
  for y to h: for x to w: l.add(pt(r.x+x, r.y+y));
9  
  ret l;
10  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1025246
Snippet name: allPointsInRect
Eternal ID of this version: #1025246/4
Text MD5: fe43da8513d43d765c68c66229365978
Transpilation MD5: c11655e50823c76a72a24486d4fa244e
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-05-07 16:45:59
Source code size: 244 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 228 / 340
Version history: 3 change(s)
Referenced in: [show references]