List *all* the tuples! Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) The PPCG Site design is on its way - help us make it awesome! Sandbox for Proposed ChallengesOutput a list of all rational numbersMoore IterationNaturally linear Diophantine equationsCo-primality and the number piRotate every row and column in a matrixConvert header levels to numbersASCII DandelionsPrint all decimalsParse a list of lists into a Sad-List2D Array Middle Point

cpython3 different behavior between running a file line by line in interpreter mode and "python3 file"

List numbering with letters

Does polymorph use a PC’s CR or its level?

Area of a 2D convex hull

List *all* the tuples!

The logistics of corpse disposal

When -s is used with third person singular. What's its use in this context?

Create Pages from Database

If A makes B more likely then B makes A more likely"

Could transporting electricity using plastic water pipes be feasible?

Bold symbols in LuaLaTeX with setmathfont

He is picky about food(,) so he only eats what he likes

macOS-like app switching in Plasma 5

When to stop saving and start investing?

Regex in IF condition in awk

What's the purpose of writing one's academic bio in 3rd person?

Are variable time comparisons always a security risk in cryptography code?

How to change the Selenium IDE file extension (.side file into java file) while saving the project

Stirling numbers of second kind, but no two adjacent numbers in same part.

Is there a documented rationale why the House Ways and Means chairman can demand tax info?

Is there a concise way to say "all of the X, one of each"?

Double integral with logarithms

Project this triangle on surface of a sphere

Bonus calculation: Am I making a mountain out of a molehill?



List *all* the tuples!



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
The PPCG Site design is on its way - help us make it awesome!
Sandbox for Proposed ChallengesOutput a list of all rational numbersMoore IterationNaturally linear Diophantine equationsCo-primality and the number piRotate every row and column in a matrixConvert header levels to numbersASCII DandelionsPrint all decimalsParse a list of lists into a Sad-List2D Array Middle Point










15












$begingroup$


Write a program, given an input n, will generate all possible n-tuples using natural numbers.



n=1
(1),(2),(3),(4),(5),(6)...

n=2
(1,1),(1,2),(2,1),(2,2),(1,3),(3,1),(2,3),(3,2),(3,3)...

n=6
(1,1,1,1,1,1) (1,1,1,1,2,1) (1,1,1,2,1,1)...


  • The output may be in any order that does not break any other rules.

  • The program must be written to run forever and list all applicable tuples exactly once, in theory.

    • In reality, your program will reach your integer type's limit and crash. This is acceptable as long the program would run infinitely long if only your integer type was unlimited.

    • Each valid tuple must be listed within finite time, if only the program were allowed to run that long.


  • The output may, at your option, include zeroes in addition to the natural numbers.

  • You may choose your program's output format for your convenience, as long as the separation between tuples and numbers inside each tuple is clear and consistent. (For example, one tuple per line.)

  • Code-golf rules apply, shortest program wins.

Thanks to "Artemis Fowl" for feedback during the sandbox phase.










share|improve this question











$endgroup$











  • $begingroup$
    For n=6, is it acceptable to produce 0,0 .. 5,5 or does it have to include 6,6?
    $endgroup$
    – Phil H
    3 hours ago










  • $begingroup$
    For n=6, the 6-tuples are (1,1,1,1,1,1) (1,1,1,1,2,1) (1,1,1,2,1,1) etc. I'll add this to the the examples.
    $endgroup$
    – billpg
    3 hours ago






  • 1




    $begingroup$
    Each valid tuple must be listed within finite time, if only the program were allowed to run that long. .. Does this contradict the output being in any order? i.e what if my order is (1,1),(2,1),(3,1)...(n,1) and only once I've gone through every natural number will i print (1,2)
    $endgroup$
    – Expired Data
    3 hours ago










  • $begingroup$
    Fair point, I'll edit the rule.
    $endgroup$
    – billpg
    3 hours ago










  • $begingroup$
    I assume it is valid if when the program crashes it produces some extraneous output in addition to the tuples printed so far, right?
    $endgroup$
    – Luis Mendo
    35 mins ago















