Play Zip, Zap, ZopGenerate keyboard shortcuts for a menuLet's play countdown!Stretching WordsWrite a program...

What essential properties make us human?

Do authors have to be politically correct in article-writing?

systemd service won't start nodejs

What is the difference between "...", '...', $'...', and $"..." quotes?

Why did Democrats in the Senate oppose the Born-Alive Abortion Survivors Protection Act?

Can the "Friends" spell be used without making the target hostile?

Why didn't Tom Riddle take the presence of Fawkes and the Sorting Hat as more of a threat?

A starship is travelling at 0.9c and collides with a small rock. Will it leave a clean hole through, or will more happen?

After checking in online, how do I know whether I need to go show my passport at airport check-in?

How to not let the Identify spell spoil everything?

Changing the laptop's CPU. Should I reinstall Linux?

Non-Cancer terminal illness that can affect young (age 10-13) girls?

What happens when I Twin Life Transference?

How to access internet and run apt-get through a middle server?

Square Root Distance from Integers

What is the wife of a henpecked husband called?

How can the probability of a fumble decrease linearly with more dice?

Definition of "atomic object"

Does diversity provide anything that meritocracy does not?

Looking for a specific 6502 Assembler

Which communication protocol is used in AdLib sound card?

Is there a lava-breathing lizard creature (that could be worshipped by a cult) in 5e?

Removing whitespace between consecutive numbers

Why avoid shared user accounts?



Play Zip, Zap, Zop


Generate keyboard shortcuts for a menuLet's play countdown!Stretching WordsWrite a program that finds the most occurring paired letter in a stringLet's play Hangman?Play the word chainFind the shortest pangrams from a word listScore a Game of BoggleCount Consecutive CharactersHelloellolloloo Worldorldrldldd













7












$begingroup$


There's a little improv warm up game where you arrange yourselves in a circle and send zips, zaps, and zops around by pointing to a person and saying the next word in the sequence, then they do the same until all of you are warmed up or whatever.



Your task is to create a program that gives the next word in sequence given an input word. (Zip --> Zap --> Zop --> Zip) Since there's a lot of different ways to say these three words and flairs that can be added to them, your program should imitate case and letter duplication and carry suffixes.



To elaborate, your input will be one or more Zs, then one or more Is, As, or Os (all the same letter), then one or more Ps, (all letters up to this point may be in mixed case) followed by some arbitrary suffix (which may be empty). You should leave the runs of Zs and Ps, as well as the suffix exactly as received, but then change the Is to As, As to Os, or Os to Is, preserving case at each step.



Example Test Cases



zip         ==> zap
zAp ==> zOp
ZOP ==> ZIP
ZiiP ==> ZaaP
ZZaapp ==> ZZoopp
zzzzOoOPppP ==> zzzzIiIPppP
Zipperoni ==> Zapperoni
ZAPsky ==> ZOPsky
ZoPtOn ==> ZiPtOn
zipzip ==> zapzip
zapzopzip ==> zopzopzip
zoopzaap ==> ziipzaap


Rules and Notes




  • You may use any convenient character encoding for input and output, provided that it supports all printable ASCII characters, provided that it was created prior to this challenge.

  • You may assume the input word is some variant of Zip, Zap, or Zop. All other inputs result in undefined behavior.


    • Valid inputs will full-match the regex Z+(I+|A+|O+)P+.* (in mixed case)



  • You may assume that the input word consists entirely of ASCII letters.


Happy Golfing!










share|improve this question









