PronunciationSort™

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











up vote
2
down vote

favorite












We all know of different fancy sorting algorithms, but none of these give us numbers in a way that's easy to pronounce. To remedy this, I propose using PronunciationSort™, the most natural way to sort lists of numbers.



Pronunciation



The official rules for pronouncing numbers (in this challenge) is that the digits are pronounced one by one, and the resulting string is sorted in lexicographic order. As an example, this means that the number 845 is pronounced "eight four five", and should be sorted accordingly.



Negative numbers



Negative numbers are pronounced by prepending the word "minus". Thus, -23 is pronounced as "minus two three". Note that this causes negative numbers to end up in the middle of the output, right between numbers starting with 4 (four) and 9 (nine). It is permissible to interpret 0 as "minus zero" if your language somehow could produce such a thing.



As a guide, the official order of words for PronunciationSort™ is:



  • eight

  • five

  • four

  • minus

  • nine

  • one

  • seven

  • six

  • three

  • two

  • zero

Input



A list of integers in the range $[-999, 999]$, containing at most 100 elements.



Output



The same integers, in PronunciationSort™ order. Note that the numbers should only be converted to their pronunciations to get the sorting, the output should not contain any strings.



Examples



For the examples, the middle step (wrapped in parentheses) only serves as a guide, and is not a part of the output.



[1, 2, 3] -> (['one', 'two', 'three']) -> [1, 3, 2]
[-1, 0, 1, 2] -> (['minus one', 'zero', 'one', 'two']) -> [-1, 1, 2, 0]
[-100, 45, 96] -> (['minus one zero zero', 'four five', 'nine six']) -> [45, -100, 96]
[11, 12, 13, 134, 135] -> (['one one', 'one two', 'one three', 'one three four', 'one three five']) -> [11, 13, 135, 134, 12]


There's also a script for verifying your results.










share|improve this question





















  • Related
    – Arnauld
    20 mins ago














up vote
2
down vote

favorite












We all know of different fancy sorting algorithms, but none of these give us numbers in a way that's easy to pronounce. To remedy this, I propose using PronunciationSort™, the most natural way to sort lists of numbers.



Pronunciation



The official rules for pronouncing numbers (in this challenge) is that the digits are pronounced one by one, and the resulting string is sorted in lexicographic order. As an example, this means that the number 845 is pronounced "eight four five", and should be sorted accordingly.



Negative numbers



Negative numbers are pronounced by prepending the word "minus". Thus, -23 is pronounced as "minus two three". Note that this causes negative numbers to end up in the middle of the output, right between numbers starting with 4 (four) and 9 (nine). It is permissible to interpret 0 as "minus zero" if your language somehow could produce such a thing.



As a guide, the official order of words for PronunciationSort™ is:



  • eight

  • five

  • four

  • minus

  • nine

  • one

  • seven

  • six

  • three

  • two

  • zero

Input



A list of integers in the range $[-999, 999]$, containing at most 100 elements.



Output



The same integers, in PronunciationSort™ order. Note that the numbers should only be converted to their pronunciations to get the sorting, the output should not contain any strings.



Examples



For the examples, the middle step (wrapped in parentheses) only serves as a guide, and is not a part of the output.



[1, 2, 3] -> (['one', 'two', 'three']) -> [1, 3, 2]
[-1, 0, 1, 2] -> (['minus one', 'zero', 'one', 'two']) -> [-1, 1, 2, 0]
[-100, 45, 96] -> (['minus one zero zero', 'four five', 'nine six']) -> [45, -100, 96]
[11, 12, 13, 134, 135] -> (['one one', 'one two', 'one three', 'one three four', 'one three five']) -> [11, 13, 135, 134, 12]


There's also a script for verifying your results.










share|improve this question





















  • Related
    – Arnauld
    20 mins ago












up vote
2
down vote

favorite









up vote
2
down vote

favorite











We all know of different fancy sorting algorithms, but none of these give us numbers in a way that's easy to pronounce. To remedy this, I propose using PronunciationSort™, the most natural way to sort lists of numbers.



Pronunciation



The official rules for pronouncing numbers (in this challenge) is that the digits are pronounced one by one, and the resulting string is sorted in lexicographic order. As an example, this means that the number 845 is pronounced "eight four five", and should be sorted accordingly.



Negative numbers



