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

9
LINES

< > BotCompany Repo | #1033663 // randomBitMatrix

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

Libraryless. Click here for Pure Java version (5732L/31K).

1  
static BitMatrix randomBitMatrix(int w, int h, optional Random random) {
2  
  int[] data = arrayOfRandomInts(IntArrayBitMatrix.arrayLength(w, h), random);
3  
  ret new IntArrayBitMatrix(w, h, data);
4  
}
5  
6  
static BitMatrix randomBitMatrix(int w, int h, double probability) {
7  
  int[] data = arrayOfRandomBitsAsInts(w*h, probability);
8  
  ret new IntArrayBitMatrix(w, h, data);
9  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1033663
Snippet name: randomBitMatrix
Eternal ID of this version: #1033663/6
Text MD5: 143657336ea40a63148eda53384d1c00
Transpilation MD5: 006210613c74d562f710c452ad29e0a9
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:13:37
Source code size: 373 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 151 / 228
Version history: 5 change(s)
Referenced in: [show references]