Transpiled version (4076L) is out of date.
1 | static L<IntRange> splitIntoRandomRangesOfApproximateLength(double avgLength, IntRange base) {
|
2 | int i = base.start; |
3 | new L<IntRange> out; |
4 | int safety = 0; |
5 | while (i < base.end && safety++ < l(base)) {
|
6 | double randVal = random(avgLength*2); |
7 | int j = min(base.end, i+max(1, iround(randVal))); |
8 | out.add(intRange(i, j)); |
9 | i = j; |
10 | } |
11 | ret out; |
12 | } |
Began life as a copy of #1032922
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
| Snippet ID: | #1032924 |
| Snippet name: | splitIntoRandomRangesOfApproximateLength |
| Eternal ID of this version: | #1032924/2 |
| Text MD5: | 0b0f4cdd3d6d70b8c3b99d7a3ab913b7 |
| Author: | stefan |
| Category: | javac |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2021-10-10 23:20:40 |
| Source code size: | 368 bytes / 12 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 387 / 486 |
| Version history: | 1 change(s) |
| Referenced in: | [show references] |