Libraryless. Click here for Pure Java version (2508L/16K).
1 | static ItIt<Pt> allSubRectsOfSizeIterator_topLeftCorners(int w, int h, Rect full) { |
2 | if (full == null) ret emptyItIt(); |
3 | int fullW = full.w, fullH = full.h; |
4 | if (w > fullW || h > fullH) ret emptyItIt(); |
5 | int freeplayX = fullW-w+1, freeplayY = fullH-h+1, freeplay = freeplayX*freeplayY; |
6 | ret mapI(iota_zero(freeplay), i -> |
7 | pt(full.x + (i % freeplayX), full.y + (i / freeplayX))); |
8 | } |
Began life as a copy of #1027216
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1027269 |
Snippet name: | allSubRectsOfSizeIterator_topLeftCorners |
Eternal ID of this version: | #1027269/1 |
Text MD5: | 9e0b253eb8b81c3108eb89e6e4b1b1fd |
Transpilation MD5: | ff0e915d075305478358d1fbc884be0b |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-02-28 15:09:56 |
Source code size: | 396 bytes / 8 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 240 / 314 |
Referenced in: | [show references] |