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

6
LINES

< > BotCompany Repo | #1029055 // randomBitSet

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

Libraryless. Click here for Pure Java version (2511L/16K).

1  
static BitSet randomBitSet(int n) {
2  
  BitSet bs = new(n);
3  
  for i to n:
4  
    bs.set(i, tossCoin());
5  
  ret bs;
6  
}

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: #1029055
Snippet name: randomBitSet
Eternal ID of this version: #1029055/1
Text MD5: ee9bfb3a7690cf181d8bc6661b353b61
Transpilation MD5: 32016f09adbee580b01b9a630ed20c2e
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-07-18 18:06:30
Source code size: 115 bytes / 6 lines
Pitched / IR pitched: No / No
Views / Downloads: 240 / 342
Referenced in: [show references]