15












$begingroup$


Write a program, given an input n, will generate all possible n-tuples using natural numbers.



n=1
(1),(2),(3),(4),(5),(6)...

n=2
(1,1),(1,2),(2,1),(2,2),(1,3),(3,1),(2,3),(3,2),(3,3)...

n=6
(1,1,1,1,1,1) (1,1,1,1,2,1) (1,1,1,2,1,1)...


  • The output may be in any order that does not break any other rules.

  • The program must be written to run forever and list all applicable tuples exactly once, in theory.

    • In reality, your program will reach your integer type's limit and crash. This is acceptable as long the program would run infinitely long if only your integer type was unlimited.

    • Each valid tuple must be listed within finite time, if only the program were allowed to run that long.


  • The output may, at your option, include zeroes in addition to the natural numbers.

  • You may choose your program's output format for your convenience, as long as the separation between tuples and numbers inside each tuple is clear and consistent. (For example, one tuple per line.)

  • Code-golf rules apply, shortest program wins.

Thanks to "Artemis Fowl" for feedback during the sandbox phase.










share|improve this question











$endgroup$











  • $begingroup$
    For n=6, is it acceptable to produce 0,0 .. 5,5 or does it have to include 6,6?
    $endgroup$
    – Phil H
    3 hours ago










  • $begingroup$
    For n=6, the 6-tuples are (1,1,1,1,1,1) (1,1,1,1,2,1) (1,1,1,2,1,1) etc. I'll add this to the the examples.
    $endgroup$
    – billpg
    3 hours ago






  • 1




    $begingroup$
    Each valid tuple must be listed within finite time, if only the program were allowed to run that long. .. Does this contradict the output being in any order? i.e what if my order is (1,1),(2,1),(3,1)...(n,1) and only once I've gone through every natural number will i print (1,2)
    $endgroup$
    – Expired Data
    3 hours ago










  • $begingroup$
    Fair point, I'll edit the rule.
    $endgroup$
    – billpg
    3 hours ago










  • $begingroup$
    I assume it is valid if when the program crashes it produces some extraneous output in addition to the tuples printed so far, right?
    $endgroup$
    – Luis Mendo
    35 mins ago













15












15








15


2



$begingroup$


Write a program, given an input n, will generate all possible n-tuples using natural numbers.



n=1
(1),(2),(3),(4),(5),(6)...

n=2
(1,1),(1,2),(2,1),(2,2),(1,3),(3,1),(2,3),(3,2),(3,3)...

n=6
(1,1,1,1,1,1) (1,1,1,1,2,1) (1,1,1,2,1,1)...


  • The output may be in any order that does not break any other rules.

  • The program must be written to run forever and list all applicable tuples exactly once, in theory.

    • In reality, your program will reach your integer type's limit and crash. This is acceptable as long the program would run infinitely long if only your integer type was unlimited.

    • Each valid tuple must be listed within finite time, if only the program were allowed to run that long.


  • The output may, at your option, include zeroes in addition to the natural numbers.

  • You may choose your program's output format for your convenience, as long as the separation between tuples and numbers inside each tuple is clear and consistent. (For example, one tuple per line.)

  • Code-golf rules apply, shortest program wins.

Thanks to "Artemis Fowl" for feedback during the sandbox phase.










share|improve this question











$endgroup$




Write a program, given an input n, will generate all possible n-tuples using natural numbers.



n=1
(1),(2),(3),(4),(5),(6)...

n=2
(1,1),(1,2),(2,1),(2,2),(1,3),(3,1),(2,3),(3,2),(3,3)...

n=6
(1,1,1,1,1,1) (1,1,1,1,2,1) (1,1,1,2,1,1)...


  • The output may be in any order that does not break any other rules.

  • The program must be written to run forever and list all applicable tuples exactly once, in theory.

    • In reality, your program will reach your integer type's limit and crash. This is acceptable as long the program would run infinitely long if only your integer type was unlimited.

    • Each valid tuple must be listed within finite time, if only the program were allowed to run that long.


  • The output may, at your option, include zeroes in addition to the natural numbers.

  • You may choose your program's output format for your convenience, as long as the separation between tuples and numbers inside each tuple is clear and consistent. (For example, one tuple per line.)

  • Code-golf rules apply, shortest program wins.