Negative numbers are pronounced by prepending the word "minus". Thus, -23 is pronounced as "minus two three". Note that this causes negative numbers to end up in the middle of the output, right between numbers starting with 4 (four) and 9 (nine). It is permissible to interpret 0 as "minus zero" if your language somehow could produce such a thing.



As a guide, the official order of words for PronunciationSort™ is:



  • eight

  • five

  • four

  • minus

  • nine

  • one

  • seven

  • six

  • three

  • two

  • zero

Input



A list of integers in the range $[-999, 999]$, containing at most 100 elements.



Output



The same integers, in PronunciationSort™ order. Note that the numbers should only be converted to their pronunciations to get the sorting, the output should not contain any strings.



Examples



For the examples, the middle step (wrapped in parentheses) only serves as a guide, and is not a part of the output.



[1, 2, 3] -> (['one', 'two', 'three']) -> [1, 3, 2]
[-1, 0, 1, 2] -> (['minus one', 'zero', 'one', 'two']) -> [-1, 1, 2, 0]
[-100, 45, 96] -> (['minus one zero zero', 'four five', 'nine six']) -> [45, -100, 96]
[11, 12, 13, 134, 135] -> (['one one', 'one two', 'one three', 'one three four', 'one three five']) -> [11, 13, 135, 134, 12]


There's also a script for verifying your results.










share|improve this question













We all know of different fancy sorting algorithms, but none of these give us numbers in a way that's easy to pronounce. To remedy this, I propose using PronunciationSort™, the most natural way to sort lists of numbers.



Pronunciation



The official rules for pronouncing numbers (in this challenge) is that the digits are pronounced one by one, and the resulting string is sorted in lexicographic order. As an example, this means that the number 845 is pronounced "eight four five", and should be sorted accordingly.



Negative numbers



Negative numbers are pronounced by prepending the word "minus". Thus, -23 is pronounced as "minus two three". Note that this causes negative numbers to end up in the middle of the output, right between numbers starting with 4 (four) and 9 (nine). It is permissible to interpret 0 as "minus zero" if your language somehow could produce such a thing.



As a guide, the official order of words for PronunciationSort™ is:



  • eight

  • five

  • four

  • minus

  • nine

  • one

  • seven

  • six

  • three

  • two

  • zero

Input



A list of integers in the range $[-999, 999]$, containing at most 100 elements.



Output



The same integers, in PronunciationSort™ order. Note that the numbers should only be converted to their pronunciations to get the sorting, the output should not contain any strings.



Examples



For the examples, the middle step (wrapped in parentheses) only serves as a guide, and is not a part of the output.



[1, 2, 3] -> (['one', 'two', 'three']) -> [1, 3, 2]
[-1, 0, 1, 2] -> (['minus one', 'zero', 'one', 'two']) -> [-1, 1, 2, 0]
[-100, 45, 96] -> (['minus one zero zero', 'four five', 'nine six']) -> [45, -100, 96]
[11, 12, 13, 134, 135] -> (['one one', 'one two', 'one three', 'one three four', 'one three five']) -> [11, 13, 135, 134, 12]


There's also a script for verifying your results.







code-golf string sorting natural-language






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 55 mins ago









maxb

1,3741519




1,3741519











  • Related
    – Arnauld
    20 mins ago
















  • Related
    – Arnauld
    20 mins ago















Related
– Arnauld
20 mins ago




Related
– Arnauld
20 mins ago










7 Answers
7






active

oldest

votes

















up vote
1
down vote














Retina 0.8.2, 36 bytes



T`-d`3:598217604
O`
T`3:598217604`-d


Try it online! Link includes test suite. Explanation:



T`-d`3:598217604


Translate the minus sign and digits to their position in pronunciation order, using : for 10th position.



O`


Sort in pronunciation order.



T`3:598217604`-d


Translate the order back to the original minus sign and digits.