$endgroup$

















    7












    $begingroup$


    There's a little improv warm up game where you arrange yourselves in a circle and send zips, zaps, and zops around by pointing to a person and saying the next word in the sequence, then they do the same until all of you are warmed up or whatever.



    Your task is to create a program that gives the next word in sequence given an input word. (Zip --> Zap --> Zop --> Zip) Since there's a lot of different ways to say these three words and flairs that can be added to them, your program should imitate case and letter duplication and carry suffixes.



    To elaborate, your input will be one or more Zs, then one or more Is, As, or Os (all the same letter), then one or more Ps, (all letters up to this point may be in mixed case) followed by some arbitrary suffix (which may be empty). You should leave the runs of Zs and Ps, as well as the suffix exactly as received, but then change the Is to As, As to Os, or Os to Is, preserving case at each step.



    Example Test Cases



    zip         ==> zap
    zAp ==> zOp
    ZOP ==> ZIP
    ZiiP ==> ZaaP
    ZZaapp ==> ZZoopp
    zzzzOoOPppP ==> zzzzIiIPppP
    Zipperoni ==> Zapperoni
    ZAPsky ==> ZOPsky
    ZoPtOn ==> ZiPtOn
    zipzip ==> zapzip
    zapzopzip ==> zopzopzip
    zoopzaap ==> ziipzaap


    Rules and Notes




    • You may use any convenient character encoding for input and output, provided that it supports all printable ASCII characters, provided that it was created prior to this challenge.

    • You may assume the input word is some variant of Zip, Zap, or Zop. All other inputs result in undefined behavior.


      • Valid inputs will full-match the regex Z+(I+|A+|O+)P+.* (in mixed case)



    • You may assume that the input word consists entirely of ASCII letters.


    Happy Golfing!










    share|improve this question









    $endgroup$















      7












      7








      7





      $begingroup$


      There's a little improv warm up game where you arrange yourselves in a circle and send zips, zaps, and zops around by pointing to a person and saying the next word in the sequence, then they do the same until all of you are warmed up or whatever.



      Your task is to create a program that gives the next word in sequence given an input word. (Zip --> Zap --> Zop --> Zip) Since there's a lot of different ways to say these three words and flairs that can be added to them, your program should imitate case and letter duplication and carry suffixes.



      To elaborate, your input will be one or more Zs, then one or more Is, As, or Os (all the same letter), then one or more Ps, (all letters up to this point may be in mixed case) followed by some arbitrary suffix (which may be empty). You should leave the runs of Zs and Ps, as well as the suffix exactly as received, but then change the Is to As, As to Os, or Os to Is, preserving case at each step.



      Example Test Cases



      zip         ==> zap
      zAp ==> zOp
      ZOP ==> ZIP
      ZiiP ==> ZaaP
      ZZaapp ==> ZZoopp
      zzzzOoOPppP ==> zzzzIiIPppP
      Zipperoni ==> Zapperoni
      ZAPsky ==> ZOPsky
      ZoPtOn ==> ZiPtOn
      zipzip ==> zapzip
      zapzopzip ==> zopzopzip
      zoopzaap ==> ziipzaap


      Rules and Notes




      • You may use any convenient character encoding for input and output, provided that it supports all printable ASCII characters, provided that it was created prior to this challenge.

      • You may assume the input word is some variant of Zip, Zap, or Zop. All other inputs result in undefined behavior.


        • Valid inputs will full-match the regex Z+(I+|A+|O+)P+.* (in mixed case)



      • You may assume that the input word consists entirely of ASCII letters.


      Happy Golfing!










      share|improve this question









      $endgroup$




      There's a little improv warm up game where you arrange yourselves in a circle and send zips, zaps, and zops around by pointing to a person and saying the next word in the sequence, then they do the same until all of you are warmed up or whatever.



      Your task is to create a program that gives the next word in sequence given an input word. (Zip --> Zap --> Zop --> Zip) Since there's a lot of different ways to say these three words and flairs that can be added to them, your program should imitate case and letter duplication and carry suffixes.



      To elaborate, your input will be one or more Zs, then one or more Is, As, or Os (all the same letter), then one or more Ps, (all letters up to this point may be in mixed case) followed by some arbitrary suffix (which may be empty). You should leave the runs of Zs and Ps, as well as the suffix exactly as received, but then change the Is to As, As to Os, or Os to Is, preserving case at each step.



      Example Test Cases



      zip         ==> zap
      zAp ==> zOp
      ZOP ==> ZIP
      ZiiP ==> ZaaP
      ZZaapp ==> ZZoopp
      zzzzOoOPppP ==> zzzzIiIPppP
      Zipperoni ==> Zapperoni
      ZAPsky ==> ZOPsky
      ZoPtOn ==> ZiPtOn
      zipzip ==> zapzip
      zapzopzip ==> zopzopzip
      zoopzaap ==> ziipzaap


      Rules and Notes




      • You may use any convenient character encoding for input and output, provided that it supports all printable ASCII characters, provided that it was created prior to this challenge.

      • You may assume the input word is some variant of Zip, Zap, or Zop. All other inputs result in undefined behavior.


        • Valid inputs will full-match the regex Z+(I+|A+|O+)P+.* (in mixed case)



      • You may assume that the input word consists entirely of ASCII letters.


      Happy Golfing!







      code-golf string






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 1 hour ago









      BeefsterBeefster

      1,772731




      1,772731






















          4 Answers
          4






          active

          oldest

          votes


















          1












          $begingroup$


          Stax, 19 bytes



          Ç╛√êΣ%,╖FP╚`=Lh←⌡·ƒ


          Run and debug it






          share|improve this answer









          $endgroup$





















            1












            $begingroup$


            Perl 6, 41 bytes





            {S:i{z+<(.+?)>p}=$/.&{TR/iaoIAO/aoiAOI/}}


            Try it online!



            Simple case-insensitive substitution to shift the vowel section.






            share|improve this answer









            $endgroup$





















              0












              $begingroup$


              JavaScript (Node.js), 69 bytes





              s=>Buffer(s).map(p=c=>s|p-c&31?s=c:c&1?c-[6,-14,p=c,,8][c%16%5]:c)+''


              Try it online!






              share|improve this answer









              $endgroup$





















                0












                $begingroup$


                Japt, 22 bytes



                r"%v+"_d"i_oiao_a"pu}"


                Try it online!






                share|improve this answer











                $endgroup$













                  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',
                  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%2f180463%2fplay-zip-zap-zop%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









                  1












                  $begingroup$


                  Stax, 19 bytes



                  Ç╛√êΣ%,╖FP╚`=Lh←⌡·ƒ


                  Run and debug it






                  share|improve this answer









                  $endgroup$


















                    1












                    $begingroup$


                    Stax, 19 bytes



                    Ç╛√êΣ%,╖FP╚`=Lh←⌡·ƒ


                    Run and debug it






                    share|improve this answer









                    $endgroup$
















                      1












                      1








                      1





                      $begingroup$


                      Stax, 19 bytes



                      Ç╛√êΣ%,╖FP╚`=Lh←⌡·ƒ


                      Run and debug it






                      share|improve this answer









                      $endgroup$




                      Stax, 19 bytes



                      Ç╛√êΣ%,╖FP╚`=Lh←⌡·ƒ


                      Run and debug it







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered 1 hour ago









                      recursiverecursive

                      5,3191322




                      5,3191322























                          1












                          $begingroup$


                          Perl 6, 41 bytes





                          {S:i{z+<(.+?)>p}=$/.&{TR/iaoIAO/aoiAOI/}}


                          Try it online!



                          Simple case-insensitive substitution to shift the vowel section.






                          share|improve this answer









                          $endgroup$


















                            1












                            $begingroup$


                            Perl 6, 41 bytes





                            {S:i{z+<(.+?)>p}=$/.&{TR/iaoIAO/aoiAOI/}}


                            Try it online!



                            Simple case-insensitive substitution to shift the vowel section.






                            share|improve this answer









                            $endgroup$
















                              1












                              1








                              1





                              $begingroup$


                              Perl 6, 41 bytes





                              {S:i{z+<(.+?)>p}=$/.&{TR/iaoIAO/aoiAOI/}}


                              Try it online!



                              Simple case-insensitive substitution to shift the vowel section.






                              share|improve this answer









                              $endgroup$




                              Perl 6, 41 bytes





                              {S:i{z+<(.+?)>p}=$/.&{TR/iaoIAO/aoiAOI/}}


                              Try it online!



                              Simple case-insensitive substitution to shift the vowel section.







                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered 42 mins ago









                              Jo KingJo King

                              23.7k257123




                              23.7k257123























                                  0












                                  $begingroup$


                                  JavaScript (Node.js), 69 bytes





                                  s=>Buffer(s).map(p=c=>s|p-c&31?s=c:c&1?c-[6,-14,p=c,,8][c%16%5]:c)+''


                                  Try it online!






                                  share|improve this answer









                                  $endgroup$


















                                    0












                                    $begingroup$


                                    JavaScript (Node.js), 69 bytes





                                    s=>Buffer(s).map(p=c=>s|p-c&31?s=c:c&1?c-[6,-14,p=c,,8][c%16%5]:c)+''


                                    Try it online!






                                    share|improve this answer









                                    $endgroup$
















                                      0












                                      0








                                      0





                                      $begingroup$


                                      JavaScript (Node.js), 69 bytes





                                      s=>Buffer(s).map(p=c=>s|p-c&31?s=c:c&1?c-[6,-14,p=c,,8][c%16%5]:c)+''


                                      Try it online!






                                      share|improve this answer









                                      $endgroup$




                                      JavaScript (Node.js), 69 bytes





                                      s=>Buffer(s).map(p=c=>s|p-c&31?s=c:c&1?c-[6,-14,p=c,,8][c%16%5]:c)+''


                                      Try it online!







                                      share|improve this answer












                                      share|improve this answer



                                      share|improve this answer










                                      answered 16 mins ago









                                      ArnauldArnauld

                                      76.9k693322




                                      76.9k693322























                                          0












                                          $begingroup$


                                          Japt, 22 bytes



                                          r"%v+"_d"i_oiao_a"pu}"


                                          Try it online!






                                          share|improve this answer











                                          $endgroup$


















                                            0












                                            $begingroup$


                                            Japt, 22 bytes



                                            r"%v+"_d"i_oiao_a"pu}"


                                            Try it online!






                                            share|improve this answer











                                            $endgroup$
















                                              0












                                              0








                                              0





                                              $begingroup$


                                              Japt, 22 bytes



                                              r"%v+"_d"i_oiao_a"pu}"


                                              Try it online!






                                              share|improve this answer











                                              $endgroup$




                                              Japt, 22 bytes



                                              r"%v+"_d"i_oiao_a"pu}"


                                              Try it online!







                                              share|improve this answer














                                              share|improve this answer



                                              share|improve this answer








                                              edited 9 mins ago

























                                              answered 35 mins ago









                                              ASCII-onlyASCII-only

                                              3,4421236




                                              3,4421236






























                                                  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%2f180463%2fplay-zip-zap-zop%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

                                                  Why do type traits not work with types in namespace scope?What are POD types in C++?Why can templates only be...

                                                  Will tsunami waves travel forever if there was no land?Why do tsunami waves begin with the water flowing away...

                                                  Simple Scan not detecting my scanner (Brother DCP-7055W)Brother MFC-L2700DW printer can print, can't...