static S[][] wordsMatrix(Collection<S> lines) { LL<S> l = map words(lines); int rows = l(l), cols = maxLength(l); S[][] matrix = new S[rows][cols]; for i to rows: { L<S> words = l.get(i); for j to cols: matrix[i][j] = j < l(words) ? words.get(j) : ""; } ret matrix; }
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1010877 |
Snippet name: | wordsMatrix |
Eternal ID of this version: | #1010877/2 |
Text MD5: | f23be07403b32b9029cadd9d3fb73162 |
Author: | stefan |
Category: | javax / a.i. |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2017-10-05 00:20:37 |
Source code size: | 303 bytes / 11 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 428 / 447 |
Version history: | 1 change(s) |
Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) #1010878 - extendsWordsMatrix - make an additional line #1010882 - wordsMatrixColumn |