share|improve this answer



























    up vote
    1
    down vote














    K (ngn/k), 21 20 bytes



    x@<"54-9176320"?$x


    Try it online!



    function with argument x



    $ format as strings



    "..."? find indices of individual characters in the given string (or $-2^63$ for "not found" - note that the "8" is missing)



    < compute sort-ascending permutation



    x@ the argument at those indices






    share|improve this answer





























      up vote
      0
      down vote














      JavaScript (SpiderMonkey), 87 73 bytes





      a=>a.sort((p,q,F=b=>[...""+b].map(x=>"54-9176320".search(x)))=>F(p)>F(q))


      Try it online!



      Thanks @Arnauld for telling that the sort in SpiderMonkey is stable, so the ||-(F(q)>F(p)) part can finally be dropped.






      share|improve this answer





























        up vote
        0
        down vote














        JavaScript (SpiderMonkey), 69 bytes





        a=>a.sort((a,b)=>(g=n=>[...n+''].map(c=>':598217604'[c]||3))(a)>g(b))


        Try it online!






        share|improve this answer






















        • Won't work for [-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10], which is why my solution is 14 bytes longer.
          – Shieru Asakoto
          25 mins ago











        • @ShieruAsakoto This works with SpiderMonkey, which is using a stable sort.
          – Arnauld
          24 mins ago










        • Oh then mine can be 73 bytes too.
          – Shieru Asakoto
          24 mins ago










        • It looks like you can remove the +'', seeing as you're taking input as an array of strings.
          – Shaggy
          21 mins ago










        • @Shaggy I'm not taking strings anymore, as I'm not sure if that's allowed here.
          – Arnauld
          20 mins ago

















        up vote
        0
        down vote













        Japt, 19 bytes



        -2 bytes if we can take input as an array of strings.



        ñ_s £"54-9176320"bX


        Try it






        share|improve this answer



























          up vote
          0
          down vote













          Pyth, 17 bytes



          oxL"854-9176320"`


          Try it online here, or verify all the test cases at once here.



          oxL"854-9176320"`NQ Implicit: Q=eval(input())
          Trailing N, Q inferred
          o Q Order the elements of Q, as N, using...
          `N Convert N to string
          xL Get the index of each character of that string...
          "854-9176320" ... in the lookup ordering





          share|improve this answer



























            up vote
            0
            down vote














            05AB1E (legacy), 15 bytes



            Σε•Koéa₃•'-3ǝsk


            Try it online!





            share




















              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: false,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              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%2f172891%2fpronunciationsort%23new-answer', 'question_page');

              );

              Post as a guest






























              7 Answers
              7






              active

              oldest

              votes








              7 Answers
              7






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              1
              down vote














              Retina 0.8.2, 36 bytes



              T`-d`3:598217604
              O`
              T`3:598217604`-d


              Try it online! Link includes test suite. Explanation:



              T`-d`3:598217604


              Translate the minus sign and digits to their position in pronunciation order, using : for 10th position.



              O`


              Sort in pronunciation order.



              T`3:598217604`-d


              Translate the order back to the original minus sign and digits.






              share|improve this answer
























                up vote
                1
                down vote














                Retina 0.8.2, 36 bytes



                T`-d`3:598217604
                O`
                T`3:598217604`-d


                Try it online! Link includes test suite. Explanation:



                T`-d`3:598217604


                Translate the minus sign and digits to their position in pronunciation order, using : for 10th position.



                O`


                Sort in pronunciation order.



                T`3:598217604`-d


                Translate the order back to the original minus sign and digits.






                share|improve this answer






















                  up vote
                  1
                  down vote










                  up vote
                  1
                  down vote










                  Retina 0.8.2, 36 bytes



                  T`-d`3:598217604
                  O`
                  T`3:598217604`-d


                  Try it online! Link includes test suite. Explanation:



                  T`-d`3:598217604


                  Translate the minus sign and digits to their position in pronunciation order, using : for 10th position.



                  O`


                  Sort in pronunciation order.



                  T`3:598217604`-d


                  Translate the order back to the original minus sign and digits.






                  share|improve this answer













                  Retina 0.8.2, 36 bytes



                  T`-d`3:598217604
                  O`
                  T`3:598217604`-d


                  Try it online! Link includes test suite. Explanation:



                  T`-d`3:598217604


                  Translate the minus sign and digits to their position in pronunciation order, using : for 10th position.



                  O`


                  Sort in pronunciation order.



                  T`3:598217604`-d


                  Translate the order back to the original minus sign and digits.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 40 mins ago









                  Neil

                  75.7k744171




                  75.7k744171




















                      up vote
                      1
                      down vote














                      K (ngn/k), 21 20 bytes



                      x@<"54-9176320"?$x


                      Try it online!



                      function with argument x



                      $ format as strings



                      "..."? find indices of individual characters in the given string (or $-2^63$ for "not found" - note that the "8" is missing)



                      < compute sort-ascending permutation



                      x@ the argument at those indices






                      share|improve this answer


























                        up vote
                        1
                        down vote














                        K (ngn/k), 21 20 bytes



                        x@<"54-9176320"?$x


                        Try it online!



                        function with argument x



                        $ format as strings



                        "..."? find indices of individual characters in the given string (or $-2^63$ for "not found" - note that the "8" is missing)



                        < compute sort-ascending permutation



                        x@ the argument at those indices






                        share|improve this answer
























                          up vote
                          1
                          down vote










                          up vote
                          1
                          down vote










                          K (ngn/k), 21 20 bytes



                          x@<"54-9176320"?$x


                          Try it online!



                          function with argument x



                          $ format as strings



                          "..."? find indices of individual characters in the given string (or $-2^63$ for "not found" - note that the "8" is missing)



                          < compute sort-ascending permutation



                          x@ the argument at those indices






                          share|improve this answer















                          K (ngn/k), 21 20 bytes



                          x@<"54-9176320"?$x


                          Try it online!



                          function with argument x



                          $ format as strings



                          "..."? find indices of individual characters in the given string (or $-2^63$ for "not found" - note that the "8" is missing)



                          < compute sort-ascending permutation



                          x@ the argument at those indices







                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited 16 mins ago

























                          answered 43 mins ago









                          ngn

                          6,23812357




                          6,23812357




















                              up vote
                              0
                              down vote














                              JavaScript (SpiderMonkey), 87 73 bytes





                              a=>a.sort((p,q,F=b=>[...""+b].map(x=>"54-9176320".search(x)))=>F(p)>F(q))


                              Try it online!



                              Thanks @Arnauld for telling that the sort in SpiderMonkey is stable, so the ||-(F(q)>F(p)) part can finally be dropped.






                              share|improve this answer


























                                up vote
                                0
                                down vote














                                JavaScript (SpiderMonkey), 87 73 bytes





                                a=>a.sort((p,q,F=b=>[...""+b].map(x=>"54-9176320".search(x)))=>F(p)>F(q))


                                Try it online!



                                Thanks @Arnauld for telling that the sort in SpiderMonkey is stable, so the ||-(F(q)>F(p)) part can finally be dropped.






                                share|improve this answer
























                                  up vote
                                  0
                                  down vote










                                  up vote
                                  0
                                  down vote










                                  JavaScript (SpiderMonkey), 87 73 bytes





                                  a=>a.sort((p,q,F=b=>[...""+b].map(x=>"54-9176320".search(x)))=>F(p)>F(q))


                                  Try it online!



                                  Thanks @Arnauld for telling that the sort in SpiderMonkey is stable, so the ||-(F(q)>F(p)) part can finally be dropped.






                                  share|improve this answer















                                  JavaScript (SpiderMonkey), 87 73 bytes





                                  a=>a.sort((p,q,F=b=>[...""+b].map(x=>"54-9176320".search(x)))=>F(p)>F(q))


                                  Try it online!



                                  Thanks @Arnauld for telling that the sort in SpiderMonkey is stable, so the ||-(F(q)>F(p)) part can finally be dropped.







                                  share|improve this answer














                                  share|improve this answer



                                  share|improve this answer








                                  edited 23 mins ago

























                                  answered 29 mins ago









                                  Shieru Asakoto

                                  1,640311




                                  1,640311




















                                      up vote
                                      0
                                      down vote














                                      JavaScript (SpiderMonkey), 69 bytes





                                      a=>a.sort((a,b)=>(g=n=>[...n+''].map(c=>':598217604'[c]||3))(a)>g(b))


                                      Try it online!






                                      share|improve this answer






















                                      • Won't work for [-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10], which is why my solution is 14 bytes longer.
                                        – Shieru Asakoto
                                        25 mins ago











                                      • @ShieruAsakoto This works with SpiderMonkey, which is using a stable sort.
                                        – Arnauld
                                        24 mins ago










                                      • Oh then mine can be 73 bytes too.
                                        – Shieru Asakoto
                                        24 mins ago










                                      • It looks like you can remove the +'', seeing as you're taking input as an array of strings.
                                        – Shaggy
                                        21 mins ago










                                      • @Shaggy I'm not taking strings anymore, as I'm not sure if that's allowed here.
                                        – Arnauld
                                        20 mins ago














                                      up vote
                                      0
                                      down vote














                                      JavaScript (SpiderMonkey), 69 bytes





                                      a=>a.sort((a,b)=>(g=n=>[...n+''].map(c=>':598217604'[c]||3))(a)>g(b))


                                      Try it online!






                                      share|improve this answer






















                                      • Won't work for [-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10], which is why my solution is 14 bytes longer.
                                        – Shieru Asakoto
                                        25 mins ago











                                      • @ShieruAsakoto This works with SpiderMonkey, which is using a stable sort.
                                        – Arnauld
                                        24 mins ago










                                      • Oh then mine can be 73 bytes too.
                                        – Shieru Asakoto
                                        24 mins ago










                                      • It looks like you can remove the +'', seeing as you're taking input as an array of strings.
                                        – Shaggy
                                        21 mins ago










                                      • @Shaggy I'm not taking strings anymore, as I'm not sure if that's allowed here.
                                        – Arnauld
                                        20 mins ago












                                      up vote
                                      0
                                      down vote










                                      up vote
                                      0
                                      down vote










                                      JavaScript (SpiderMonkey), 69 bytes





                                      a=>a.sort((a,b)=>(g=n=>[...n+''].map(c=>':598217604'[c]||3))(a)>g(b))


                                      Try it online!






                                      share|improve this answer















                                      JavaScript (SpiderMonkey), 69 bytes





                                      a=>a.sort((a,b)=>(g=n=>[...n+''].map(c=>':598217604'[c]||3))(a)>g(b))


                                      Try it online!







                                      share|improve this answer














                                      share|improve this answer



                                      share|improve this answer








                                      edited 22 mins ago

























                                      answered 29 mins ago









                                      Arnauld

                                      65.1k581275




                                      65.1k581275











                                      • Won't work for [-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10], which is why my solution is 14 bytes longer.
                                        – Shieru Asakoto
                                        25 mins ago











                                      • @ShieruAsakoto This works with SpiderMonkey, which is using a stable sort.
                                        – Arnauld
                                        24 mins ago










                                      • Oh then mine can be 73 bytes too.
                                        – Shieru Asakoto
                                        24 mins ago










                                      • It looks like you can remove the +'', seeing as you're taking input as an array of strings.
                                        – Shaggy
                                        21 mins ago










                                      • @Shaggy I'm not taking strings anymore, as I'm not sure if that's allowed here.
                                        – Arnauld
                                        20 mins ago
















                                      • Won't work for [-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10], which is why my solution is 14 bytes longer.
                                        – Shieru Asakoto
                                        25 mins ago











                                      • @ShieruAsakoto This works with SpiderMonkey, which is using a stable sort.
                                        – Arnauld
                                        24 mins ago










                                      • Oh then mine can be 73 bytes too.
                                        – Shieru Asakoto
                                        24 mins ago










                                      • It looks like you can remove the +'', seeing as you're taking input as an array of strings.
                                        – Shaggy
                                        21 mins ago










                                      • @Shaggy I'm not taking strings anymore, as I'm not sure if that's allowed here.
                                        – Arnauld
                                        20 mins ago















                                      Won't work for [-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10], which is why my solution is 14 bytes longer.
                                      – Shieru Asakoto
                                      25 mins ago





                                      Won't work for [-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10], which is why my solution is 14 bytes longer.
                                      – Shieru Asakoto
                                      25 mins ago













                                      @ShieruAsakoto This works with SpiderMonkey, which is using a stable sort.
                                      – Arnauld
                                      24 mins ago




                                      @ShieruAsakoto This works with SpiderMonkey, which is using a stable sort.
                                      – Arnauld
                                      24 mins ago












                                      Oh then mine can be 73 bytes too.
                                      – Shieru Asakoto
                                      24 mins ago




                                      Oh then mine can be 73 bytes too.
                                      – Shieru Asakoto
                                      24 mins ago












                                      It looks like you can remove the +'', seeing as you're taking input as an array of strings.
                                      – Shaggy
                                      21 mins ago




                                      It looks like you can remove the +'', seeing as you're taking input as an array of strings.
                                      – Shaggy
                                      21 mins ago












                                      @Shaggy I'm not taking strings anymore, as I'm not sure if that's allowed here.
                                      – Arnauld
                                      20 mins ago




                                      @Shaggy I'm not taking strings anymore, as I'm not sure if that's allowed here.
                                      – Arnauld
                                      20 mins ago










                                      up vote
                                      0
                                      down vote













                                      Japt, 19 bytes



                                      -2 bytes if we can take input as an array of strings.



                                      ñ_s £"54-9176320"bX


                                      Try it






                                      share|improve this answer
























                                        up vote
                                        0
                                        down vote













                                        Japt, 19 bytes



                                        -2 bytes if we can take input as an array of strings.



                                        ñ_s £"54-9176320"bX


                                        Try it






                                        share|improve this answer






















                                          up vote
                                          0
                                          down vote










                                          up vote
                                          0
                                          down vote









                                          Japt, 19 bytes



                                          -2 bytes if we can take input as an array of strings.



                                          ñ_s £"54-9176320"bX


                                          Try it






                                          share|improve this answer












                                          Japt, 19 bytes



                                          -2 bytes if we can take input as an array of strings.



                                          ñ_s £"54-9176320"bX


                                          Try it







                                          share|improve this answer












                                          share|improve this answer



                                          share|improve this answer










                                          answered 18 mins ago









                                          Shaggy

                                          16.8k21661




                                          16.8k21661




















                                              up vote
                                              0
                                              down vote













                                              Pyth, 17 bytes



                                              oxL"854-9176320"`


                                              Try it online here, or verify all the test cases at once here.



                                              oxL"854-9176320"`NQ Implicit: Q=eval(input())
                                              Trailing N, Q inferred
                                              o Q Order the elements of Q, as N, using...
                                              `N Convert N to string
                                              xL Get the index of each character of that string...
                                              "854-9176320" ... in the lookup ordering





                                              share|improve this answer
























                                                up vote
                                                0
                                                down vote













                                                Pyth, 17 bytes



                                                oxL"854-9176320"`


                                                Try it online here, or verify all the test cases at once here.



                                                oxL"854-9176320"`NQ Implicit: Q=eval(input())
                                                Trailing N, Q inferred
                                                o Q Order the elements of Q, as N, using...
                                                `N Convert N to string
                                                xL Get the index of each character of that string...
                                                "854-9176320" ... in the lookup ordering





                                                share|improve this answer






















                                                  up vote
                                                  0
                                                  down vote










                                                  up vote
                                                  0
                                                  down vote









                                                  Pyth, 17 bytes



                                                  oxL"854-9176320"`


                                                  Try it online here, or verify all the test cases at once here.



                                                  oxL"854-9176320"`NQ Implicit: Q=eval(input())
                                                  Trailing N, Q inferred
                                                  o Q Order the elements of Q, as N, using...
                                                  `N Convert N to string
                                                  xL Get the index of each character of that string...
                                                  "854-9176320" ... in the lookup ordering





                                                  share|improve this answer












                                                  Pyth, 17 bytes



                                                  oxL"854-9176320"`


                                                  Try it online here, or verify all the test cases at once here.



                                                  oxL"854-9176320"`NQ Implicit: Q=eval(input())
                                                  Trailing N, Q inferred
                                                  o Q Order the elements of Q, as N, using...
                                                  `N Convert N to string
                                                  xL Get the index of each character of that string...
                                                  "854-9176320" ... in the lookup ordering






                                                  share|improve this answer












                                                  share|improve this answer



                                                  share|improve this answer










                                                  answered 11 mins ago









                                                  Sok

                                                  2,891722




                                                  2,891722




















                                                      up vote
                                                      0
                                                      down vote














                                                      05AB1E (legacy), 15 bytes



                                                      Σε•Koéa₃•'-3ǝsk


                                                      Try it online!





                                                      share
























                                                        up vote
                                                        0
                                                        down vote














                                                        05AB1E (legacy), 15 bytes



                                                        Σε•Koéa₃•'-3ǝsk


                                                        Try it online!





                                                        share






















                                                          up vote
                                                          0
                                                          down vote










                                                          up vote
                                                          0
                                                          down vote










                                                          05AB1E (legacy), 15 bytes



                                                          Σε•Koéa₃•'-3ǝsk


                                                          Try it online!





                                                          share













                                                          05AB1E (legacy), 15 bytes



                                                          Σε•Koéa₃•'-3ǝsk


                                                          Try it online!






                                                          share











                                                          share


                                                          share










                                                          answered 56 secs ago









                                                          Emigna

                                                          43.3k431131




                                                          43.3k431131



























                                                               

                                                              draft saved


                                                              draft discarded















































                                                               


                                                              draft saved


                                                              draft discarded














                                                              StackExchange.ready(
                                                              function ()
                                                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f172891%2fpronunciationsort%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

                                                              One-line joke