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

16
LINES

< > BotCompany Repo | #1010321 // Test allPermutations [OK]

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Libraryless. Click here for Pure Java version (919L/7K).

1  
!7
2  
3  
static L<S> l = splitAtSpace("This is a list to permutate .");
4  
5  
p {
6  
  for (int i = 0; i <= l(l); i++) {
7  
    L<S> ll = takeFirst(l, i);
8  
    print("\nPermutating: " + ll);
9  
    time "Permutating" { LL<S> perm = allPermutations(ll); }
10  
    print("Have " + n(perm, "permutation"));
11  
    assertEquals(factorial(i), l(perm));
12  
    assertEquals(l(new HashSet(perm)), l(perm));
13  
    pnl(perm);
14  
  }
15  
  print("\nOK (probably)");
16  
}

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: #1010321
Snippet name: Test allPermutations [OK]
Eternal ID of this version: #1010321/5
Text MD5: 27844d0a56a3f85de212d015b65464ca
Transpilation MD5: 2534446feac7f071d8f48d55b4366c34
Author: stefan
Category: javax
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-09-12 01:12:15
Source code size: 433 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 568 / 1240
Version history: 4 change(s)
Referenced in: [show references]