Skip to content

Instantly share code, notes, and snippets.

@Whateverable
Created September 17, 2017 00:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Whateverable/cf79cb97a64ffd0bb72751a5c0923b1e to your computer and use it in GitHub Desktop.
Save Whateverable/cf79cb97a64ffd0bb72751a5c0923b1e to your computer and use it in GitHub Desktop.
greppable6
permutations
File Code
ajs/perl6-Math-Sequences
…/Integer.pm :587:
# A008279 / permutations k at a time
bduggan/p6-jupyter-kernel
…/04-completions.t :24:
is-deeply $completions, <perl perlseen permutations>, 'autocomplete for a string';
colomon/List-Utils
…/02-permute.t :6:
is @a.elems, 6, "(1, 2, 3) has 6 permutations";
croservices/cro
…/app.js :22024:
* Support style names that may come passed in prefixed by adding permutations
drforr/perl6-Perl6-Parser
…/rosetta-1.t :366:
# Brute force test the different permutations
drforr/perl6-Perl6-Parser
…/rosetta-1.t :367:
for unique @digits.permutations -> @p {
gfldex/perl6-pod-to-bigpage
…/html.xhtml :18161:
<a name="t99.2.33"></a><h2 id="_type_List.pod6-routine_permutations">99.2.33 routine permutations</h2>
gfldex/perl6-pod-to-bigpage
…/html.xhtml :18163:
<pre class="code">multi sub permutations($n) returns Seq:D
gfldex/perl6-pod-to-bigpage
…/html.xhtml :18164:
multi method permutations(List:D:) returns Seq:D</pre>
gfldex/perl6-pod-to-bigpage
…/html.xhtml :18166:
<pre class="code">permutations(INTEGER)
gfldex/perl6-pod-to-bigpage
…/html.xhtml :18167:
LIST.permutations</pre>
gfldex/perl6-pod-to-bigpage
…/html.xhtml :18168:
<p>Returns all possible permutations of a list as a sequence of lists. So</p>
gfldex/perl6-pod-to-bigpage
…/html.xhtml :18169:
<pre class="code">say .join('
gfldex/perl6-pod-to-bigpage
…/html.xhtml :18177:
<p><span class="code">permutations</span> treats all list elements as distinguishable, so <span class="code">(1, 1, 2).permutations</span> still returns a list of 6 elements, even though there are only three distinct permutations.</p>
gfldex/perl6-pod-to-bigpage
…/html.xhtml :18178:
<p>The subroutine form <span class="code">permutations($n)</span> is equivalent to <span class="code">(^$n).permutations</span>, so</p>
gfldex/perl6-pod-to-bigpage
…/html.xhtml :18179:
<pre class="code">.say for permutations 3;</pre>
gfldex/perl6-pod-to-bigpage
…/html.xhtml :25003:
<a href="#t99.2.33"><li class="toc-level toc-level-2"><span class="toc-number">99.2.33</span> routine permutations</li></a>
jonathanstowe/META6
…/projects.json :11249:
"description" : "A quick and dirty way to generate an array of all n-combinations of a list or all permutations",
jonathanstowe/URI-Template
…/rfc6570.txt :905:
address might accept a hundred permutations on fields for address
perl6/doc
…/Any.pod6 :652:
=head2 method permutations
perl6/doc
…/Any.pod6 :656:
method permutations(--> Seq)
perl6/doc
…/Any.pod6 :659:
L«C<List.permutations>
perl6/doc
…/Any.pod6 :661:
say Any.permutations; # OUTPUT: «(((Any)))␤»
perl6/doc
…/List.pod6 :953:
=head2 routine permutations
perl6/doc
…/List.pod6 :957:
multi sub permutations($n --> Seq:D)
perl6/doc
…/List.pod6 :958:
multi method permutations(List:D: --> Seq:D)
perl6/doc
…/List.pod6 :960:
Returns all possible permutations of a list as a sequence of lists. So
perl6/doc
…/List.pod6 :962:
say .join('
perl6/doc
…/List.pod6 :970:
C<permutations> treats all list elements as distinguishable, so
perl6/doc
…/List.pod6 :971:
C<(1, 1, 2).permutations> still returns a list of 6 elements, even though
perl6/doc
…/List.pod6 :972:
there are only three distinct permutations.
perl6/doc
…/List.pod6 :974:
The subroutine form C<permutations($n)> is equivalent to
perl6/doc
…/List.pod6 :975:
C<(^$n).permutations>, so
perl6/doc
…/List.pod6 :977:
.say for permutations 3;
pierre-vigier/Perl6-Math-Matrix
…/Matrix.pm6 :354:
for ( σ_permutations([^$!row-count]) ) {
pierre-vigier/Perl6-Math-Matrix
…/Matrix.pm6 :368:
for ( σ_permutations([^$!row-count]) ) {
pierre-vigier/Perl6-Math-Matrix
…/Matrix.pm6 :379:
multi σ_permutations ([]) { [] => 1 }
pierre-vigier/Perl6-Math-Matrix
…/Matrix.pm6 :380:
multi σ_permutations ([$x, *@xs]) {
pierre-vigier/Perl6-Math-Matrix
…/Matrix.pm6 :381:
σ_permutations(@xs).map({
skids/perl6sum
…/SHA.pm6 :155:
# Fill the rest of the scratchpad with permutations.
skids/perl6sum
…/SHA.pm6 :326:
# Fill the rest of the scratchpad with permutations.
skids/perl6sum
…/SHA.pm6 :399:
# Fill the rest of the scratchpad with permutations.
skids/perl6sum
…/SM3.pm6 :140:
# Fill the rest of the scratchpad with permutations.
spitsh/spitsh
…/Metamodel.pm6 :183:
my @permutations = [X] @params.map: *.^parents(:local).grep(Spit::Type);
spitsh/spitsh
…/Metamodel.pm6 :188:
if @permutations {
spitsh/spitsh
…/Metamodel.pm6 :189:
for @permutations -> \parent-params is raw {
ugexe/zef
…/Client.pm6 :614:
# Handle exit codes for various option permutations like --force
zostay/perl6-ArrayHash
…/README.md :299:
method permutations
zostay/perl6-ArrayHash
…/ArrayHash.pm6 :682:
=head2 method permutations
zostay/perl6-ArrayHash
…/ArrayHash.pm6 :696:
method permutations() {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment