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).

static BitMatrix randomBitMatrix(int w, int h, optional Random random) {
  int[] data = arrayOfRandomInts(IntArrayBitMatrix.arrayLength(w, h), random);
  ret new IntArrayBitMatrix(w, h, data);
}

static BitMatrix randomBitMatrix(int w, int h, double probability) {
  int[] data = arrayOfRandomBitsAsInts(w*h, probability);
  ret new IntArrayBitMatrix(w, h, data);
}

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: 82 / 140
Version history: 5 change(s)
Referenced in: [show references]