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

9
LINES

< > BotCompany Repo | #1033123 // matrixToIntArray

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

Libraryless. Click here for Pure Java version (42L/1K).

static int[] matrixToIntArray(Matrix<Int> m) {
  int w = m.getWidth(), h = m.getHeight(), n = w*h;
  int[] a = new int[n];
  int i = 0;
    for y to h:
      for x to w:
        a[i++] = m.get(x, y);
  ret a;
}

Author comment

Began life as a copy of #1004992

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1033123
Snippet name: matrixToIntArray
Eternal ID of this version: #1033123/1
Text MD5: d476d0c0f501ae70a7ac46673830c3f6
Transpilation MD5: de64d249ff553809625291481f8a2135
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-10-15 15:54:19
Source code size: 218 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 90 / 137
Referenced in: [show references]