Thanks to "Artemis Fowl" for feedback during the sandbox phase.







code-golf sequence






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 3 hours ago







billpg

















asked 3 hours ago









billpgbillpg

9451929




9451929











  • $begingroup$
    For n=6, is it acceptable to produce 0,0 .. 5,5 or does it have to include 6,6?
    $endgroup$
    – Phil H
    3 hours ago










  • $begingroup$
    For n=6, the 6-tuples are (1,1,1,1,1,1) (1,1,1,1,2,1) (1,1,1,2,1,1) etc. I'll add this to the the examples.
    $endgroup$
    – billpg
    3 hours ago






  • 1




    $begingroup$
    Each valid tuple must be listed within finite time, if only the program were allowed to run that long. .. Does this contradict the output being in any order? i.e what if my order is (1,1),(2,1),(3,1)...(n,1) and only once I've gone through every natural number will i print (1,2)
    $endgroup$
    – Expired Data
    3 hours ago










  • $begingroup$
    Fair point, I'll edit the rule.
    $endgroup$
    – billpg
    3 hours ago










  • $begingroup$
    I assume it is valid if when the program crashes it produces some extraneous output in addition to the tuples printed so far, right?
    $endgroup$
    – Luis Mendo
    35 mins ago
















  • $begingroup$
    For n=6, is it acceptable to produce 0,0 .. 5,5 or does it have to include 6,6?
    $endgroup$
    – Phil H
    3 hours ago










  • $begingroup$
    For n=6, the 6-tuples are (1,1,1,1,1,1) (1,1,1,1,2,1) (1,1,1,2,1,1) etc. I'll add this to the the examples.
    $endgroup$
    – billpg
    3 hours ago






  • 1




    $begingroup$
    Each valid tuple must be listed within finite time, if only the program were allowed to run that long. .. Does this contradict the output being in any order? i.e what if my order is (1,1),(2,1),(3,1)...(n,1) and only once I've gone through every natural number will i print (1,2)
    $endgroup$
    – Expired Data
    3 hours ago










  • $begingroup$
    Fair point, I'll edit the rule.
    $endgroup$
    – billpg
    3 hours ago










  • $begingroup$
    I assume it is valid if when the program crashes it produces some extraneous output in addition to the tuples printed so far, right?
    $endgroup$
    – Luis Mendo
    35 mins ago















$begingroup$
For n=6, is it acceptable to produce 0,0 .. 5,5 or does it have to include 6,6?
$endgroup$
– Phil H
3 hours ago




$begingroup$
For n=6, is it acceptable to produce 0,0 .. 5,5 or does it have to include 6,6?
$endgroup$
– Phil H
3 hours ago












$begingroup$
For n=6, the 6-tuples are (1,1,1,1,1,1) (1,1,1,1,2,1) (1,1,1,2,1,1) etc. I'll add this to the the examples.
$endgroup$
– billpg
3 hours ago




$begingroup$
For n=6, the 6-tuples are (1,1,1,1,1,1) (1,1,1,1,2,1) (1,1,1,2,1,1) etc. I'll add this to the the examples.
$endgroup$
– billpg
3 hours ago




1




1




$begingroup$
Each valid tuple must be listed within finite time, if only the program were allowed to run that long. .. Does this contradict the output being in any order? i.e what if my order is (1,1),(2,1),(3,1)...(n,1) and only once I've gone through every natural number will i print (1,2)
$endgroup$
– Expired Data
3 hours ago




$begingroup$
Each valid tuple must be listed within finite time, if only the program were allowed to run that long. .. Does this contradict the output being in any order? i.e what if my order is (1,1),(2,1),(3,1)...(n,1) and only once I've gone through every natural number will i print (1,2)
$endgroup$
– Expired Data
3 hours ago












