Libraryless. Click here for Pure Java version (4667L/26K).
static int randomInt(optional Random random) { ret getRandomizer(random).nextInt(); } // return value between 0 and n-1 static int randomInt(optional Random random, int n) { ret random(random, n); }
download show line numbers debug dex old transpilations
Travelled to 8 computer(s): bhatertpkbcr, ekrmjmnbrukm, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
| Snippet ID: | #1024425 |
| Snippet name: | randomInt - out of full int range (including negative values) + more syntax |
| Eternal ID of this version: | #1024425/9 |
| Text MD5: | fd8537e31ae645e8bcdc5d1bd714120c |
| Transpilation MD5: | 62881107ff58468417609bfe26211e5e |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2022-01-06 23:10:36 |
| Source code size: | 210 bytes / 8 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 591 / 746 |
| Version history: | 8 change(s) |
| Referenced in: | [show references] |