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

11
LINES

< > BotCompany Repo | #1006948 // oneIn

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

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

static bool oneIn(int n) {
  ret random(n) == 0;
}

static bool oneIn(int n, Random random) {
  ret random(random, n) == 0;
}

sbool oneIn(Random random, int n) {
  ret oneIn(n, random);
}

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: 468 / 624
Version history: 3 change(s)
Referenced in: [show references]