$begingroup$
Fair point, I'll edit the rule.
$endgroup$
– billpg
3 hours ago




$begingroup$
Fair point, I'll edit the rule.
$endgroup$
– billpg
3 hours ago












$begingroup$
I assume it is valid if when the program crashes it produces some extraneous output in addition to the tuples printed so far, right?
$endgroup$
– Luis Mendo
35 mins ago




$begingroup$
I assume it is valid if when the program crashes it produces some extraneous output in addition to the tuples printed so far, right?
$endgroup$
– Luis Mendo
35 mins ago










4 Answers
4






active

oldest

votes


















4












$begingroup$


Haskell, 62 bytes





([1..]>>=).(!)
0!s=[[]|s<1]
n!s=[a:p|a<-[1..s],p<-(n-1)!(s-a)]


Try it online!



n!s generates all the n-tuples that sum to s.



Then the answer is ([1..]>>=).(!), i.e. n -> [t | s<-[1..], t<-n!s].



This is a function mapping an integer n to an infinite lazy list of tuples (lists of integers).






share|improve this answer









$endgroup$




















    3












    $begingroup$


    Perl 6, 37 bytes





    $++.polymod(1+$++ xx $_-1).say xx *


    Try it online!



    Essentially runs polymod with as many entries as needed, where the modulo is always greater than the input, i.e. 0.polymod( 1,1,1 ), 1.polymod( 2,2,2 ) etc. That way the digit is always within the range. Perl6 won't let me modulo infinity...






    share|improve this answer









    $endgroup$




















      0












      $begingroup$


      VDM-SL, 51 bytes



      g(i)==if i=0thenelsex:nat,y in set g(i-1)


      Recursive set comprehension with sequence concatenation..



      Not on TIO, you could run in a program (if you turn on limits for nat type or it wont terminate):



      functions 
      g:nat->set of ?
      g(i)==if i=0thenelsex:nat,y in set g(i-1)


      Includes the optional 0s in answer otherwise it would be 52 bytes binding on nat1






      share|improve this answer









      $endgroup$




















        0












        $begingroup$


        05AB1E, 15 bytes



        <[>DÅœIùvyœÙvy,


        Inspired by @Lynn's Haskell answer.



        Try it online.



        Explanation:





        < # Decrease the (implicit) input-integer by 1
        [ # Start an infinite loop:
        > # Increase the integer at the top of the stack by 1
        D # And duplicate it (for the next iteration)
        Ŝ # Create lists of national integers that sum to this integer
        Iù # Only leave the lists of a size equal to the input
        v # Loop over each list `y` in this list of lists:
        yœÙ # Get all possible unique permutations of this list `y`
        v # Inner loop over each list `y` in this list of unique permutation lists:
        y, # And output this list `y` with a trailing newline





        share|improve this answer











        $endgroup$








        • 1




          $begingroup$
          When will the program get to [1,2,1]? Remember it has to be within finite time.
          $endgroup$
          – billpg
          3 hours ago










        • $begingroup$
          @billpg Should be fixed now.
          $endgroup$
          – Kevin Cruijssen
          1 hour ago











        Your Answer






        StackExchange.ifUsing("editor", function ()
        StackExchange.using("externalEditor", function ()
        StackExchange.using("snippets", function ()
        StackExchange.snippets.init();
        );
        );
        , "code-snippets");

        StackExchange.ready(function()
        var channelOptions =
        tags: "".split(" "),
        id: "200"
        ;
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function()
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled)
        StackExchange.using("snippets", function()
        createEditor();
        );

        else
        createEditor();

        );

        function createEditor()
        StackExchange.prepareEditor(
        heartbeatType: 'answer',
        autoActivateHeartbeat: false,
        convertImagesToLinks: false,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: null,
        bindNavPrevention: true,
        postfix: "",
        imageUploader:
        brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
        contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
        allowUrls: true
        ,
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        );



        );













        draft saved

        draft discarded


















        StackExchange.ready(
        function ()
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f183225%2flist-all-the-tuples%23new-answer', 'question_page');

        );

        Post as a guest















        Required, but never shown

























        4 Answers
        4






        active

        oldest

        votes








        4 Answers
        4






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        4












        $begingroup$


        Haskell, 62 bytes





        ([1..]>>=).(!)
        0!s=[[]|s<1]
        n!s=[a:p|a<-[1..s],p<-(n-1)!(s-a)]


        Try it online!



        n!s generates all the n-tuples that sum to s.



        Then the answer is ([1..]>>=).(!), i.e. n -> [t | s<-[1..], t<-n!s].



        This is a function mapping an integer n to an infinite lazy list of tuples (lists of integers).






        share|improve this answer









        $endgroup$

















          4












          $begingroup$


          Haskell, 62 bytes





          ([1..]>>=).(!)
          0!s=[[]|s<1]
          n!s=[a:p|a<-[1..s],p<-(n-1)!(s-a)]


          Try it online!



          n!s generates all the n-tuples that sum to s.



          Then the answer is ([1..]>>=).(!), i.e. n -> [t | s<-[1..], t<-n!s].



          This is a function mapping an integer n to an infinite lazy list of tuples (lists of integers).






          share|improve this answer









          $endgroup$















            4












            4








            4





            $begingroup$


            Haskell, 62 bytes





            ([1..]>>=).(!)
            0!s=[[]|s<1]
            n!s=[a:p|a<-[1..s],p<-(n-1)!(s-a)]


            Try it online!



            n!s generates all the n-tuples that sum to s.



            Then the answer is ([1..]>>=).(!), i.e. n -> [t | s<-[1..], t<-n!s].



            This is a function mapping an integer n to an infinite lazy list of tuples (lists of integers).






            share|improve this answer









            $endgroup$




            Haskell, 62 bytes





            ([1..]>>=).(!)
            0!s=[[]|s<1]
            n!s=[a:p|a<-[1..s],p<-(n-1)!(s-a)]


            Try it online!



            n!s generates all the n-tuples that sum to s.



            Then the answer is ([1..]>>=).(!), i.e. n -> [t | s<-[1..], t<-n!s].



            This is a function mapping an integer n to an infinite lazy list of tuples (lists of integers).







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered 3 hours ago









            LynnLynn

            50.9k899233




            50.9k899233





















                3












                $begingroup$


                Perl 6, 37 bytes





                $++.polymod(1+$++ xx $_-1).say xx *


                Try it online!



                Essentially runs polymod with as many entries as needed, where the modulo is always greater than the input, i.e. 0.polymod( 1,1,1 ), 1.polymod( 2,2,2 ) etc. That way the digit is always within the range. Perl6 won't let me modulo infinity...






                share|improve this answer









                $endgroup$

















                  3












                  $begingroup$


                  Perl 6, 37 bytes





                  $++.polymod(1+$++ xx $_-1).say xx *


                  Try it online!



                  Essentially runs polymod with as many entries as needed, where the modulo is always greater than the input, i.e. 0.polymod( 1,1,1 ), 1.polymod( 2,2,2 ) etc. That way the digit is always within the range. Perl6 won't let me modulo infinity...






                  share|improve this answer









                  $endgroup$















                    3












                    3








                    3





                    $begingroup$


                    Perl 6, 37 bytes





                    $++.polymod(1+$++ xx $_-1).say xx *


                    Try it online!



                    Essentially runs polymod with as many entries as needed, where the modulo is always greater than the input, i.e. 0.polymod( 1,1,1 ), 1.polymod( 2,2,2 ) etc. That way the digit is always within the range. Perl6 won't let me modulo infinity...






                    share|improve this answer









                    $endgroup$




                    Perl 6, 37 bytes





                    $++.polymod(1+$++ xx $_-1).say xx *


                    Try it online!



                    Essentially runs polymod with as many entries as needed, where the modulo is always greater than the input, i.e. 0.polymod( 1,1,1 ), 1.polymod( 2,2,2 ) etc. That way the digit is always within the range. Perl6 won't let me modulo infinity...







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered 2 hours ago









                    Phil HPhil H

                    1,152817




                    1,152817





















                        0












                        $begingroup$


                        VDM-SL, 51 bytes



                        g(i)==if i=0thenelsex:nat,y in set g(i-1)


                        Recursive set comprehension with sequence concatenation..



                        Not on TIO, you could run in a program (if you turn on limits for nat type or it wont terminate):



                        functions 
                        g:nat->set of ?
                        g(i)==if i=0thenelsex:nat,y in set g(i-1)


                        Includes the optional 0s in answer otherwise it would be 52 bytes binding on nat1






                        share|improve this answer









                        $endgroup$

















                          0












                          $begingroup$


                          VDM-SL, 51 bytes



                          g(i)==if i=0thenelsex:nat,y in set g(i-1)


                          Recursive set comprehension with sequence concatenation..



                          Not on TIO, you could run in a program (if you turn on limits for nat type or it wont terminate):



                          functions 
                          g:nat->set of ?
                          g(i)==if i=0thenelsex:nat,y in set g(i-1)


                          Includes the optional 0s in answer otherwise it would be 52 bytes binding on nat1






                          share|improve this answer









                          $endgroup$















                            0












                            0








                            0





                            $begingroup$


                            VDM-SL, 51 bytes



                            g(i)==if i=0thenelsex:nat,y in set g(i-1)


                            Recursive set comprehension with sequence concatenation..



                            Not on TIO, you could run in a program (if you turn on limits for nat type or it wont terminate):



                            functions 
                            g:nat->set of ?
                            g(i)==if i=0thenelsex:nat,y in set g(i-1)


                            Includes the optional 0s in answer otherwise it would be 52 bytes binding on nat1






                            share|improve this answer









                            $endgroup$




                            VDM-SL, 51 bytes



                            g(i)==if i=0thenelsex:nat,y in set g(i-1)


                            Recursive set comprehension with sequence concatenation..



                            Not on TIO, you could run in a program (if you turn on limits for nat type or it wont terminate):



                            functions 
                            g:nat->set of ?
                            g(i)==if i=0thenelsex:nat,y in set g(i-1)


                            Includes the optional 0s in answer otherwise it would be 52 bytes binding on nat1







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered 1 hour ago









                            Expired DataExpired Data

                            948217




                            948217





















                                0












                                $begingroup$


                                05AB1E, 15 bytes



                                <[>DÅœIùvyœÙvy,


                                Inspired by @Lynn's Haskell answer.



                                Try it online.



                                Explanation:





                                < # Decrease the (implicit) input-integer by 1
                                [ # Start an infinite loop:
                                > # Increase the integer at the top of the stack by 1
                                D # And duplicate it (for the next iteration)
                                Ŝ # Create lists of national integers that sum to this integer
                                Iù # Only leave the lists of a size equal to the input
                                v # Loop over each list `y` in this list of lists:
                                yœÙ # Get all possible unique permutations of this list `y`
                                v # Inner loop over each list `y` in this list of unique permutation lists:
                                y, # And output this list `y` with a trailing newline





                                share|improve this answer











                                $endgroup$








                                • 1




                                  $begingroup$
                                  When will the program get to [1,2,1]? Remember it has to be within finite time.
                                  $endgroup$
                                  – billpg
                                  3 hours ago










                                • $begingroup$
                                  @billpg Should be fixed now.
                                  $endgroup$
                                  – Kevin Cruijssen
                                  1 hour ago















                                0












                                $begingroup$


                                05AB1E, 15 bytes



                                <[>DÅœIùvyœÙvy,


                                Inspired by @Lynn's Haskell answer.



                                Try it online.



                                Explanation:





                                < # Decrease the (implicit) input-integer by 1
                                [ # Start an infinite loop:
                                > # Increase the integer at the top of the stack by 1
                                D # And duplicate it (for the next iteration)
                                Ŝ # Create lists of national integers that sum to this integer
                                Iù # Only leave the lists of a size equal to the input
                                v # Loop over each list `y` in this list of lists:
                                yœÙ # Get all possible unique permutations of this list `y`
                                v # Inner loop over each list `y` in this list of unique permutation lists:
                                y, # And output this list `y` with a trailing newline





                                share|improve this answer











                                $endgroup$








                                • 1




                                  $begingroup$
                                  When will the program get to [1,2,1]? Remember it has to be within finite time.
                                  $endgroup$
                                  – billpg
                                  3 hours ago










                                • $begingroup$
                                  @billpg Should be fixed now.
                                  $endgroup$
                                  – Kevin Cruijssen
                                  1 hour ago













                                0












                                0








                                0





                                $begingroup$


                                05AB1E, 15 bytes



                                <[>DÅœIùvyœÙvy,


                                Inspired by @Lynn's Haskell answer.



                                Try it online.



                                Explanation:





                                < # Decrease the (implicit) input-integer by 1
                                [ # Start an infinite loop:
                                > # Increase the integer at the top of the stack by 1
                                D # And duplicate it (for the next iteration)
                                Ŝ # Create lists of national integers that sum to this integer
                                Iù # Only leave the lists of a size equal to the input
                                v # Loop over each list `y` in this list of lists:
                                yœÙ # Get all possible unique permutations of this list `y`
                                v # Inner loop over each list `y` in this list of unique permutation lists:
                                y, # And output this list `y` with a trailing newline





                                share|improve this answer











                                $endgroup$




                                05AB1E, 15 bytes



                                <[>DÅœIùvyœÙvy,


                                Inspired by @Lynn's Haskell answer.



                                Try it online.



                                Explanation:





                                < # Decrease the (implicit) input-integer by 1
                                [ # Start an infinite loop:
                                > # Increase the integer at the top of the stack by 1
                                D # And duplicate it (for the next iteration)
                                Ŝ # Create lists of national integers that sum to this integer
                                Iù # Only leave the lists of a size equal to the input
                                v # Loop over each list `y` in this list of lists:
                                yœÙ # Get all possible unique permutations of this list `y`
                                v # Inner loop over each list `y` in this list of unique permutation lists:
                                y, # And output this list `y` with a trailing newline






                                share|improve this answer














                                share|improve this answer



                                share|improve this answer








                                edited 1 hour ago

























                                answered 3 hours ago









                                Kevin CruijssenKevin Cruijssen

                                42.8k571217




                                42.8k571217







                                • 1




                                  $begingroup$
                                  When will the program get to [1,2,1]? Remember it has to be within finite time.
                                  $endgroup$
                                  – billpg
                                  3 hours ago










                                • $begingroup$
                                  @billpg Should be fixed now.
                                  $endgroup$
                                  – Kevin Cruijssen
                                  1 hour ago












                                • 1




                                  $begingroup$
                                  When will the program get to [1,2,1]? Remember it has to be within finite time.
                                  $endgroup$
                                  – billpg
                                  3 hours ago










                                • $begingroup$
                                  @billpg Should be fixed now.
                                  $endgroup$
                                  – Kevin Cruijssen
                                  1 hour ago







                                1




                                1




                                $begingroup$
                                When will the program get to [1,2,1]? Remember it has to be within finite time.
                                $endgroup$
                                – billpg
                                3 hours ago




                                $begingroup$
                                When will the program get to [1,2,1]? Remember it has to be within finite time.
                                $endgroup$
                                – billpg
                                3 hours ago












                                $begingroup$
                                @billpg Should be fixed now.
                                $endgroup$
                                – Kevin Cruijssen
                                1 hour ago




                                $begingroup$
                                @billpg Should be fixed now.
                                $endgroup$
                                – Kevin Cruijssen
                                1 hour ago

















                                draft saved

                                draft discarded
















































                                If this is an answer to a challenge…



                                • …Be sure to follow the challenge specification. However, please refrain from exploiting obvious loopholes. Answers abusing any of the standard loopholes are considered invalid. If you think a specification is unclear or underspecified, comment on the question instead.


                                • …Try to optimize your score. For instance, answers to code-golf challenges should attempt to be as short as possible. You can always include a readable version of the code in addition to the competitive one.
                                  Explanations of your answer make it more interesting to read and are very much encouraged.


                                • …Include a short header which indicates the language(s) of your code and its score, as defined by the challenge.


                                More generally…



                                • …Please make sure to answer the question and provide sufficient detail.


                                • …Avoid asking for help, clarification or responding to other answers (use comments instead).




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function ()
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f183225%2flist-all-the-tuples%23new-answer', 'question_page');

                                );

                                Post as a guest















                                Required, but never shown





















































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown

































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown







                                Popular posts from this blog

                                Bett Inhaltsverzeichnis Geschichte | Bettformen | Bettgrößen | Andere Bezeichnungen | Bettenmangel | Betten in der bildenden Kunst | Schlafmedizinische Gesichtspunkte | Siehe auch | Literatur | Weblinks | Einzelnachweise | NavigationsmenüBett, Bettstatt, BettstelleCommons: BettBabybetten: Anwendung, Ausstattungsmerkmale und VergleichskriterienWasserbetten. Vorurteile im TestHapfnNursch10.1007/s11818-012-0584-74006250-8AKS4329276-8

                                Luksemburg Sisukord Nimi | Asend | Loodus | Riigikord | Haldusjaotus | Rahvastik | Riigikaitse | Majandus | Taristu | Ajalugu | Eesti ja Luksemburgi suhted | Haridus | Kultuur | Vaata ka | Viited | Välislingid | Navigeerimismenüü50° N, 6° EÜlevaade Luksemburgi kaitsealadest.Luksemburgi rahvaarv. Statistikaamet.World Bank'i andmebaasÜlevaade Luksemburgi loodusest.Ülevaade Luksemburgi metsadest.Guy Colling. "Red List of the Vascular Plants of Luxembourg." Travaux scientifiques du Musée national d’histoire naturelle Luxembourg. 2005.Luxembourg’s biodiversity at risk.Maailma kahepaiksete andmebaas.Denis Lepage. "Luxembourg." Avibase.Ülevaade temperatuuridest. Luksemburgi meteoroloogiateenistus.Ülevaade Luksemburgist. Euroopa Liidu esinduse koduleht.Système politique. TerritoireÜlevaade Luksemburgi rahvastikust. Luksemburgi statistikaamet.Luksemburgi rahvastik. Luksemburgi statistikaamet.The World FactbookMonique Borsenberger, Paul Dickes. "Religions au Luxembourg. Quelle évolution entre 1999-2008". Luksemburgi statistikaamet. 2011.Luksemburgi peapiiskopkond. Catholic-Hierarchy.Luksemburgi armee koduleht.Luksemburgi armee relvastus.Eesti Välisministeerium.Luksemburgi rahvastik. Luksemburgi statistikaamet.Luksemburgi Eesti Seltsi koduleht.Helen Eelrand. "Raadio, mis muutis maailma." Eesti Päevaleht. 13. märts 2004.Ülevaade Luksemburgi haridussüsteemist.Ülevaade Luksemburgi keskkoolidest.Luksemburgr

                                Valle di Casies Indice Geografia fisica | Origini del nome | Storia | Società | Amministrazione | Sport | Note | Bibliografia | Voci correlate | Altri progetti | Collegamenti esterni | Menu di navigazione46°46′N 12°11′E / 46.766667°N 12.183333°E46.766667; 12.183333 (Valle di Casies)46°46′N 12°11′E / 46.766667°N 12.183333°E46.766667; 12.183333 (Valle di Casies)Sito istituzionaleAstat Censimento della popolazione 2011 - Determinazione della consistenza dei tre gruppi linguistici della Provincia Autonoma di Bolzano-Alto Adige - giugno 2012Numeri e fattiValle di CasiesDato IstatTabella dei gradi/giorno dei Comuni italiani raggruppati per Regione e Provincia26 agosto 1993, n. 412Heraldry of the World: GsiesStatistiche I.StatValCasies.comWikimedia CommonsWikimedia CommonsValle di CasiesSito ufficialeValle di CasiesMM14870458910042978-6