Libraryless. Click here for Pure Java version (2902L/17K).
1 | static bool oneIn(int n) { |
2 | ret random(n) == 0; |
3 | } |
4 | |
5 | static bool oneIn(int n, Random random) { |
6 | ret random(random, n) == 0; |
7 | } |
8 | |
9 | sbool oneIn(Random random, int n) { |
10 | ret oneIn(n, random); |
11 | } |
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1006948 |
Snippet name: | oneIn |
Eternal ID of this version: | #1006948/4 |
Text MD5: | 45a37dc7965c4c300870b1e27001f21a |
Transpilation MD5: | 53c1af8333663bc6118694ea4160452f |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-06-25 11:30:06 |
Source code size: | 198 bytes / 11 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 545 / 718 |
Version history: | 3 change(s) |
Referenced in: | [show references] |