The first, the last, and everything between

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












Given two integers, output the two integers, and then the range between them:



Examples:



 Input Output
0, 5 -> [0, 5, 1, 2, 3, 4]
-3, 8 -> [-3, 8, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7]
4, 4 -> [4, 4]
4, 5 -> [4, 5]
8, 2 -> [8, 2, 7, 6, 5, 4, 3]
-2, -7 -> [-2, -7, -3, -4, -5, -6]









share|improve this question



























    up vote
    1
    down vote

    favorite












    Given two integers, output the two integers, and then the range between them:



    Examples:



     Input Output
    0, 5 -> [0, 5, 1, 2, 3, 4]
    -3, 8 -> [-3, 8, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7]
    4, 4 -> [4, 4]
    4, 5 -> [4, 5]
    8, 2 -> [8, 2, 7, 6, 5, 4, 3]
    -2, -7 -> [-2, -7, -3, -4, -5, -6]









    share|improve this question

























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      Given two integers, output the two integers, and then the range between them:



      Examples:



       Input Output
      0, 5 -> [0, 5, 1, 2, 3, 4]
      -3, 8 -> [-3, 8, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7]
      4, 4 -> [4, 4]
      4, 5 -> [4, 5]
      8, 2 -> [8, 2, 7, 6, 5, 4, 3]
      -2, -7 -> [-2, -7, -3, -4, -5, -6]









      share|improve this question















      Given two integers, output the two integers, and then the range between them:



      Examples:



       Input Output
      0, 5 -> [0, 5, 1, 2, 3, 4]
      -3, 8 -> [-3, 8, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7]
      4, 4 -> [4, 4]
      4, 5 -> [4, 5]
      8, 2 -> [8, 2, 7, 6, 5, 4, 3]
      -2, -7 -> [-2, -7, -3, -4, -5, -6]






      code-golf






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 5 mins ago

























      asked 31 mins ago









      TFeld

      13k2836




      13k2836




















          3 Answers
          3






          active

          oldest

          votes

















          up vote
          1
          down vote














          Ruby, 33 bytes





          ->a,b[a,b]


          Try it online!






          share|improve this answer





























            up vote
            1
            down vote














            05AB1E, 4 bytes



            Ÿ¦¨«


            Try it online!



            Explanation



             Ÿ # inclusive range [a ... b]
            ¦¨ # remove the first and last element
            « # append to input





            share|improve this answer



























              up vote
              1
              down vote













              Japt, 8 bytes



              cUrõ ÅÔÅ


              Try it here






              share|improve this answer






















              • @TFeld: Fixed it
                – Shaggy
                11 mins ago










              Your Answer





              StackExchange.ifUsing("editor", function ()
              return StackExchange.using("mathjaxEditing", function ()
              StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
              StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["\$", "\$"]]);
              );
              );
              , "mathjax-editing");

              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',
              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%2f175485%2fthe-first-the-last-and-everything-between%23new-answer', 'question_page');

              );

              Post as a guest






























              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              1
              down vote














              Ruby, 33 bytes





              ->a,b[a,b]


              Try it online!






              share|improve this answer


























                up vote
                1
                down vote














                Ruby, 33 bytes





                ->a,b[a,b]


                Try it online!






                share|improve this answer
























                  up vote
                  1
                  down vote










                  up vote
                  1
                  down vote










                  Ruby, 33 bytes





                  ->a,b[a,b]


                  Try it online!






                  share|improve this answer















                  Ruby, 33 bytes





                  ->a,b[a,b]


                  Try it online!







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited 16 mins ago

























                  answered 22 mins ago









                  G B

                  7,3961327




                  7,3961327




















                      up vote
                      1
                      down vote














                      05AB1E, 4 bytes



                      Ÿ¦¨«


                      Try it online!



                      Explanation



                       Ÿ # inclusive range [a ... b]
                      ¦¨ # remove the first and last element
                      « # append to input





                      share|improve this answer
























                        up vote
                        1
                        down vote














                        05AB1E, 4 bytes



                        Ÿ¦¨«


                        Try it online!



                        Explanation



                         Ÿ # inclusive range [a ... b]
                        ¦¨ # remove the first and last element
                        « # append to input





                        share|improve this answer






















                          up vote
                          1
                          down vote










                          up vote
                          1
                          down vote










                          05AB1E, 4 bytes



                          Ÿ¦¨«


                          Try it online!



                          Explanation



                           Ÿ # inclusive range [a ... b]
                          ¦¨ # remove the first and last element
                          « # append to input





                          share|improve this answer













                          05AB1E, 4 bytes



                          Ÿ¦¨«


                          Try it online!



                          Explanation



                           Ÿ # inclusive range [a ... b]
                          ¦¨ # remove the first and last element
                          « # append to input






                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered 14 mins ago









                          Emigna

                          44.4k431135




                          44.4k431135




















                              up vote
                              1
                              down vote













                              Japt, 8 bytes



                              cUrõ ÅÔÅ


                              Try it here






                              share|improve this answer






















                              • @TFeld: Fixed it
                                – Shaggy
                                11 mins ago














                              up vote
                              1
                              down vote













                              Japt, 8 bytes



                              cUrõ ÅÔÅ


                              Try it here






                              share|improve this answer






















                              • @TFeld: Fixed it
                                – Shaggy
                                11 mins ago












                              up vote
                              1
                              down vote










                              up vote
                              1
                              down vote









                              Japt, 8 bytes



                              cUrõ ÅÔÅ


                              Try it here






                              share|improve this answer














                              Japt, 8 bytes



                              cUrõ ÅÔÅ


                              Try it here







                              share|improve this answer














                              share|improve this answer



                              share|improve this answer








                              edited 11 mins ago

























                              answered 17 mins ago









                              Shaggy

                              17.7k21663




                              17.7k21663











                              • @TFeld: Fixed it
                                – Shaggy
                                11 mins ago
















                              • @TFeld: Fixed it
                                – Shaggy
                                11 mins ago















                              @TFeld: Fixed it
                              – Shaggy
                              11 mins ago




                              @TFeld: Fixed it
                              – Shaggy
                              11 mins ago

















                               

                              draft saved


                              draft discarded















































                               


                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f175485%2fthe-first-the-last-and-everything-between%23new-answer', 'question_page');

                              );

                              Post as a guest













































































                              Comments

                              Popular posts from this blog

                              What does second last employer means? [closed]

                              List of Gilmore Girls characters

                              Confectionery