Oreoorererereoo












33














Oreoorererereoo



Given an input string that is similar to the word "oreo", give an ASCII representation of the cookie that is as wide as the input string (to ensure cookie stability).



Rules




  • The input is a non-empty string with no whitespace containing any combination of the strings "o" and "re", and containing only those strings.

  • The string "o" represents the solid cookie, while the string "re" represents the filling.

  • The output must be a stacked cookie that is as wide as the input string.

  • The cookie must overlap the filling by one character on each side

  • The characters used for the output don't have to match the output below (█ and ░), they just have to be different non-whitespace characters for the two parts of the cookie

  • The whitespace padding on each side of the filling is required

  • A line return at the end is optional


Examples



Input: oreo
Output:
████
░░
████

Input: o
Output:


Input: re
Output: (two spaces)


Input: rere
Output:
░░
░░

Input: oreoorererereoo
Output:
███████████████
░░░░░░░░░░░░░
███████████████
███████████████
░░░░░░░░░░░░░
░░░░░░░░░░░░░
░░░░░░░░░░░░░
░░░░░░░░░░░░░
███████████████
███████████████


Since this is code golf the shortest answer wins, good luck :)










share|improve this question




















  • 1




    Is it correct to assume you will not be given the empty string?
    – fəˈnɛtɪk
    yesterday






  • 1




    Will the string only contain "re" and "o"?
    – Embodiment of Ignorance
    yesterday








  • 1




    Yes, I apologize if it's not clear enough in the rules
    – GammaGames
    yesterday






  • 1




    Can we have a trailing newline after the output? That's the default for printing in most languages. Like this.
    – Riker
    yesterday






  • 1




    @GammaGames Hm, ok. Generally consensus is that returning a list of strings is ok I believe, but I'll edit my answer.
    – Riker
    yesterday
















33














Oreoorererereoo



Given an input string that is similar to the word "oreo", give an ASCII representation of the cookie that is as wide as the input string (to ensure cookie stability).



Rules




  • The input is a non-empty string with no whitespace containing any combination of the strings "o" and "re", and containing only those strings.

  • The string "o" represents the solid cookie, while the string "re" represents the filling.

  • The output must be a stacked cookie that is as wide as the input string.

  • The cookie must overlap the filling by one character on each side

  • The characters used for the output don't have to match the output below (█ and ░), they just have to be different non-whitespace characters for the two parts of the cookie

  • The whitespace padding on each side of the filling is required

  • A line return at the end is optional


Examples



Input: oreo
Output:
████
░░
████

Input: o
Output:


Input: re
Output: (two spaces)


Input: rere
Output:
░░
░░

Input: oreoorererereoo
Output:
███████████████
░░░░░░░░░░░░░
███████████████
███████████████
░░░░░░░░░░░░░
░░░░░░░░░░░░░
░░░░░░░░░░░░░
░░░░░░░░░░░░░
███████████████
███████████████


Since this is code golf the shortest answer wins, good luck :)










share|improve this question




















  • 1




    Is it correct to assume you will not be given the empty string?
    – fəˈnɛtɪk
    yesterday






  • 1




    Will the string only contain "re" and "o"?
    – Embodiment of Ignorance
    yesterday








  • 1




    Yes, I apologize if it's not clear enough in the rules
    – GammaGames
    yesterday






  • 1




    Can we have a trailing newline after the output? That's the default for printing in most languages. Like this.
    – Riker
    yesterday






  • 1




    @GammaGames Hm, ok. Generally consensus is that returning a list of strings is ok I believe, but I'll edit my answer.
    – Riker
    yesterday














33












33








33


7





Oreoorererereoo



Given an input string that is similar to the word "oreo", give an ASCII representation of the cookie that is as wide as the input string (to ensure cookie stability).



Rules




  • The input is a non-empty string with no whitespace containing any combination of the strings "o" and "re", and containing only those strings.

  • The string "o" represents the solid cookie, while the string "re" represents the filling.

  • The output must be a stacked cookie that is as wide as the input string.

  • The cookie must overlap the filling by one character on each side

  • The characters used for the output don't have to match the output below (█ and ░), they just have to be different non-whitespace characters for the two parts of the cookie

  • The whitespace padding on each side of the filling is required

  • A line return at the end is optional


Examples



Input: oreo
Output:
████
░░
████

Input: o
Output:


Input: re
Output: (two spaces)


Input: rere
Output:
░░
░░

Input: oreoorererereoo
Output:
███████████████
░░░░░░░░░░░░░
███████████████
███████████████
░░░░░░░░░░░░░
░░░░░░░░░░░░░
░░░░░░░░░░░░░
░░░░░░░░░░░░░
███████████████
███████████████


Since this is code golf the shortest answer wins, good luck :)










share|improve this question















Oreoorererereoo



Given an input string that is similar to the word "oreo", give an ASCII representation of the cookie that is as wide as the input string (to ensure cookie stability).



Rules




  • The input is a non-empty string with no whitespace containing any combination of the strings "o" and "re", and containing only those strings.

  • The string "o" represents the solid cookie, while the string "re" represents the filling.

  • The output must be a stacked cookie that is as wide as the input string.

  • The cookie must overlap the filling by one character on each side

  • The characters used for the output don't have to match the output below (█ and ░), they just have to be different non-whitespace characters for the two parts of the cookie

  • The whitespace padding on each side of the filling is required

  • A line return at the end is optional


Examples



Input: oreo
Output:
████
░░
████

Input: o
Output:


Input: re
Output: (two spaces)


Input: rere
Output:
░░
░░

Input: oreoorererereoo
Output:
███████████████
░░░░░░░░░░░░░
███████████████
███████████████
░░░░░░░░░░░░░
░░░░░░░░░░░░░
░░░░░░░░░░░░░
░░░░░░░░░░░░░
███████████████
███████████████


Since this is code golf the shortest answer wins, good luck :)







code-golf string ascii-art






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 9 hours ago

























asked yesterday









GammaGames

465211




465211








  • 1




    Is it correct to assume you will not be given the empty string?
    – fəˈnɛtɪk
    yesterday






  • 1




    Will the string only contain "re" and "o"?
    – Embodiment of Ignorance
    yesterday








  • 1




    Yes, I apologize if it's not clear enough in the rules
    – GammaGames
    yesterday






  • 1




    Can we have a trailing newline after the output? That's the default for printing in most languages. Like this.
    – Riker
    yesterday






  • 1




    @GammaGames Hm, ok. Generally consensus is that returning a list of strings is ok I believe, but I'll edit my answer.
    – Riker
    yesterday














  • 1




    Is it correct to assume you will not be given the empty string?
    – fəˈnɛtɪk
    yesterday






  • 1




    Will the string only contain "re" and "o"?
    – Embodiment of Ignorance
    yesterday








  • 1




    Yes, I apologize if it's not clear enough in the rules
    – GammaGames
    yesterday






  • 1




    Can we have a trailing newline after the output? That's the default for printing in most languages. Like this.
    – Riker
    yesterday






  • 1




    @GammaGames Hm, ok. Generally consensus is that returning a list of strings is ok I believe, but I'll edit my answer.
    – Riker
    yesterday








1




1




Is it correct to assume you will not be given the empty string?
– fəˈnɛtɪk
yesterday




Is it correct to assume you will not be given the empty string?
– fəˈnɛtɪk
yesterday




1




1




Will the string only contain "re" and "o"?
– Embodiment of Ignorance
yesterday






Will the string only contain "re" and "o"?
– Embodiment of Ignorance
yesterday






1




1




Yes, I apologize if it's not clear enough in the rules
– GammaGames
yesterday




Yes, I apologize if it's not clear enough in the rules
– GammaGames
yesterday




1




1




Can we have a trailing newline after the output? That's the default for printing in most languages. Like this.
– Riker
yesterday




Can we have a trailing newline after the output? That's the default for printing in most languages. Like this.
– Riker
yesterday




1




1




@GammaGames Hm, ok. Generally consensus is that returning a list of strings is ok I believe, but I'll edit my answer.
– Riker
yesterday




@GammaGames Hm, ok. Generally consensus is that returning a list of strings is ok I believe, but I'll edit my answer.
– Riker
yesterday










27 Answers
27






active

oldest

votes


















7















Canvas, 19 18 17 bytes



e ∙╋
:r≠*┤];L×⁸↔⁸


Try it here!



Uses the annoyingly long code of :r≠*┤] to remove rs from the input..






share|improve this answer























  • That's a handy feature, and cool language!
    – GammaGames
    yesterday



















5















05AB1E, 18 bytes



'eKεD'rQ2*Igα×}».c


Uses o for the cookie and r for the filling.



Try it online or verify all test cases.



Explanation:





'eK                '# Remove all "e" from the (implicit) input
# i.e. "orereo" → "orro"
ε } # Map all characters to:
D # Duplicate the current character
'rQ '# Check if it's an "r" (1 if truthy; 0 if falsey)
# i.e. "r" → 1
# i.e. "o" → 0
2* # Multiply that by 2
# i.e. 1 → 2
# i.e. 0 → 0
Ig # Take the length of the input
# i.e. "orereo" → 6
α # Take the absolute difference between the two
# i.e. 2 and 6 → 4
# i.e. 0 and 6 → 6
× # Repeat the duplicated character that many times
# i.e. "r" and 4 → "rrrr"
# i.e. "o" and 6 → "oooooo"
» # After the map, join everything by newlines
# i.e. ["oooooo","rrrr","rrrr","oooooo"] → "oooooonrrrrnrrrrnoooooo"
.c # Then centralize it (and output implicitly)
# i.e. "oooooonrrrrnrrrrnoooooo" → "oooooon rrrrn rrrrnoooooo"





share|improve this answer





























    5















    Japt -R, 16 15 bytes



    re ¬£çX sX²èrÃû


    Try it



                        :Implicit input of string U
    re :Remove all "e"s
    ¬ :Split to array of characters
    £ :Map each X
    çX : Repeat X to the length of U
    s : Slice from index
    X² : Duplicate X
    èr : Count the occurrences of "r"
    Ã :End map
    û :Centre pad each element with spaces to the length of the longest
    :Implicitly join with newlines and output




    Alternatives



    re ¬ËpUÊaD²èrÃû
    re ¬£îX rr²i^Ãû





    share|improve this answer































      5















      C# (Visual C# Interactive Compiler), 95 bytes





      n=>n.Replace("o",new String('-',n.Length)+"n").Replace("re"," ".PadRight(n.Length-1,'|')+"n")


      Try it online!



      Alternative using Aggregate, 108 bytes





      n=>n.Aggregate("",(d,c)=>d+(c<102?"":c<112?new String('-',n.Length)+"n":" ".PadRight(n.Length-1,'|')+"n"))


      Try it online!






      share|improve this answer



















      • 1




        now it trims trailing spaces..
        – dzaima
        yesterday










      • There was enough feedback that I removed the trailing newline rule. Feel free to update your entry.
        – GammaGames
        yesterday










      • Your replace doesn't work when the input is o, since the n.Length-2 will result in -1.
        – Kevin Cruijssen
        19 hours ago










      • The n.Length-2 is is for when the input has re.
        – Embodiment of Ignorance
        12 hours ago



















      5















      R, 119 118 bytes





      function(s,N=nchar(s)){m=t(replicate(N,el(strsplit(gsub('re',0,s),''))))
      m[m<1&row(m)%in%c(1,N)]=' '
      write(m,1,N,,'')}


      Try it online!




      • -1 byte thanks to @Giuseppe


      Unrolled code and explanation :



      function(s){                       # s is the input string, e.g. 'oreo'

      N = nchar(s) # store the length of s into N, e.g. 4

      s1 = gsub('re',0,s) # replace 're' with '0' and store in s1, e.g. 'o0o'

      v = el(strsplit(s1,'')) # split s1 into a vector v of single characters
      # e.g. 'o','0','o'

      m = replicate(N,v) # evaluate N times the vector v and arrange
      # the result into a matrix m (nchar(s1) x N)
      # e.g.
      # 'o' 'o' 'o' 'o'
      # '0' '0' '0' '0'
      # 'o' 'o' 'o' 'o'


      m = t(m) # transpose the matrix

      m[m<1 & row(m)%in%c(1,N)] = ' ' # substitute the zeros (i.e. where < 1)
      # on the 1st and last row of the matrix with ' ' (space)
      # e.g.
      # 'o' ' ' 'o'
      # 'o' '0' 'o'
      # 'o' '0' 'o'
      # 'o' ' ' 'o'

      write(m,1,N,,'') # write the matrix to stdout (write function transposes it)
      # e.g.
      # oooo
      # 00
      # oooo
      }





      share|improve this answer























      • 106 bytes
        – Giuseppe
        6 hours ago










      • aaand 104 bytes returning a list of lines, which isn't acceptable here, but it's an interesting idea (essentially my SNOBOL submission translated to R)
        – Giuseppe
        6 hours ago



















      4















      Retina, 74 73 bytes



      I feel like I haven't posted an answer in a very long time. Well, here I am. Also, Retina has changed a lot, and I feel like I suck at it now.



      .+
      $0$.0
      (d+)
      *
      e

      o|r
      $&¶
      _$

      +(/_/&`o¶
      oo¶
      _$

      )/_/&`r¶
      rr¶
      ¶$

      m`^r



      Try it online!






      share|improve this answer



















      • 1




        Whoa, what a crazy looking language. I like it!
        – GammaGames
        yesterday










      • doesn't include trailing whitespaces..
        – dzaima
        yesterday






      • 2




        I like how [or] means o or r instead of [ or ]. Makes my head hurt.
        – nedla2004
        yesterday










      • @dzaima The question does not specify that trailing whitespaces are required. A comment asked, but no reply was given.
        – mbomb007
        9 hours ago










      • @nedla2004 That actually helped me notice a way to save a byte. Thanks.
        – mbomb007
        9 hours ago



















      3















      Jelly,  16  14 bytes



      OḂƇẒẋ€LaØ.¦€⁶Y


      Uses 1 for the cream and 0 for the cookie.



      Try it online!



      How?



      OḂƇẒẋ€LaØ.¦€⁶Y - Main Link: list of characters, V    e.g. 'orereo'
      O - ordinal (vectorises) [111,114,101,114,101,111]
      Ƈ - filter keep those for which:
      Ḃ - modulo 2 [111, 101, 101,111]
      Ẓ - is prime? (vectorises) [ 0, 1, 1, 0]
      ẋ€ - repeat each by:
      L - length (of V) [[0,0,0,0,0,0],[1,1,1,1,1,1],[1,1,1,1,1,1],[0,0,0,0,0,0]]
      € - for each:
      ¦ - sparse application...
      Ø. - ...to indices: literal [0,1] (0 is the rightmost index, 1 is the leftmost)
      a - ...apply: logical AND with:
      ⁶ - space character [[0,0,0,0,0,0],[' ',1,1,1,1,' '],[' ',1,1,1,1,' '],[0,0,0,0,0,0]]
      Y - join with newline characters [0,0,0,0,0,0,'n',' ',1,1,1,1,' ','n',' ',1,1,1,1,' ','n',0,0,0,0,0,0]
      - implicit print ...smashes everything together:
      - 000000
      - 1111
      - 1111
      - 000000




      Previous 16 byter:



      ḟ”eẋ€Ly@Ø.¦€⁾r Y


      Uses r for the cream and o for the cookie.



      Try it online!






      share|improve this answer























      • I was hoping for a Jelly entry, such an interesting language!
        – GammaGames
        11 hours ago










      • Just trying to create something more terse. Will give explanation later... :)
        – Jonathan Allan
        11 hours ago








      • 1




        ...hoorah, that's more like it :)
        – Jonathan Allan
        10 hours ago



















      2














      JavaScript ES6, 103 bytes



      Using replace 103 bytes:





      x=>x.replace(/o/g,"-".repeat(s=x.length)+`
      `).replace(/re/g," "+"|".repeat(s>1?s-2:0)+`
      `).slice(0,-1)


      Try it online!



      Using split and map 116 bytes:





      x=>x.split("re").map(y=>("-"[h='repeat'](r=x.length)+`
      `)[h](y.length)).join(" "+"|"[h](r>1?r-2:0)+`
      `).slice(0,-1)


      Try it online!






      share|improve this answer























      • JS, nice! You reminded me that I was going to add a rule about not having line returns at the end of the output, I've added it. Sorry about that!
        – GammaGames
        yesterday






      • 3




        just removing the final newline is 12 bytes
        – fəˈnɛtɪk
        yesterday










      • There was enough feedback that I removed the trailing newline rule. Feel free to update your entry.
        – GammaGames
        yesterday






      • 2




        You can save a byte by using a template string with ${"|".repeat(s>1?s-2:0)} and its whitespaces, instead of using " "+"|".repeat(s>1?s-2:0).
        – Ismael Miguel
        19 hours ago





















      2















      Retina, 21 bytes



      r

      L$`.
      $.+*$&
      bee



      Try it online! Explanation:



      r



      Delete the rs.



      L$`.
      $.+*$&amp;


      List each letter on its own line repeated to the length of the original input.



      bee



      Replace the first two ees on each line with a space.






      share|improve this answer





























        2















        Charcoal, 19 bytes



        Fθ≡ιo⟦⭆θ#⟧e«→P⁻Lθ²↙


        Try it online! Link is to verbose version of code. Explanation:



        Fθ


        Loop through the characters of the input string.



        ≡ι


        Switch on each character.



        o⟦⭆θ#⟧


        If it's an o then print the input string replaced with #s on its own line.



        e«→P⁻Lθ²↙


        If it's an e then move right, print a line of -s that's two less than the length of the input string, then move down and left.






        share|improve this answer





























          2














          Powershell, 71 bytes





          $l="$args"|% le*
          switch($args|% t*y){'o'{'#'*$l}'r'{" $('%'*($l-2)) "}}


          Less golfed test script:



          $f = {

          $l="$args"|% length
          switch($args|% t*y){
          'o'{'#'*$l}
          'r'{" $('%'*($l-2)) "}
          }

          }

          @(

          ,(
          'oreo',
          '####',
          ' %% ',
          '####'
          )
          ,(
          'o',
          '#'
          )
          ,(
          're',
          ' '
          )
          ,(
          'rere',
          ' %% ',
          ' %% '
          )
          ,(
          'oreoorererereoo',
          '###############',
          ' %%%%%%%%%%%%% ',
          '###############',
          '###############',
          ' %%%%%%%%%%%%% ',
          ' %%%%%%%%%%%%% ',
          ' %%%%%%%%%%%%% ',
          ' %%%%%%%%%%%%% ',
          '###############',
          '###############'
          )

          ) | % {
          $s,$expected = $_
          $result = &$f $s
          "$result"-eq"$expected"
          # $result # uncomment this line to display a result
          }


          Output:



          True
          True
          True
          True
          True





          share|improve this answer





















          • Looks like you don't need parens around the $args 69 bytes
            – Veskah
            5 hours ago



















          2















          Python 3, 77 bytes





          lambda x:x.replace("o","-"*len(x)+"n").replace("re"," "+'.'*(len(x)-2)+"n")


          Try it online!






          share|improve this answer























          • Clever! I did intend the output to not be printing whitespace for the filling (it's pretty much oreo ascii), so I have edited the rules accordingly. Sorry about that! And I always love a python answer :)
            – GammaGames
            yesterday












          • @JonathanFrech migth as well delete the comments, that approach was invalidated. I'll work on golfing more tomorrow.
            – Riker
            yesterday










          • You can remove the space at +" n" to save a byte.
            – Kevin Cruijssen
            18 hours ago










          • @KevinCruijssen can I? The input program says the whole cookie must be as wide as the input.
            – Riker
            13 hours ago










          • I interpreted that as meaning that a trailing space is the same (visually) as no space. That's the beauty of answers to ascii art challenges. If they look right they are right :-)
            – ElPedro
            7 hours ago





















          2















          Pepe, 364 bytes



          Unfortunately the online interpreter does not take care of compressing comments, hence all o characters will be replaced by a space.. Neither the spaces nor the o are necessary, so this could be 295 bytes, but I like it more this way:





          rEeEEeeEeEororEEoreoreeeEeeeeeorEEEEeoREeoreorEeEEeEEEEororEEoreorEEEEEoREeoreorEeEEEeeEeororEEoreoReoREoREEEeoREEEEEoreorEorEEEeorEEEEEoreEoREeoreoREEeoREEEEeEeeoREEEeoREeeEoREEEeoREEEEEEEorEEEeEorEEEeoREoREEEeoREEEEEoREEoReoreorEEEeEoREEEEEEeorEEEeoReEoREoREEEeoREEoReoroReEeoREoREEEeorEEEEeoReeoREEEeoREeeEoREEEeoREEEEEEEoreoReoReoREoREEEeoREEEEEoreeeeeEeEeoRee


          Try it online!



          Ungolfed



          There might be some golfing oppurtunities with flags which I missed, but I'm done for now:



          # "function" for 'e'
          rEeEEeeEeE rrEE
          re # remove duplicated argument
          reeeEeeeee # print space
          rEEEEe # decrement counter twice
          REe re

          # "function" for 'o'
          rEeEEeEEEE rrEE
          re # remove duplicated argument
          rEEEEE # increment counter
          REe re

          # "function for 'r'
          rEeEEEeeEe rrEE
          re Re # remove duplicated argument & char
          RE REEEe REEEEE # push 1
          re rE rEEEe rEEEEE # replace 1
          reE # goto 1
          REe re

          # Main

          REEe REEEEeEee # read input & reverse
          REEEe REeeE REEEe REEEEEEE # push length-1 & move to r

          rEEEeE rEEEe # dummy loop-var (fucking do-whiles...)
          RE REEEe REEEEE REE # while [label-1]

          # Call the right procedure depending on current character,
          # sets stacks up as follows:
          # R [ .... *currentChar ]
          # r [ (N-1) *count ]
          Re re # pop 1 & loop-counter
          rEEEeE # duplicate counter
          REEEEEEe rEEEe # copy current char to other stack
          ReE # jeq to 'o'-label or 'e'-label

          # Output currentChar count times:
          RE REEEe REE # while [label-0]:
          Re # pop 0
          rReEe # print character
          RE REEEe # push 0
          rEEEEe # decrement counter
          Ree

          REEEe REeeE REEEe REEEEEEE # push length-1 & move to r
          re Re Re # pop 0, counter and 9((((currentChar
          RE REEEe REEEEE # push 1
          reeeeeEeEe # print new-line

          Ree





          share|improve this answer





















          • I am impressed, that looks like an infuriating language to use. But if I use the input "re" it looks like it's dying somehow, my tab stops responding
            – GammaGames
            1 hour ago










          • Invalid, cream lines need a space after as well
            – ASCII-only
            22 mins ago



















          1















          Dart, 120 106 bytes



          f(s)=>s.replaceAll('o',''.padRight(s.length,'#')+'n').replaceAll('re',' '.padRight(s.length-1,'-')+'n');


          Try it online!






          share|improve this answer































            1















            C (gcc), 135 bytes





            #define $ putchar
            O(char*r){for(char*e,*o=r;*r;*++r&&$(10))if(*r-111){for($(32,r++),e=o+1;*++e;)$(42);$(32);}else for(e=o;*e++;)$(35);}


            Try it online!






            share|improve this answer























            • Shave off a few bytes with -D$=putchar
              – Rogem
              15 hours ago



















            1















            Python 2, 77 76 72 bytes





            lambda i:'n'.join((x*len(i),' '+x*(len(i)-2))[x>'o']for x in i if'e'<x)


            Try it online!



            The outer part of the cookie is 'o' and the filling is 'r'.






            share|improve this answer































              1














              JavaScript, 72 65 bytes



              s=>s.replace(/o|re/g,([x,y])=>(y?`
              `:`
              `).padEnd(s.length+!y,x))


              Try it online






              share|improve this answer































                1














                Java 11, 110 bytes





                s->{int l=s.length();return s.replace("re"," "+"~".repeat(l-(l<2?1:2))+"n").replace("o","=".repeat(l)+"n");}


                Uses = for the cookie and ~ for the filling.



                Try it online.



                Explanation:



                s->{                       // Method with String as both parameter and return-type
                int l=s.length(); // Get the length of the input
                return s // Return the input
                .replace("re", // After we've replaced all "re" with:
                " " // A space
                +"~".repeat(l-(l<2?1:2))
                // Appended with length-2 amount of "~"
                // (or length-1 if the input-length was 1)
                +"n") // Appended with a newline
                .replace("o", // And we've also replaced all "o" with:
                "=".repeat(l) // Length amount of "="
                +"n");} // Appended with a newline




                The above solution uses a replace. The following maps over the characters of the input instead:



                Java 11, 113 112 bytes



                s->s.chars().forEach(c->{if(c>101)System.out.println((c>111?" ":"")+(""+(char)c).repeat(s.length()-2*(~c&1)));})


                -1 byte thanks to @Neil.



                Try it online.



                Explanation:



                s->                           // Method with String parameter and no return-type
                s.chars().forEach(c->{ // Loop over the characters as codepoint-integers
                if(c>101) // If it's not an 'e':
                System.out.println( // Print with trailing newline:
                (c>111? // If it's an 'r'
                " " // Start with a space
                : // Else (it's an 'o' instead)
                "") // Start with an empty string
                +(""+(char)c).repeat( // And append the character itself
                .repeat( // Repeated the following amount of times:
                s.length() // The input-length
                -2*(~c&1)));}) // Minus 2 if it's an "r", or 0 if it's an "o"





                share|improve this answer



















                • 1




                  Can you use ~c&1?
                  – Neil
                  17 hours ago










                • @Neil I indeed can, thanks.
                  – Kevin Cruijssen
                  17 hours ago



















                1















                Pyth, 33 bytes



                ::z"o"+*lz"="b"re"+.[lz*-lz2"░"db
                :z"o" With the input, replace "o" with
                *lz"=" "=" times the length of the input
                + b and a newline added to the end
                : "re" With the input, replace "re" with
                * "~" "~" times
                -lz2 the length of the input minus 2
                .[ d padded on both sides with " " to
                lz the size of the input string
                + b and a newline added to the end


                Try it here!



                I really like python (it's what I wrote my original test scripts in), so I thought I'd do a pyth entry for fun :)



                Edit: Here's a for loop, as well (35 bytes):



                FNzIqN"o"*lzN)IqN"r".[lz*-lz2Nd
                FNz For each value, N, in input
                IqN"o" if the character is "o"
                *lzN return the character times the length of the input
                ) end if
                IqN"r" if the character is "r"
                *-lz2N return the character times length - 2
                .[lz d padded on both sides with " " to the input string





                share|improve this answer



















                • 1




                  Isn't this 37 bytes? I thought Pyth uses default ASCII as its codepage just like Python, if I remember correctly. So even though your code is 33 characters, both and are three bytes each. Or am I missing something here?
                  – Kevin Cruijssen
                  22 hours ago










                • Good call, I didn't realize that (I couldn't get pyth to work on tio.run, so I used the length counter on the herokuapp page). In the for loop I could just replace the character with N, even saving a few bytes!
                  – GammaGames
                  14 hours ago










                • Thought something like that happened. :) I once had the same issue with a 05AB1E answer of mine that was using characters outside its code page. Unfortunately TIO displays chars and bytes the same for most golfing languages. For Java or Python TIO will correctly state 33 chars, 37 bytes, but not in golfing languages on TIO. But in your solutions just changing those characters indeed fixes the issue, so it's not that big of a deal here.
                  – Kevin Cruijssen
                  14 hours ago





















                1















                C# (.NET Core), 143 bytes



                Without LINQ.





                p=>{var q="";foreach(char c in p){if(c!='e'){for(var j=0;j<p.Length;j++)q+=(j<1|j>p.Length-2)&c>'q'?" ":c<'p'?"█":"░";q+="n";}}return q;};


                Try it online!






                share|improve this answer





























                  0















                  Perl 5 -p, 47 bytes





                  s|o|X x($i=y///c).$/|ge;s|re|$".O x($i-2).$/|ge


                  Try it online!






                  share|improve this answer





























                    0















                    SNOBOL4 (CSNOBOL4), 136 bytes



                    	S =INPUT
                    N =SIZE(S)
                    S S ('o' | 're') . X REM . S :F(END)
                    OUTPUT =IDENT('o',X) DUPL(X,N) :S(S)
                    OUTPUT =' ' DUPL(0,N - 2) ' ' :(S)
                    END


                    Try it online!






                    share|improve this answer





























                      0















                      PHP, 99 bytes





                      $l=strlen($i=$argv[1]);$r=str_repeat;echo strtr($i,[o=>$r('#',$l)."n",re=>' '.$r('=',$l-2)."n"]);


                      Try it online!



                      OUCH. PHP's waaaay_too_long function names strike again!



                      Output:



                      $php oreo.php oreo
                      ####
                      ==
                      ####

                      $php oreo.php o
                      #

                      $php oreo.php rere
                      ==
                      ==

                      $ php oreo.php oreoorererereoo
                      ###############
                      =============
                      ###############
                      ###############
                      =============
                      =============
                      =============
                      =============
                      ###############
                      ###############





                      share|improve this answer





















                      • Invalid, cream lines need a trailing space
                        – ASCII-only
                        23 mins ago



















                      0














                      Batch, 133 bytes



                      @set/ps=
                      @set o=%s:r=o%
                      @set o=%o:e=o%
                      @set r=%o:o=-%
                      @set r= %r:~2%
                      @set s=%s:e= %
                      @for %%c in (%s:o=o %)do @call echo %%%%c%%


                      Takes input on STDIN. Explanation:



                      @set/ps=


                      Input the string.



                      @set o=%s:r=o%
                      @set o=%o:e=o%


                      Make a copy of the string with all of the rs and es replaced with os.



                      @set r=%o:o=-%
                      @set r= %r:~2%


                      Make a copy of the string of os, change them to -s and replace the first two with a space.



                      @set s=%s:e= %
                      @for %%c in (%s:o=o %)do @call echo %%%%c%%


                      Change the es into spaces and also add a space after each o, allowing the os and rs to be iterated over, printing the appropriate string each time.






                      share|improve this answer





























                        0














                        Mathematica, 111 bytes



                        (z=StringRepeat;n=StringLength@#;#~StringReplace~{"o"->"O"~z~n<>"n","re"->" "<>If[n>2,z["R",n-2],""]<>" n"})&


                        You can try it by going to https://develop.open.wolframcloud.com/app/ and clicking "Create a new notebook" and entering code like the following and then hitting Shift+Enter.



                        (z=StringRepeat;n=StringLength@#;#~StringReplace~{"o"->"O"~z~n<>"n","re"->" "<>If[n>2,z["R",n-2],""]<>" n"})&@"ooreoreore"




                        This code is not very fancy but it seems too expensive to convert away from strings and then back or to do anything else clever. In particular, with only 3-4 commands that have the name String, we don't save bytes at all by trying to abstract that away. For example, the following is 129 bytes:



                        (w=Symbol["String"<>#]&;z=w@"Repeat";n=w["Length"]@#;#~w@"Replace"~{"o"->"O"~z~n<>"n","re"->" "<>If[n>2,z["R",n-2],""]<>" n"})&





                        share|improve this answer





























                          0















                          CJam, 27 bytes



                          q:T'e-{i2%T,'9*_:)2>S+?N}/


                          Try it online!



                          Explanation:



                          q                            read input:                    | "oreoo"
                          :T store in variable T | "oreoo", T="oreoo"
                          'e- remove all 'e' characters: | "oroo"
                          { }/ for each character: | 'o
                          i get Unicode value: | 79
                          2% modulo 2: | 1
                          T push original input: | 1 "oreoo"
                          , get length: | 1 5
                          '9* repeat '9' that many times: | 1 "99999"
                          _ duplicate: | 1 "99999" "99999"
                          :) increment every character: | 1 "99999" ":::::"
                          2> remove first two characters: | 1 "99999" ":::"
                          S+ prepend a space: | 1 "99999" " :::"
                          ? conditional: | "99999"
                          N add a newline: | "99999" N
                          (implicit output) | "99999" N " :::" N "99999" N "99999" N





                          share|improve this answer





























                            0















                            C# (Visual C# Interactive Compiler), 71 bytes





                            s=>s.Aggregate("",(a,c)=>a+(c>111?" ":"n".PadLeft(s.Length+c/5-21,c)))


                            Try it online!



                            Borrowed some ideas from on Embodiment of Ignorance's answer for sure.



                            -6 bytes thanks to @ASCIIOnly!



                            The overall concept is to compute a string aggregate over the input characters following these rules:




                            • If an r is encountered, append a single space character for indentation. We know the next character will be an e.

                            • If an o or an e is encountered, generate a string by repeating the current character a specific number of times and prepending it to a newline. The number of times to repeat is determined by length of input string and whether the current line is indented.

                            • The PadLeft function is used to generate the repeating character string.


                            The result is the concatenation of all of these strings.






                            share|improve this answer



















                            • 1




                              71
                              – ASCII-only
                              4 hours ago










                            • @ASCIIOnly - Thanks :)
                              – dana
                              3 hours ago










                            • > The whitespace padding on each side of the filling is required
                              – ASCII-only
                              29 mins ago










                            • 85?
                              – ASCII-only
                              25 mins ago










                            • I didn't notice that :) Although, in reviewing the posted answers about 1/2 have done this incorrectly as well. Good catch though!
                              – dana
                              18 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',
                            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%2f178344%2foreoorererereoo%23new-answer', 'question_page');
                            }
                            );

                            Post as a guest















                            Required, but never shown

























                            27 Answers
                            27






                            active

                            oldest

                            votes








                            27 Answers
                            27






                            active

                            oldest

                            votes









                            active

                            oldest

                            votes






                            active

                            oldest

                            votes









                            7















                            Canvas, 19 18 17 bytes



                            e ∙╋
                            :r≠*┤];L×⁸↔⁸


                            Try it here!



                            Uses the annoyingly long code of :r≠*┤] to remove rs from the input..






                            share|improve this answer























                            • That's a handy feature, and cool language!
                              – GammaGames
                              yesterday
















                            7















                            Canvas, 19 18 17 bytes



                            e ∙╋
                            :r≠*┤];L×⁸↔⁸


                            Try it here!



                            Uses the annoyingly long code of :r≠*┤] to remove rs from the input..






                            share|improve this answer























                            • That's a handy feature, and cool language!
                              – GammaGames
                              yesterday














                            7












                            7








                            7







                            Canvas, 19 18 17 bytes



                            e ∙╋
                            :r≠*┤];L×⁸↔⁸


                            Try it here!



                            Uses the annoyingly long code of :r≠*┤] to remove rs from the input..






                            share|improve this answer















                            Canvas, 19 18 17 bytes



                            e ∙╋
                            :r≠*┤];L×⁸↔⁸


                            Try it here!



                            Uses the annoyingly long code of :r≠*┤] to remove rs from the input..







                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited 8 hours ago

























                            answered yesterday









                            dzaima

                            14.5k21754




                            14.5k21754












                            • That's a handy feature, and cool language!
                              – GammaGames
                              yesterday


















                            • That's a handy feature, and cool language!
                              – GammaGames
                              yesterday
















                            That's a handy feature, and cool language!
                            – GammaGames
                            yesterday




                            That's a handy feature, and cool language!
                            – GammaGames
                            yesterday











                            5















                            05AB1E, 18 bytes



                            'eKεD'rQ2*Igα×}».c


                            Uses o for the cookie and r for the filling.



                            Try it online or verify all test cases.



                            Explanation:





                            'eK                '# Remove all "e" from the (implicit) input
                            # i.e. "orereo" → "orro"
                            ε } # Map all characters to:
                            D # Duplicate the current character
                            'rQ '# Check if it's an "r" (1 if truthy; 0 if falsey)
                            # i.e. "r" → 1
                            # i.e. "o" → 0
                            2* # Multiply that by 2
                            # i.e. 1 → 2
                            # i.e. 0 → 0
                            Ig # Take the length of the input
                            # i.e. "orereo" → 6
                            α # Take the absolute difference between the two
                            # i.e. 2 and 6 → 4
                            # i.e. 0 and 6 → 6
                            × # Repeat the duplicated character that many times
                            # i.e. "r" and 4 → "rrrr"
                            # i.e. "o" and 6 → "oooooo"
                            » # After the map, join everything by newlines
                            # i.e. ["oooooo","rrrr","rrrr","oooooo"] → "oooooonrrrrnrrrrnoooooo"
                            .c # Then centralize it (and output implicitly)
                            # i.e. "oooooonrrrrnrrrrnoooooo" → "oooooon rrrrn rrrrnoooooo"





                            share|improve this answer


























                              5















                              05AB1E, 18 bytes



                              'eKεD'rQ2*Igα×}».c


                              Uses o for the cookie and r for the filling.



                              Try it online or verify all test cases.



                              Explanation:





                              'eK                '# Remove all "e" from the (implicit) input
                              # i.e. "orereo" → "orro"
                              ε } # Map all characters to:
                              D # Duplicate the current character
                              'rQ '# Check if it's an "r" (1 if truthy; 0 if falsey)
                              # i.e. "r" → 1
                              # i.e. "o" → 0
                              2* # Multiply that by 2
                              # i.e. 1 → 2
                              # i.e. 0 → 0
                              Ig # Take the length of the input
                              # i.e. "orereo" → 6
                              α # Take the absolute difference between the two
                              # i.e. 2 and 6 → 4
                              # i.e. 0 and 6 → 6
                              × # Repeat the duplicated character that many times
                              # i.e. "r" and 4 → "rrrr"
                              # i.e. "o" and 6 → "oooooo"
                              » # After the map, join everything by newlines
                              # i.e. ["oooooo","rrrr","rrrr","oooooo"] → "oooooonrrrrnrrrrnoooooo"
                              .c # Then centralize it (and output implicitly)
                              # i.e. "oooooonrrrrnrrrrnoooooo" → "oooooon rrrrn rrrrnoooooo"





                              share|improve this answer
























                                5












                                5








                                5







                                05AB1E, 18 bytes



                                'eKεD'rQ2*Igα×}».c


                                Uses o for the cookie and r for the filling.



                                Try it online or verify all test cases.



                                Explanation:





                                'eK                '# Remove all "e" from the (implicit) input
                                # i.e. "orereo" → "orro"
                                ε } # Map all characters to:
                                D # Duplicate the current character
                                'rQ '# Check if it's an "r" (1 if truthy; 0 if falsey)
                                # i.e. "r" → 1
                                # i.e. "o" → 0
                                2* # Multiply that by 2
                                # i.e. 1 → 2
                                # i.e. 0 → 0
                                Ig # Take the length of the input
                                # i.e. "orereo" → 6
                                α # Take the absolute difference between the two
                                # i.e. 2 and 6 → 4
                                # i.e. 0 and 6 → 6
                                × # Repeat the duplicated character that many times
                                # i.e. "r" and 4 → "rrrr"
                                # i.e. "o" and 6 → "oooooo"
                                » # After the map, join everything by newlines
                                # i.e. ["oooooo","rrrr","rrrr","oooooo"] → "oooooonrrrrnrrrrnoooooo"
                                .c # Then centralize it (and output implicitly)
                                # i.e. "oooooonrrrrnrrrrnoooooo" → "oooooon rrrrn rrrrnoooooo"





                                share|improve this answer













                                05AB1E, 18 bytes



                                'eKεD'rQ2*Igα×}».c


                                Uses o for the cookie and r for the filling.



                                Try it online or verify all test cases.



                                Explanation:





                                'eK                '# Remove all "e" from the (implicit) input
                                # i.e. "orereo" → "orro"
                                ε } # Map all characters to:
                                D # Duplicate the current character
                                'rQ '# Check if it's an "r" (1 if truthy; 0 if falsey)
                                # i.e. "r" → 1
                                # i.e. "o" → 0
                                2* # Multiply that by 2
                                # i.e. 1 → 2
                                # i.e. 0 → 0
                                Ig # Take the length of the input
                                # i.e. "orereo" → 6
                                α # Take the absolute difference between the two
                                # i.e. 2 and 6 → 4
                                # i.e. 0 and 6 → 6
                                × # Repeat the duplicated character that many times
                                # i.e. "r" and 4 → "rrrr"
                                # i.e. "o" and 6 → "oooooo"
                                » # After the map, join everything by newlines
                                # i.e. ["oooooo","rrrr","rrrr","oooooo"] → "oooooonrrrrnrrrrnoooooo"
                                .c # Then centralize it (and output implicitly)
                                # i.e. "oooooonrrrrnrrrrnoooooo" → "oooooon rrrrn rrrrnoooooo"






                                share|improve this answer












                                share|improve this answer



                                share|improve this answer










                                answered 21 hours ago









                                Kevin Cruijssen

                                35.9k554188




                                35.9k554188























                                    5















                                    Japt -R, 16 15 bytes



                                    re ¬£çX sX²èrÃû


                                    Try it



                                                        :Implicit input of string U
                                    re :Remove all "e"s
                                    ¬ :Split to array of characters
                                    £ :Map each X
                                    çX : Repeat X to the length of U
                                    s : Slice from index
                                    X² : Duplicate X
                                    èr : Count the occurrences of "r"
                                    Ã :End map
                                    û :Centre pad each element with spaces to the length of the longest
                                    :Implicitly join with newlines and output




                                    Alternatives



                                    re ¬ËpUÊaD²èrÃû
                                    re ¬£îX rr²i^Ãû





                                    share|improve this answer




























                                      5















                                      Japt -R, 16 15 bytes



                                      re ¬£çX sX²èrÃû


                                      Try it



                                                          :Implicit input of string U
                                      re :Remove all "e"s
                                      ¬ :Split to array of characters
                                      £ :Map each X
                                      çX : Repeat X to the length of U
                                      s : Slice from index
                                      X² : Duplicate X
                                      èr : Count the occurrences of "r"
                                      Ã :End map
                                      û :Centre pad each element with spaces to the length of the longest
                                      :Implicitly join with newlines and output




                                      Alternatives



                                      re ¬ËpUÊaD²èrÃû
                                      re ¬£îX rr²i^Ãû





                                      share|improve this answer


























                                        5












                                        5








                                        5







                                        Japt -R, 16 15 bytes



                                        re ¬£çX sX²èrÃû


                                        Try it



                                                            :Implicit input of string U
                                        re :Remove all "e"s
                                        ¬ :Split to array of characters
                                        £ :Map each X
                                        çX : Repeat X to the length of U
                                        s : Slice from index
                                        X² : Duplicate X
                                        èr : Count the occurrences of "r"
                                        Ã :End map
                                        û :Centre pad each element with spaces to the length of the longest
                                        :Implicitly join with newlines and output




                                        Alternatives



                                        re ¬ËpUÊaD²èrÃû
                                        re ¬£îX rr²i^Ãû





                                        share|improve this answer















                                        Japt -R, 16 15 bytes



                                        re ¬£çX sX²èrÃû


                                        Try it



                                                            :Implicit input of string U
                                        re :Remove all "e"s
                                        ¬ :Split to array of characters
                                        £ :Map each X
                                        çX : Repeat X to the length of U
                                        s : Slice from index
                                        X² : Duplicate X
                                        èr : Count the occurrences of "r"
                                        Ã :End map
                                        û :Centre pad each element with spaces to the length of the longest
                                        :Implicitly join with newlines and output




                                        Alternatives



                                        re ¬ËpUÊaD²èrÃû
                                        re ¬£îX rr²i^Ãû






                                        share|improve this answer














                                        share|improve this answer



                                        share|improve this answer








                                        edited 14 hours ago

























                                        answered 21 hours ago









                                        Shaggy

                                        19k21666




                                        19k21666























                                            5















                                            C# (Visual C# Interactive Compiler), 95 bytes





                                            n=>n.Replace("o",new String('-',n.Length)+"n").Replace("re"," ".PadRight(n.Length-1,'|')+"n")


                                            Try it online!



                                            Alternative using Aggregate, 108 bytes





                                            n=>n.Aggregate("",(d,c)=>d+(c<102?"":c<112?new String('-',n.Length)+"n":" ".PadRight(n.Length-1,'|')+"n"))


                                            Try it online!






                                            share|improve this answer



















                                            • 1




                                              now it trims trailing spaces..
                                              – dzaima
                                              yesterday










                                            • There was enough feedback that I removed the trailing newline rule. Feel free to update your entry.
                                              – GammaGames
                                              yesterday










                                            • Your replace doesn't work when the input is o, since the n.Length-2 will result in -1.
                                              – Kevin Cruijssen
                                              19 hours ago










                                            • The n.Length-2 is is for when the input has re.
                                              – Embodiment of Ignorance
                                              12 hours ago
















                                            5















                                            C# (Visual C# Interactive Compiler), 95 bytes





                                            n=>n.Replace("o",new String('-',n.Length)+"n").Replace("re"," ".PadRight(n.Length-1,'|')+"n")


                                            Try it online!



                                            Alternative using Aggregate, 108 bytes





                                            n=>n.Aggregate("",(d,c)=>d+(c<102?"":c<112?new String('-',n.Length)+"n":" ".PadRight(n.Length-1,'|')+"n"))


                                            Try it online!






                                            share|improve this answer



















                                            • 1




                                              now it trims trailing spaces..
                                              – dzaima
                                              yesterday










                                            • There was enough feedback that I removed the trailing newline rule. Feel free to update your entry.
                                              – GammaGames
                                              yesterday










                                            • Your replace doesn't work when the input is o, since the n.Length-2 will result in -1.
                                              – Kevin Cruijssen
                                              19 hours ago










                                            • The n.Length-2 is is for when the input has re.
                                              – Embodiment of Ignorance
                                              12 hours ago














                                            5












                                            5








                                            5







                                            C# (Visual C# Interactive Compiler), 95 bytes





                                            n=>n.Replace("o",new String('-',n.Length)+"n").Replace("re"," ".PadRight(n.Length-1,'|')+"n")


                                            Try it online!



                                            Alternative using Aggregate, 108 bytes





                                            n=>n.Aggregate("",(d,c)=>d+(c<102?"":c<112?new String('-',n.Length)+"n":" ".PadRight(n.Length-1,'|')+"n"))


                                            Try it online!






                                            share|improve this answer















                                            C# (Visual C# Interactive Compiler), 95 bytes





                                            n=>n.Replace("o",new String('-',n.Length)+"n").Replace("re"," ".PadRight(n.Length-1,'|')+"n")


                                            Try it online!



                                            Alternative using Aggregate, 108 bytes





                                            n=>n.Aggregate("",(d,c)=>d+(c<102?"":c<112?new String('-',n.Length)+"n":" ".PadRight(n.Length-1,'|')+"n"))


                                            Try it online!







                                            share|improve this answer














                                            share|improve this answer



                                            share|improve this answer








                                            edited 12 hours ago

























                                            answered yesterday









                                            Embodiment of Ignorance

                                            55014




                                            55014








                                            • 1




                                              now it trims trailing spaces..
                                              – dzaima
                                              yesterday










                                            • There was enough feedback that I removed the trailing newline rule. Feel free to update your entry.
                                              – GammaGames
                                              yesterday










                                            • Your replace doesn't work when the input is o, since the n.Length-2 will result in -1.
                                              – Kevin Cruijssen
                                              19 hours ago










                                            • The n.Length-2 is is for when the input has re.
                                              – Embodiment of Ignorance
                                              12 hours ago














                                            • 1




                                              now it trims trailing spaces..
                                              – dzaima
                                              yesterday










                                            • There was enough feedback that I removed the trailing newline rule. Feel free to update your entry.
                                              – GammaGames
                                              yesterday










                                            • Your replace doesn't work when the input is o, since the n.Length-2 will result in -1.
                                              – Kevin Cruijssen
                                              19 hours ago










                                            • The n.Length-2 is is for when the input has re.
                                              – Embodiment of Ignorance
                                              12 hours ago








                                            1




                                            1




                                            now it trims trailing spaces..
                                            – dzaima
                                            yesterday




                                            now it trims trailing spaces..
                                            – dzaima
                                            yesterday












                                            There was enough feedback that I removed the trailing newline rule. Feel free to update your entry.
                                            – GammaGames
                                            yesterday




                                            There was enough feedback that I removed the trailing newline rule. Feel free to update your entry.
                                            – GammaGames
                                            yesterday












                                            Your replace doesn't work when the input is o, since the n.Length-2 will result in -1.
                                            – Kevin Cruijssen
                                            19 hours ago




                                            Your replace doesn't work when the input is o, since the n.Length-2 will result in -1.
                                            – Kevin Cruijssen
                                            19 hours ago












                                            The n.Length-2 is is for when the input has re.
                                            – Embodiment of Ignorance
                                            12 hours ago




                                            The n.Length-2 is is for when the input has re.
                                            – Embodiment of Ignorance
                                            12 hours ago











                                            5















                                            R, 119 118 bytes





                                            function(s,N=nchar(s)){m=t(replicate(N,el(strsplit(gsub('re',0,s),''))))
                                            m[m<1&row(m)%in%c(1,N)]=' '
                                            write(m,1,N,,'')}


                                            Try it online!




                                            • -1 byte thanks to @Giuseppe


                                            Unrolled code and explanation :



                                            function(s){                       # s is the input string, e.g. 'oreo'

                                            N = nchar(s) # store the length of s into N, e.g. 4

                                            s1 = gsub('re',0,s) # replace 're' with '0' and store in s1, e.g. 'o0o'

                                            v = el(strsplit(s1,'')) # split s1 into a vector v of single characters
                                            # e.g. 'o','0','o'

                                            m = replicate(N,v) # evaluate N times the vector v and arrange
                                            # the result into a matrix m (nchar(s1) x N)
                                            # e.g.
                                            # 'o' 'o' 'o' 'o'
                                            # '0' '0' '0' '0'
                                            # 'o' 'o' 'o' 'o'


                                            m = t(m) # transpose the matrix

                                            m[m<1 & row(m)%in%c(1,N)] = ' ' # substitute the zeros (i.e. where < 1)
                                            # on the 1st and last row of the matrix with ' ' (space)
                                            # e.g.
                                            # 'o' ' ' 'o'
                                            # 'o' '0' 'o'
                                            # 'o' '0' 'o'
                                            # 'o' ' ' 'o'

                                            write(m,1,N,,'') # write the matrix to stdout (write function transposes it)
                                            # e.g.
                                            # oooo
                                            # 00
                                            # oooo
                                            }





                                            share|improve this answer























                                            • 106 bytes
                                              – Giuseppe
                                              6 hours ago










                                            • aaand 104 bytes returning a list of lines, which isn't acceptable here, but it's an interesting idea (essentially my SNOBOL submission translated to R)
                                              – Giuseppe
                                              6 hours ago
















                                            5















                                            R, 119 118 bytes





                                            function(s,N=nchar(s)){m=t(replicate(N,el(strsplit(gsub('re',0,s),''))))
                                            m[m<1&row(m)%in%c(1,N)]=' '
                                            write(m,1,N,,'')}


                                            Try it online!




                                            • -1 byte thanks to @Giuseppe


                                            Unrolled code and explanation :



                                            function(s){                       # s is the input string, e.g. 'oreo'

                                            N = nchar(s) # store the length of s into N, e.g. 4

                                            s1 = gsub('re',0,s) # replace 're' with '0' and store in s1, e.g. 'o0o'

                                            v = el(strsplit(s1,'')) # split s1 into a vector v of single characters
                                            # e.g. 'o','0','o'

                                            m = replicate(N,v) # evaluate N times the vector v and arrange
                                            # the result into a matrix m (nchar(s1) x N)
                                            # e.g.
                                            # 'o' 'o' 'o' 'o'
                                            # '0' '0' '0' '0'
                                            # 'o' 'o' 'o' 'o'


                                            m = t(m) # transpose the matrix

                                            m[m<1 & row(m)%in%c(1,N)] = ' ' # substitute the zeros (i.e. where < 1)
                                            # on the 1st and last row of the matrix with ' ' (space)
                                            # e.g.
                                            # 'o' ' ' 'o'
                                            # 'o' '0' 'o'
                                            # 'o' '0' 'o'
                                            # 'o' ' ' 'o'

                                            write(m,1,N,,'') # write the matrix to stdout (write function transposes it)
                                            # e.g.
                                            # oooo
                                            # 00
                                            # oooo
                                            }





                                            share|improve this answer























                                            • 106 bytes
                                              – Giuseppe
                                              6 hours ago










                                            • aaand 104 bytes returning a list of lines, which isn't acceptable here, but it's an interesting idea (essentially my SNOBOL submission translated to R)
                                              – Giuseppe
                                              6 hours ago














                                            5












                                            5








                                            5







                                            R, 119 118 bytes





                                            function(s,N=nchar(s)){m=t(replicate(N,el(strsplit(gsub('re',0,s),''))))
                                            m[m<1&row(m)%in%c(1,N)]=' '
                                            write(m,1,N,,'')}


                                            Try it online!




                                            • -1 byte thanks to @Giuseppe


                                            Unrolled code and explanation :



                                            function(s){                       # s is the input string, e.g. 'oreo'

                                            N = nchar(s) # store the length of s into N, e.g. 4

                                            s1 = gsub('re',0,s) # replace 're' with '0' and store in s1, e.g. 'o0o'

                                            v = el(strsplit(s1,'')) # split s1 into a vector v of single characters
                                            # e.g. 'o','0','o'

                                            m = replicate(N,v) # evaluate N times the vector v and arrange
                                            # the result into a matrix m (nchar(s1) x N)
                                            # e.g.
                                            # 'o' 'o' 'o' 'o'
                                            # '0' '0' '0' '0'
                                            # 'o' 'o' 'o' 'o'


                                            m = t(m) # transpose the matrix

                                            m[m<1 & row(m)%in%c(1,N)] = ' ' # substitute the zeros (i.e. where < 1)
                                            # on the 1st and last row of the matrix with ' ' (space)
                                            # e.g.
                                            # 'o' ' ' 'o'
                                            # 'o' '0' 'o'
                                            # 'o' '0' 'o'
                                            # 'o' ' ' 'o'

                                            write(m,1,N,,'') # write the matrix to stdout (write function transposes it)
                                            # e.g.
                                            # oooo
                                            # 00
                                            # oooo
                                            }





                                            share|improve this answer















                                            R, 119 118 bytes





                                            function(s,N=nchar(s)){m=t(replicate(N,el(strsplit(gsub('re',0,s),''))))
                                            m[m<1&row(m)%in%c(1,N)]=' '
                                            write(m,1,N,,'')}


                                            Try it online!




                                            • -1 byte thanks to @Giuseppe


                                            Unrolled code and explanation :



                                            function(s){                       # s is the input string, e.g. 'oreo'

                                            N = nchar(s) # store the length of s into N, e.g. 4

                                            s1 = gsub('re',0,s) # replace 're' with '0' and store in s1, e.g. 'o0o'

                                            v = el(strsplit(s1,'')) # split s1 into a vector v of single characters
                                            # e.g. 'o','0','o'

                                            m = replicate(N,v) # evaluate N times the vector v and arrange
                                            # the result into a matrix m (nchar(s1) x N)
                                            # e.g.
                                            # 'o' 'o' 'o' 'o'
                                            # '0' '0' '0' '0'
                                            # 'o' 'o' 'o' 'o'


                                            m = t(m) # transpose the matrix

                                            m[m<1 & row(m)%in%c(1,N)] = ' ' # substitute the zeros (i.e. where < 1)
                                            # on the 1st and last row of the matrix with ' ' (space)
                                            # e.g.
                                            # 'o' ' ' 'o'
                                            # 'o' '0' 'o'
                                            # 'o' '0' 'o'
                                            # 'o' ' ' 'o'

                                            write(m,1,N,,'') # write the matrix to stdout (write function transposes it)
                                            # e.g.
                                            # oooo
                                            # 00
                                            # oooo
                                            }






                                            share|improve this answer














                                            share|improve this answer



                                            share|improve this answer








                                            edited 12 hours ago

























                                            answered 20 hours ago









                                            digEmAll

                                            2,579411




                                            2,579411












                                            • 106 bytes
                                              – Giuseppe
                                              6 hours ago










                                            • aaand 104 bytes returning a list of lines, which isn't acceptable here, but it's an interesting idea (essentially my SNOBOL submission translated to R)
                                              – Giuseppe
                                              6 hours ago


















                                            • 106 bytes
                                              – Giuseppe
                                              6 hours ago










                                            • aaand 104 bytes returning a list of lines, which isn't acceptable here, but it's an interesting idea (essentially my SNOBOL submission translated to R)
                                              – Giuseppe
                                              6 hours ago
















                                            106 bytes
                                            – Giuseppe
                                            6 hours ago




                                            106 bytes
                                            – Giuseppe
                                            6 hours ago












                                            aaand 104 bytes returning a list of lines, which isn't acceptable here, but it's an interesting idea (essentially my SNOBOL submission translated to R)
                                            – Giuseppe
                                            6 hours ago




                                            aaand 104 bytes returning a list of lines, which isn't acceptable here, but it's an interesting idea (essentially my SNOBOL submission translated to R)
                                            – Giuseppe
                                            6 hours ago











                                            4















                                            Retina, 74 73 bytes



                                            I feel like I haven't posted an answer in a very long time. Well, here I am. Also, Retina has changed a lot, and I feel like I suck at it now.



                                            .+
                                            $0$.0
                                            (d+)
                                            *
                                            e

                                            o|r
                                            $&¶
                                            _$

                                            +(/_/&`o¶
                                            oo¶
                                            _$

                                            )/_/&`r¶
                                            rr¶
                                            ¶$

                                            m`^r



                                            Try it online!






                                            share|improve this answer



















                                            • 1




                                              Whoa, what a crazy looking language. I like it!
                                              – GammaGames
                                              yesterday










                                            • doesn't include trailing whitespaces..
                                              – dzaima
                                              yesterday






                                            • 2




                                              I like how [or] means o or r instead of [ or ]. Makes my head hurt.
                                              – nedla2004
                                              yesterday










                                            • @dzaima The question does not specify that trailing whitespaces are required. A comment asked, but no reply was given.
                                              – mbomb007
                                              9 hours ago










                                            • @nedla2004 That actually helped me notice a way to save a byte. Thanks.
                                              – mbomb007
                                              9 hours ago
















                                            4















                                            Retina, 74 73 bytes



                                            I feel like I haven't posted an answer in a very long time. Well, here I am. Also, Retina has changed a lot, and I feel like I suck at it now.



                                            .+
                                            $0$.0
                                            (d+)
                                            *
                                            e

                                            o|r
                                            $&¶
                                            _$

                                            +(/_/&`o¶
                                            oo¶
                                            _$

                                            )/_/&`r¶
                                            rr¶
                                            ¶$

                                            m`^r



                                            Try it online!






                                            share|improve this answer



















                                            • 1




                                              Whoa, what a crazy looking language. I like it!
                                              – GammaGames
                                              yesterday










                                            • doesn't include trailing whitespaces..
                                              – dzaima
                                              yesterday






                                            • 2




                                              I like how [or] means o or r instead of [ or ]. Makes my head hurt.
                                              – nedla2004
                                              yesterday










                                            • @dzaima The question does not specify that trailing whitespaces are required. A comment asked, but no reply was given.
                                              – mbomb007
                                              9 hours ago










                                            • @nedla2004 That actually helped me notice a way to save a byte. Thanks.
                                              – mbomb007
                                              9 hours ago














                                            4












                                            4








                                            4







                                            Retina, 74 73 bytes



                                            I feel like I haven't posted an answer in a very long time. Well, here I am. Also, Retina has changed a lot, and I feel like I suck at it now.



                                            .+
                                            $0$.0
                                            (d+)
                                            *
                                            e

                                            o|r
                                            $&¶
                                            _$

                                            +(/_/&`o¶
                                            oo¶
                                            _$

                                            )/_/&`r¶
                                            rr¶
                                            ¶$

                                            m`^r



                                            Try it online!






                                            share|improve this answer















                                            Retina, 74 73 bytes



                                            I feel like I haven't posted an answer in a very long time. Well, here I am. Also, Retina has changed a lot, and I feel like I suck at it now.



                                            .+
                                            $0$.0
                                            (d+)
                                            *
                                            e

                                            o|r
                                            $&¶
                                            _$

                                            +(/_/&`o¶
                                            oo¶
                                            _$

                                            )/_/&`r¶
                                            rr¶
                                            ¶$

                                            m`^r



                                            Try it online!







                                            share|improve this answer














                                            share|improve this answer



                                            share|improve this answer








                                            edited 9 hours ago

























                                            answered yesterday









                                            mbomb007

                                            17.5k542118




                                            17.5k542118








                                            • 1




                                              Whoa, what a crazy looking language. I like it!
                                              – GammaGames
                                              yesterday










                                            • doesn't include trailing whitespaces..
                                              – dzaima
                                              yesterday






                                            • 2




                                              I like how [or] means o or r instead of [ or ]. Makes my head hurt.
                                              – nedla2004
                                              yesterday










                                            • @dzaima The question does not specify that trailing whitespaces are required. A comment asked, but no reply was given.
                                              – mbomb007
                                              9 hours ago










                                            • @nedla2004 That actually helped me notice a way to save a byte. Thanks.
                                              – mbomb007
                                              9 hours ago














                                            • 1




                                              Whoa, what a crazy looking language. I like it!
                                              – GammaGames
                                              yesterday










                                            • doesn't include trailing whitespaces..
                                              – dzaima
                                              yesterday






                                            • 2




                                              I like how [or] means o or r instead of [ or ]. Makes my head hurt.
                                              – nedla2004
                                              yesterday










                                            • @dzaima The question does not specify that trailing whitespaces are required. A comment asked, but no reply was given.
                                              – mbomb007
                                              9 hours ago










                                            • @nedla2004 That actually helped me notice a way to save a byte. Thanks.
                                              – mbomb007
                                              9 hours ago








                                            1




                                            1




                                            Whoa, what a crazy looking language. I like it!
                                            – GammaGames
                                            yesterday




                                            Whoa, what a crazy looking language. I like it!
                                            – GammaGames
                                            yesterday












                                            doesn't include trailing whitespaces..
                                            – dzaima
                                            yesterday




                                            doesn't include trailing whitespaces..
                                            – dzaima
                                            yesterday




                                            2




                                            2




                                            I like how [or] means o or r instead of [ or ]. Makes my head hurt.
                                            – nedla2004
                                            yesterday




                                            I like how [or] means o or r instead of [ or ]. Makes my head hurt.
                                            – nedla2004
                                            yesterday












                                            @dzaima The question does not specify that trailing whitespaces are required. A comment asked, but no reply was given.
                                            – mbomb007
                                            9 hours ago




                                            @dzaima The question does not specify that trailing whitespaces are required. A comment asked, but no reply was given.
                                            – mbomb007
                                            9 hours ago












                                            @nedla2004 That actually helped me notice a way to save a byte. Thanks.
                                            – mbomb007
                                            9 hours ago




                                            @nedla2004 That actually helped me notice a way to save a byte. Thanks.
                                            – mbomb007
                                            9 hours ago











                                            3















                                            Jelly,  16  14 bytes



                                            OḂƇẒẋ€LaØ.¦€⁶Y


                                            Uses 1 for the cream and 0 for the cookie.



                                            Try it online!



                                            How?



                                            OḂƇẒẋ€LaØ.¦€⁶Y - Main Link: list of characters, V    e.g. 'orereo'
                                            O - ordinal (vectorises) [111,114,101,114,101,111]
                                            Ƈ - filter keep those for which:
                                            Ḃ - modulo 2 [111, 101, 101,111]
                                            Ẓ - is prime? (vectorises) [ 0, 1, 1, 0]
                                            ẋ€ - repeat each by:
                                            L - length (of V) [[0,0,0,0,0,0],[1,1,1,1,1,1],[1,1,1,1,1,1],[0,0,0,0,0,0]]
                                            € - for each:
                                            ¦ - sparse application...
                                            Ø. - ...to indices: literal [0,1] (0 is the rightmost index, 1 is the leftmost)
                                            a - ...apply: logical AND with:
                                            ⁶ - space character [[0,0,0,0,0,0],[' ',1,1,1,1,' '],[' ',1,1,1,1,' '],[0,0,0,0,0,0]]
                                            Y - join with newline characters [0,0,0,0,0,0,'n',' ',1,1,1,1,' ','n',' ',1,1,1,1,' ','n',0,0,0,0,0,0]
                                            - implicit print ...smashes everything together:
                                            - 000000
                                            - 1111
                                            - 1111
                                            - 000000




                                            Previous 16 byter:



                                            ḟ”eẋ€Ly@Ø.¦€⁾r Y


                                            Uses r for the cream and o for the cookie.



                                            Try it online!






                                            share|improve this answer























                                            • I was hoping for a Jelly entry, such an interesting language!
                                              – GammaGames
                                              11 hours ago










                                            • Just trying to create something more terse. Will give explanation later... :)
                                              – Jonathan Allan
                                              11 hours ago








                                            • 1




                                              ...hoorah, that's more like it :)
                                              – Jonathan Allan
                                              10 hours ago
















                                            3















                                            Jelly,  16  14 bytes



                                            OḂƇẒẋ€LaØ.¦€⁶Y


                                            Uses 1 for the cream and 0 for the cookie.



                                            Try it online!



                                            How?



                                            OḂƇẒẋ€LaØ.¦€⁶Y - Main Link: list of characters, V    e.g. 'orereo'
                                            O - ordinal (vectorises) [111,114,101,114,101,111]
                                            Ƈ - filter keep those for which:
                                            Ḃ - modulo 2 [111, 101, 101,111]
                                            Ẓ - is prime? (vectorises) [ 0, 1, 1, 0]
                                            ẋ€ - repeat each by:
                                            L - length (of V) [[0,0,0,0,0,0],[1,1,1,1,1,1],[1,1,1,1,1,1],[0,0,0,0,0,0]]
                                            € - for each:
                                            ¦ - sparse application...
                                            Ø. - ...to indices: literal [0,1] (0 is the rightmost index, 1 is the leftmost)
                                            a - ...apply: logical AND with:
                                            ⁶ - space character [[0,0,0,0,0,0],[' ',1,1,1,1,' '],[' ',1,1,1,1,' '],[0,0,0,0,0,0]]
                                            Y - join with newline characters [0,0,0,0,0,0,'n',' ',1,1,1,1,' ','n',' ',1,1,1,1,' ','n',0,0,0,0,0,0]
                                            - implicit print ...smashes everything together:
                                            - 000000
                                            - 1111
                                            - 1111
                                            - 000000




                                            Previous 16 byter:



                                            ḟ”eẋ€Ly@Ø.¦€⁾r Y


                                            Uses r for the cream and o for the cookie.



                                            Try it online!






                                            share|improve this answer























                                            • I was hoping for a Jelly entry, such an interesting language!
                                              – GammaGames
                                              11 hours ago










                                            • Just trying to create something more terse. Will give explanation later... :)
                                              – Jonathan Allan
                                              11 hours ago








                                            • 1




                                              ...hoorah, that's more like it :)
                                              – Jonathan Allan
                                              10 hours ago














                                            3












                                            3








                                            3







                                            Jelly,  16  14 bytes



                                            OḂƇẒẋ€LaØ.¦€⁶Y


                                            Uses 1 for the cream and 0 for the cookie.



                                            Try it online!



                                            How?



                                            OḂƇẒẋ€LaØ.¦€⁶Y - Main Link: list of characters, V    e.g. 'orereo'
                                            O - ordinal (vectorises) [111,114,101,114,101,111]
                                            Ƈ - filter keep those for which:
                                            Ḃ - modulo 2 [111, 101, 101,111]
                                            Ẓ - is prime? (vectorises) [ 0, 1, 1, 0]
                                            ẋ€ - repeat each by:
                                            L - length (of V) [[0,0,0,0,0,0],[1,1,1,1,1,1],[1,1,1,1,1,1],[0,0,0,0,0,0]]
                                            € - for each:
                                            ¦ - sparse application...
                                            Ø. - ...to indices: literal [0,1] (0 is the rightmost index, 1 is the leftmost)
                                            a - ...apply: logical AND with:
                                            ⁶ - space character [[0,0,0,0,0,0],[' ',1,1,1,1,' '],[' ',1,1,1,1,' '],[0,0,0,0,0,0]]
                                            Y - join with newline characters [0,0,0,0,0,0,'n',' ',1,1,1,1,' ','n',' ',1,1,1,1,' ','n',0,0,0,0,0,0]
                                            - implicit print ...smashes everything together:
                                            - 000000
                                            - 1111
                                            - 1111
                                            - 000000




                                            Previous 16 byter:



                                            ḟ”eẋ€Ly@Ø.¦€⁾r Y


                                            Uses r for the cream and o for the cookie.



                                            Try it online!






                                            share|improve this answer















                                            Jelly,  16  14 bytes



                                            OḂƇẒẋ€LaØ.¦€⁶Y


                                            Uses 1 for the cream and 0 for the cookie.



                                            Try it online!



                                            How?



                                            OḂƇẒẋ€LaØ.¦€⁶Y - Main Link: list of characters, V    e.g. 'orereo'
                                            O - ordinal (vectorises) [111,114,101,114,101,111]
                                            Ƈ - filter keep those for which:
                                            Ḃ - modulo 2 [111, 101, 101,111]
                                            Ẓ - is prime? (vectorises) [ 0, 1, 1, 0]
                                            ẋ€ - repeat each by:
                                            L - length (of V) [[0,0,0,0,0,0],[1,1,1,1,1,1],[1,1,1,1,1,1],[0,0,0,0,0,0]]
                                            € - for each:
                                            ¦ - sparse application...
                                            Ø. - ...to indices: literal [0,1] (0 is the rightmost index, 1 is the leftmost)
                                            a - ...apply: logical AND with:
                                            ⁶ - space character [[0,0,0,0,0,0],[' ',1,1,1,1,' '],[' ',1,1,1,1,' '],[0,0,0,0,0,0]]
                                            Y - join with newline characters [0,0,0,0,0,0,'n',' ',1,1,1,1,' ','n',' ',1,1,1,1,' ','n',0,0,0,0,0,0]
                                            - implicit print ...smashes everything together:
                                            - 000000
                                            - 1111
                                            - 1111
                                            - 000000




                                            Previous 16 byter:



                                            ḟ”eẋ€Ly@Ø.¦€⁾r Y


                                            Uses r for the cream and o for the cookie.



                                            Try it online!







                                            share|improve this answer














                                            share|improve this answer



                                            share|improve this answer








                                            edited 10 hours ago

























                                            answered 11 hours ago









                                            Jonathan Allan

                                            50.8k534165




                                            50.8k534165












                                            • I was hoping for a Jelly entry, such an interesting language!
                                              – GammaGames
                                              11 hours ago










                                            • Just trying to create something more terse. Will give explanation later... :)
                                              – Jonathan Allan
                                              11 hours ago








                                            • 1




                                              ...hoorah, that's more like it :)
                                              – Jonathan Allan
                                              10 hours ago


















                                            • I was hoping for a Jelly entry, such an interesting language!
                                              – GammaGames
                                              11 hours ago










                                            • Just trying to create something more terse. Will give explanation later... :)
                                              – Jonathan Allan
                                              11 hours ago








                                            • 1




                                              ...hoorah, that's more like it :)
                                              – Jonathan Allan
                                              10 hours ago
















                                            I was hoping for a Jelly entry, such an interesting language!
                                            – GammaGames
                                            11 hours ago




                                            I was hoping for a Jelly entry, such an interesting language!
                                            – GammaGames
                                            11 hours ago












                                            Just trying to create something more terse. Will give explanation later... :)
                                            – Jonathan Allan
                                            11 hours ago






                                            Just trying to create something more terse. Will give explanation later... :)
                                            – Jonathan Allan
                                            11 hours ago






                                            1




                                            1




                                            ...hoorah, that's more like it :)
                                            – Jonathan Allan
                                            10 hours ago




                                            ...hoorah, that's more like it :)
                                            – Jonathan Allan
                                            10 hours ago











                                            2














                                            JavaScript ES6, 103 bytes



                                            Using replace 103 bytes:





                                            x=>x.replace(/o/g,"-".repeat(s=x.length)+`
                                            `).replace(/re/g," "+"|".repeat(s>1?s-2:0)+`
                                            `).slice(0,-1)


                                            Try it online!



                                            Using split and map 116 bytes:





                                            x=>x.split("re").map(y=>("-"[h='repeat'](r=x.length)+`
                                            `)[h](y.length)).join(" "+"|"[h](r>1?r-2:0)+`
                                            `).slice(0,-1)


                                            Try it online!






                                            share|improve this answer























                                            • JS, nice! You reminded me that I was going to add a rule about not having line returns at the end of the output, I've added it. Sorry about that!
                                              – GammaGames
                                              yesterday






                                            • 3




                                              just removing the final newline is 12 bytes
                                              – fəˈnɛtɪk
                                              yesterday










                                            • There was enough feedback that I removed the trailing newline rule. Feel free to update your entry.
                                              – GammaGames
                                              yesterday






                                            • 2




                                              You can save a byte by using a template string with ${"|".repeat(s>1?s-2:0)} and its whitespaces, instead of using " "+"|".repeat(s>1?s-2:0).
                                              – Ismael Miguel
                                              19 hours ago


















                                            2














                                            JavaScript ES6, 103 bytes



                                            Using replace 103 bytes:





                                            x=>x.replace(/o/g,"-".repeat(s=x.length)+`
                                            `).replace(/re/g," "+"|".repeat(s>1?s-2:0)+`
                                            `).slice(0,-1)


                                            Try it online!



                                            Using split and map 116 bytes:





                                            x=>x.split("re").map(y=>("-"[h='repeat'](r=x.length)+`
                                            `)[h](y.length)).join(" "+"|"[h](r>1?r-2:0)+`
                                            `).slice(0,-1)


                                            Try it online!






                                            share|improve this answer























                                            • JS, nice! You reminded me that I was going to add a rule about not having line returns at the end of the output, I've added it. Sorry about that!
                                              – GammaGames
                                              yesterday






                                            • 3




                                              just removing the final newline is 12 bytes
                                              – fəˈnɛtɪk
                                              yesterday










                                            • There was enough feedback that I removed the trailing newline rule. Feel free to update your entry.
                                              – GammaGames
                                              yesterday






                                            • 2




                                              You can save a byte by using a template string with ${"|".repeat(s>1?s-2:0)} and its whitespaces, instead of using " "+"|".repeat(s>1?s-2:0).
                                              – Ismael Miguel
                                              19 hours ago
















                                            2












                                            2








                                            2






                                            JavaScript ES6, 103 bytes



                                            Using replace 103 bytes:





                                            x=>x.replace(/o/g,"-".repeat(s=x.length)+`
                                            `).replace(/re/g," "+"|".repeat(s>1?s-2:0)+`
                                            `).slice(0,-1)


                                            Try it online!



                                            Using split and map 116 bytes:





                                            x=>x.split("re").map(y=>("-"[h='repeat'](r=x.length)+`
                                            `)[h](y.length)).join(" "+"|"[h](r>1?r-2:0)+`
                                            `).slice(0,-1)


                                            Try it online!






                                            share|improve this answer














                                            JavaScript ES6, 103 bytes



                                            Using replace 103 bytes:





                                            x=>x.replace(/o/g,"-".repeat(s=x.length)+`
                                            `).replace(/re/g," "+"|".repeat(s>1?s-2:0)+`
                                            `).slice(0,-1)


                                            Try it online!



                                            Using split and map 116 bytes:





                                            x=>x.split("re").map(y=>("-"[h='repeat'](r=x.length)+`
                                            `)[h](y.length)).join(" "+"|"[h](r>1?r-2:0)+`
                                            `).slice(0,-1)


                                            Try it online!







                                            share|improve this answer














                                            share|improve this answer



                                            share|improve this answer








                                            edited yesterday

























                                            answered yesterday









                                            fəˈnɛtɪk

                                            3,5731537




                                            3,5731537












                                            • JS, nice! You reminded me that I was going to add a rule about not having line returns at the end of the output, I've added it. Sorry about that!
                                              – GammaGames
                                              yesterday






                                            • 3




                                              just removing the final newline is 12 bytes
                                              – fəˈnɛtɪk
                                              yesterday










                                            • There was enough feedback that I removed the trailing newline rule. Feel free to update your entry.
                                              – GammaGames
                                              yesterday






                                            • 2




                                              You can save a byte by using a template string with ${"|".repeat(s>1?s-2:0)} and its whitespaces, instead of using " "+"|".repeat(s>1?s-2:0).
                                              – Ismael Miguel
                                              19 hours ago




















                                            • JS, nice! You reminded me that I was going to add a rule about not having line returns at the end of the output, I've added it. Sorry about that!
                                              – GammaGames
                                              yesterday






                                            • 3




                                              just removing the final newline is 12 bytes
                                              – fəˈnɛtɪk
                                              yesterday










                                            • There was enough feedback that I removed the trailing newline rule. Feel free to update your entry.
                                              – GammaGames
                                              yesterday






                                            • 2




                                              You can save a byte by using a template string with ${"|".repeat(s>1?s-2:0)} and its whitespaces, instead of using " "+"|".repeat(s>1?s-2:0).
                                              – Ismael Miguel
                                              19 hours ago


















                                            JS, nice! You reminded me that I was going to add a rule about not having line returns at the end of the output, I've added it. Sorry about that!
                                            – GammaGames
                                            yesterday




                                            JS, nice! You reminded me that I was going to add a rule about not having line returns at the end of the output, I've added it. Sorry about that!
                                            – GammaGames
                                            yesterday




                                            3




                                            3




                                            just removing the final newline is 12 bytes
                                            – fəˈnɛtɪk
                                            yesterday




                                            just removing the final newline is 12 bytes
                                            – fəˈnɛtɪk
                                            yesterday












                                            There was enough feedback that I removed the trailing newline rule. Feel free to update your entry.
                                            – GammaGames
                                            yesterday




                                            There was enough feedback that I removed the trailing newline rule. Feel free to update your entry.
                                            – GammaGames
                                            yesterday




                                            2




                                            2




                                            You can save a byte by using a template string with ${"|".repeat(s>1?s-2:0)} and its whitespaces, instead of using " "+"|".repeat(s>1?s-2:0).
                                            – Ismael Miguel
                                            19 hours ago






                                            You can save a byte by using a template string with ${"|".repeat(s>1?s-2:0)} and its whitespaces, instead of using " "+"|".repeat(s>1?s-2:0).
                                            – Ismael Miguel
                                            19 hours ago













                                            2















                                            Retina, 21 bytes



                                            r

                                            L$`.
                                            $.+*$&
                                            bee



                                            Try it online! Explanation:



                                            r



                                            Delete the rs.



                                            L$`.
                                            $.+*$&amp;


                                            List each letter on its own line repeated to the length of the original input.



                                            bee



                                            Replace the first two ees on each line with a space.






                                            share|improve this answer


























                                              2















                                              Retina, 21 bytes



                                              r

                                              L$`.
                                              $.+*$&
                                              bee



                                              Try it online! Explanation:



                                              r



                                              Delete the rs.



                                              L$`.
                                              $.+*$&amp;


                                              List each letter on its own line repeated to the length of the original input.



                                              bee



                                              Replace the first two ees on each line with a space.






                                              share|improve this answer
























                                                2












                                                2








                                                2







                                                Retina, 21 bytes



                                                r

                                                L$`.
                                                $.+*$&
                                                bee



                                                Try it online! Explanation:



                                                r



                                                Delete the rs.



                                                L$`.
                                                $.+*$&amp;


                                                List each letter on its own line repeated to the length of the original input.



                                                bee



                                                Replace the first two ees on each line with a space.






                                                share|improve this answer













                                                Retina, 21 bytes



                                                r

                                                L$`.
                                                $.+*$&
                                                bee



                                                Try it online! Explanation:



                                                r



                                                Delete the rs.



                                                L$`.
                                                $.+*$&amp;


                                                List each letter on its own line repeated to the length of the original input.



                                                bee



                                                Replace the first two ees on each line with a space.







                                                share|improve this answer












                                                share|improve this answer



                                                share|improve this answer










                                                answered 16 hours ago









                                                Neil

                                                79.5k744177




                                                79.5k744177























                                                    2















                                                    Charcoal, 19 bytes



                                                    Fθ≡ιo⟦⭆θ#⟧e«→P⁻Lθ²↙


                                                    Try it online! Link is to verbose version of code. Explanation:



                                                    Fθ


                                                    Loop through the characters of the input string.



                                                    ≡ι


                                                    Switch on each character.



                                                    o⟦⭆θ#⟧


                                                    If it's an o then print the input string replaced with #s on its own line.



                                                    e«→P⁻Lθ²↙


                                                    If it's an e then move right, print a line of -s that's two less than the length of the input string, then move down and left.






                                                    share|improve this answer


























                                                      2















                                                      Charcoal, 19 bytes



                                                      Fθ≡ιo⟦⭆θ#⟧e«→P⁻Lθ²↙


                                                      Try it online! Link is to verbose version of code. Explanation:



                                                      Fθ


                                                      Loop through the characters of the input string.



                                                      ≡ι


                                                      Switch on each character.



                                                      o⟦⭆θ#⟧


                                                      If it's an o then print the input string replaced with #s on its own line.



                                                      e«→P⁻Lθ²↙


                                                      If it's an e then move right, print a line of -s that's two less than the length of the input string, then move down and left.






                                                      share|improve this answer
























                                                        2












                                                        2








                                                        2







                                                        Charcoal, 19 bytes



                                                        Fθ≡ιo⟦⭆θ#⟧e«→P⁻Lθ²↙


                                                        Try it online! Link is to verbose version of code. Explanation:



                                                        Fθ


                                                        Loop through the characters of the input string.



                                                        ≡ι


                                                        Switch on each character.



                                                        o⟦⭆θ#⟧


                                                        If it's an o then print the input string replaced with #s on its own line.



                                                        e«→P⁻Lθ²↙


                                                        If it's an e then move right, print a line of -s that's two less than the length of the input string, then move down and left.






                                                        share|improve this answer













                                                        Charcoal, 19 bytes



                                                        Fθ≡ιo⟦⭆θ#⟧e«→P⁻Lθ²↙


                                                        Try it online! Link is to verbose version of code. Explanation:



                                                        Fθ


                                                        Loop through the characters of the input string.



                                                        ≡ι


                                                        Switch on each character.



                                                        o⟦⭆θ#⟧


                                                        If it's an o then print the input string replaced with #s on its own line.



                                                        e«→P⁻Lθ²↙


                                                        If it's an e then move right, print a line of -s that's two less than the length of the input string, then move down and left.







                                                        share|improve this answer












                                                        share|improve this answer



                                                        share|improve this answer










                                                        answered 16 hours ago









                                                        Neil

                                                        79.5k744177




                                                        79.5k744177























                                                            2














                                                            Powershell, 71 bytes





                                                            $l="$args"|% le*
                                                            switch($args|% t*y){'o'{'#'*$l}'r'{" $('%'*($l-2)) "}}


                                                            Less golfed test script:



                                                            $f = {

                                                            $l="$args"|% length
                                                            switch($args|% t*y){
                                                            'o'{'#'*$l}
                                                            'r'{" $('%'*($l-2)) "}
                                                            }

                                                            }

                                                            @(

                                                            ,(
                                                            'oreo',
                                                            '####',
                                                            ' %% ',
                                                            '####'
                                                            )
                                                            ,(
                                                            'o',
                                                            '#'
                                                            )
                                                            ,(
                                                            're',
                                                            ' '
                                                            )
                                                            ,(
                                                            'rere',
                                                            ' %% ',
                                                            ' %% '
                                                            )
                                                            ,(
                                                            'oreoorererereoo',
                                                            '###############',
                                                            ' %%%%%%%%%%%%% ',
                                                            '###############',
                                                            '###############',
                                                            ' %%%%%%%%%%%%% ',
                                                            ' %%%%%%%%%%%%% ',
                                                            ' %%%%%%%%%%%%% ',
                                                            ' %%%%%%%%%%%%% ',
                                                            '###############',
                                                            '###############'
                                                            )

                                                            ) | % {
                                                            $s,$expected = $_
                                                            $result = &$f $s
                                                            "$result"-eq"$expected"
                                                            # $result # uncomment this line to display a result
                                                            }


                                                            Output:



                                                            True
                                                            True
                                                            True
                                                            True
                                                            True





                                                            share|improve this answer





















                                                            • Looks like you don't need parens around the $args 69 bytes
                                                              – Veskah
                                                              5 hours ago
















                                                            2














                                                            Powershell, 71 bytes





                                                            $l="$args"|% le*
                                                            switch($args|% t*y){'o'{'#'*$l}'r'{" $('%'*($l-2)) "}}


                                                            Less golfed test script:



                                                            $f = {

                                                            $l="$args"|% length
                                                            switch($args|% t*y){
                                                            'o'{'#'*$l}
                                                            'r'{" $('%'*($l-2)) "}
                                                            }

                                                            }

                                                            @(

                                                            ,(
                                                            'oreo',
                                                            '####',
                                                            ' %% ',
                                                            '####'
                                                            )
                                                            ,(
                                                            'o',
                                                            '#'
                                                            )
                                                            ,(
                                                            're',
                                                            ' '
                                                            )
                                                            ,(
                                                            'rere',
                                                            ' %% ',
                                                            ' %% '
                                                            )
                                                            ,(
                                                            'oreoorererereoo',
                                                            '###############',
                                                            ' %%%%%%%%%%%%% ',
                                                            '###############',
                                                            '###############',
                                                            ' %%%%%%%%%%%%% ',
                                                            ' %%%%%%%%%%%%% ',
                                                            ' %%%%%%%%%%%%% ',
                                                            ' %%%%%%%%%%%%% ',
                                                            '###############',
                                                            '###############'
                                                            )

                                                            ) | % {
                                                            $s,$expected = $_
                                                            $result = &$f $s
                                                            "$result"-eq"$expected"
                                                            # $result # uncomment this line to display a result
                                                            }


                                                            Output:



                                                            True
                                                            True
                                                            True
                                                            True
                                                            True





                                                            share|improve this answer





















                                                            • Looks like you don't need parens around the $args 69 bytes
                                                              – Veskah
                                                              5 hours ago














                                                            2












                                                            2








                                                            2






                                                            Powershell, 71 bytes





                                                            $l="$args"|% le*
                                                            switch($args|% t*y){'o'{'#'*$l}'r'{" $('%'*($l-2)) "}}


                                                            Less golfed test script:



                                                            $f = {

                                                            $l="$args"|% length
                                                            switch($args|% t*y){
                                                            'o'{'#'*$l}
                                                            'r'{" $('%'*($l-2)) "}
                                                            }

                                                            }

                                                            @(

                                                            ,(
                                                            'oreo',
                                                            '####',
                                                            ' %% ',
                                                            '####'
                                                            )
                                                            ,(
                                                            'o',
                                                            '#'
                                                            )
                                                            ,(
                                                            're',
                                                            ' '
                                                            )
                                                            ,(
                                                            'rere',
                                                            ' %% ',
                                                            ' %% '
                                                            )
                                                            ,(
                                                            'oreoorererereoo',
                                                            '###############',
                                                            ' %%%%%%%%%%%%% ',
                                                            '###############',
                                                            '###############',
                                                            ' %%%%%%%%%%%%% ',
                                                            ' %%%%%%%%%%%%% ',
                                                            ' %%%%%%%%%%%%% ',
                                                            ' %%%%%%%%%%%%% ',
                                                            '###############',
                                                            '###############'
                                                            )

                                                            ) | % {
                                                            $s,$expected = $_
                                                            $result = &$f $s
                                                            "$result"-eq"$expected"
                                                            # $result # uncomment this line to display a result
                                                            }


                                                            Output:



                                                            True
                                                            True
                                                            True
                                                            True
                                                            True





                                                            share|improve this answer












                                                            Powershell, 71 bytes





                                                            $l="$args"|% le*
                                                            switch($args|% t*y){'o'{'#'*$l}'r'{" $('%'*($l-2)) "}}


                                                            Less golfed test script:



                                                            $f = {

                                                            $l="$args"|% length
                                                            switch($args|% t*y){
                                                            'o'{'#'*$l}
                                                            'r'{" $('%'*($l-2)) "}
                                                            }

                                                            }

                                                            @(

                                                            ,(
                                                            'oreo',
                                                            '####',
                                                            ' %% ',
                                                            '####'
                                                            )
                                                            ,(
                                                            'o',
                                                            '#'
                                                            )
                                                            ,(
                                                            're',
                                                            ' '
                                                            )
                                                            ,(
                                                            'rere',
                                                            ' %% ',
                                                            ' %% '
                                                            )
                                                            ,(
                                                            'oreoorererereoo',
                                                            '###############',
                                                            ' %%%%%%%%%%%%% ',
                                                            '###############',
                                                            '###############',
                                                            ' %%%%%%%%%%%%% ',
                                                            ' %%%%%%%%%%%%% ',
                                                            ' %%%%%%%%%%%%% ',
                                                            ' %%%%%%%%%%%%% ',
                                                            '###############',
                                                            '###############'
                                                            )

                                                            ) | % {
                                                            $s,$expected = $_
                                                            $result = &$f $s
                                                            "$result"-eq"$expected"
                                                            # $result # uncomment this line to display a result
                                                            }


                                                            Output:



                                                            True
                                                            True
                                                            True
                                                            True
                                                            True






                                                            share|improve this answer












                                                            share|improve this answer



                                                            share|improve this answer










                                                            answered 13 hours ago









                                                            mazzy

                                                            2,1751315




                                                            2,1751315












                                                            • Looks like you don't need parens around the $args 69 bytes
                                                              – Veskah
                                                              5 hours ago


















                                                            • Looks like you don't need parens around the $args 69 bytes
                                                              – Veskah
                                                              5 hours ago
















                                                            Looks like you don't need parens around the $args 69 bytes
                                                            – Veskah
                                                            5 hours ago




                                                            Looks like you don't need parens around the $args 69 bytes
                                                            – Veskah
                                                            5 hours ago











                                                            2















                                                            Python 3, 77 bytes





                                                            lambda x:x.replace("o","-"*len(x)+"n").replace("re"," "+'.'*(len(x)-2)+"n")


                                                            Try it online!






                                                            share|improve this answer























                                                            • Clever! I did intend the output to not be printing whitespace for the filling (it's pretty much oreo ascii), so I have edited the rules accordingly. Sorry about that! And I always love a python answer :)
                                                              – GammaGames
                                                              yesterday












                                                            • @JonathanFrech migth as well delete the comments, that approach was invalidated. I'll work on golfing more tomorrow.
                                                              – Riker
                                                              yesterday










                                                            • You can remove the space at +" n" to save a byte.
                                                              – Kevin Cruijssen
                                                              18 hours ago










                                                            • @KevinCruijssen can I? The input program says the whole cookie must be as wide as the input.
                                                              – Riker
                                                              13 hours ago










                                                            • I interpreted that as meaning that a trailing space is the same (visually) as no space. That's the beauty of answers to ascii art challenges. If they look right they are right :-)
                                                              – ElPedro
                                                              7 hours ago


















                                                            2















                                                            Python 3, 77 bytes





                                                            lambda x:x.replace("o","-"*len(x)+"n").replace("re"," "+'.'*(len(x)-2)+"n")


                                                            Try it online!






                                                            share|improve this answer























                                                            • Clever! I did intend the output to not be printing whitespace for the filling (it's pretty much oreo ascii), so I have edited the rules accordingly. Sorry about that! And I always love a python answer :)
                                                              – GammaGames
                                                              yesterday












                                                            • @JonathanFrech migth as well delete the comments, that approach was invalidated. I'll work on golfing more tomorrow.
                                                              – Riker
                                                              yesterday










                                                            • You can remove the space at +" n" to save a byte.
                                                              – Kevin Cruijssen
                                                              18 hours ago










                                                            • @KevinCruijssen can I? The input program says the whole cookie must be as wide as the input.
                                                              – Riker
                                                              13 hours ago










                                                            • I interpreted that as meaning that a trailing space is the same (visually) as no space. That's the beauty of answers to ascii art challenges. If they look right they are right :-)
                                                              – ElPedro
                                                              7 hours ago
















                                                            2












                                                            2








                                                            2







                                                            Python 3, 77 bytes





                                                            lambda x:x.replace("o","-"*len(x)+"n").replace("re"," "+'.'*(len(x)-2)+"n")


                                                            Try it online!






                                                            share|improve this answer















                                                            Python 3, 77 bytes





                                                            lambda x:x.replace("o","-"*len(x)+"n").replace("re"," "+'.'*(len(x)-2)+"n")


                                                            Try it online!







                                                            share|improve this answer














                                                            share|improve this answer



                                                            share|improve this answer








                                                            edited 7 hours ago

























                                                            answered yesterday









                                                            Riker

                                                            5,96042767




                                                            5,96042767












                                                            • Clever! I did intend the output to not be printing whitespace for the filling (it's pretty much oreo ascii), so I have edited the rules accordingly. Sorry about that! And I always love a python answer :)
                                                              – GammaGames
                                                              yesterday












                                                            • @JonathanFrech migth as well delete the comments, that approach was invalidated. I'll work on golfing more tomorrow.
                                                              – Riker
                                                              yesterday










                                                            • You can remove the space at +" n" to save a byte.
                                                              – Kevin Cruijssen
                                                              18 hours ago










                                                            • @KevinCruijssen can I? The input program says the whole cookie must be as wide as the input.
                                                              – Riker
                                                              13 hours ago










                                                            • I interpreted that as meaning that a trailing space is the same (visually) as no space. That's the beauty of answers to ascii art challenges. If they look right they are right :-)
                                                              – ElPedro
                                                              7 hours ago




















                                                            • Clever! I did intend the output to not be printing whitespace for the filling (it's pretty much oreo ascii), so I have edited the rules accordingly. Sorry about that! And I always love a python answer :)
                                                              – GammaGames
                                                              yesterday












                                                            • @JonathanFrech migth as well delete the comments, that approach was invalidated. I'll work on golfing more tomorrow.
                                                              – Riker
                                                              yesterday










                                                            • You can remove the space at +" n" to save a byte.
                                                              – Kevin Cruijssen
                                                              18 hours ago










                                                            • @KevinCruijssen can I? The input program says the whole cookie must be as wide as the input.
                                                              – Riker
                                                              13 hours ago










                                                            • I interpreted that as meaning that a trailing space is the same (visually) as no space. That's the beauty of answers to ascii art challenges. If they look right they are right :-)
                                                              – ElPedro
                                                              7 hours ago


















                                                            Clever! I did intend the output to not be printing whitespace for the filling (it's pretty much oreo ascii), so I have edited the rules accordingly. Sorry about that! And I always love a python answer :)
                                                            – GammaGames
                                                            yesterday






                                                            Clever! I did intend the output to not be printing whitespace for the filling (it's pretty much oreo ascii), so I have edited the rules accordingly. Sorry about that! And I always love a python answer :)
                                                            – GammaGames
                                                            yesterday














                                                            @JonathanFrech migth as well delete the comments, that approach was invalidated. I'll work on golfing more tomorrow.
                                                            – Riker
                                                            yesterday




                                                            @JonathanFrech migth as well delete the comments, that approach was invalidated. I'll work on golfing more tomorrow.
                                                            – Riker
                                                            yesterday












                                                            You can remove the space at +" n" to save a byte.
                                                            – Kevin Cruijssen
                                                            18 hours ago




                                                            You can remove the space at +" n" to save a byte.
                                                            – Kevin Cruijssen
                                                            18 hours ago












                                                            @KevinCruijssen can I? The input program says the whole cookie must be as wide as the input.
                                                            – Riker
                                                            13 hours ago




                                                            @KevinCruijssen can I? The input program says the whole cookie must be as wide as the input.
                                                            – Riker
                                                            13 hours ago












                                                            I interpreted that as meaning that a trailing space is the same (visually) as no space. That's the beauty of answers to ascii art challenges. If they look right they are right :-)
                                                            – ElPedro
                                                            7 hours ago






                                                            I interpreted that as meaning that a trailing space is the same (visually) as no space. That's the beauty of answers to ascii art challenges. If they look right they are right :-)
                                                            – ElPedro
                                                            7 hours ago













                                                            2















                                                            Pepe, 364 bytes



                                                            Unfortunately the online interpreter does not take care of compressing comments, hence all o characters will be replaced by a space.. Neither the spaces nor the o are necessary, so this could be 295 bytes, but I like it more this way:





                                                            rEeEEeeEeEororEEoreoreeeEeeeeeorEEEEeoREeoreorEeEEeEEEEororEEoreorEEEEEoREeoreorEeEEEeeEeororEEoreoReoREoREEEeoREEEEEoreorEorEEEeorEEEEEoreEoREeoreoREEeoREEEEeEeeoREEEeoREeeEoREEEeoREEEEEEEorEEEeEorEEEeoREoREEEeoREEEEEoREEoReoreorEEEeEoREEEEEEeorEEEeoReEoREoREEEeoREEoReoroReEeoREoREEEeorEEEEeoReeoREEEeoREeeEoREEEeoREEEEEEEoreoReoReoREoREEEeoREEEEEoreeeeeEeEeoRee


                                                            Try it online!



                                                            Ungolfed



                                                            There might be some golfing oppurtunities with flags which I missed, but I'm done for now:



                                                            # "function" for 'e'
                                                            rEeEEeeEeE rrEE
                                                            re # remove duplicated argument
                                                            reeeEeeeee # print space
                                                            rEEEEe # decrement counter twice
                                                            REe re

                                                            # "function" for 'o'
                                                            rEeEEeEEEE rrEE
                                                            re # remove duplicated argument
                                                            rEEEEE # increment counter
                                                            REe re

                                                            # "function for 'r'
                                                            rEeEEEeeEe rrEE
                                                            re Re # remove duplicated argument & char
                                                            RE REEEe REEEEE # push 1
                                                            re rE rEEEe rEEEEE # replace 1
                                                            reE # goto 1
                                                            REe re

                                                            # Main

                                                            REEe REEEEeEee # read input & reverse
                                                            REEEe REeeE REEEe REEEEEEE # push length-1 & move to r

                                                            rEEEeE rEEEe # dummy loop-var (fucking do-whiles...)
                                                            RE REEEe REEEEE REE # while [label-1]

                                                            # Call the right procedure depending on current character,
                                                            # sets stacks up as follows:
                                                            # R [ .... *currentChar ]
                                                            # r [ (N-1) *count ]
                                                            Re re # pop 1 & loop-counter
                                                            rEEEeE # duplicate counter
                                                            REEEEEEe rEEEe # copy current char to other stack
                                                            ReE # jeq to 'o'-label or 'e'-label

                                                            # Output currentChar count times:
                                                            RE REEEe REE # while [label-0]:
                                                            Re # pop 0
                                                            rReEe # print character
                                                            RE REEEe # push 0
                                                            rEEEEe # decrement counter
                                                            Ree

                                                            REEEe REeeE REEEe REEEEEEE # push length-1 & move to r
                                                            re Re Re # pop 0, counter and 9((((currentChar
                                                            RE REEEe REEEEE # push 1
                                                            reeeeeEeEe # print new-line

                                                            Ree





                                                            share|improve this answer





















                                                            • I am impressed, that looks like an infuriating language to use. But if I use the input "re" it looks like it's dying somehow, my tab stops responding
                                                              – GammaGames
                                                              1 hour ago










                                                            • Invalid, cream lines need a space after as well
                                                              – ASCII-only
                                                              22 mins ago
















                                                            2















                                                            Pepe, 364 bytes



                                                            Unfortunately the online interpreter does not take care of compressing comments, hence all o characters will be replaced by a space.. Neither the spaces nor the o are necessary, so this could be 295 bytes, but I like it more this way:





                                                            rEeEEeeEeEororEEoreoreeeEeeeeeorEEEEeoREeoreorEeEEeEEEEororEEoreorEEEEEoREeoreorEeEEEeeEeororEEoreoReoREoREEEeoREEEEEoreorEorEEEeorEEEEEoreEoREeoreoREEeoREEEEeEeeoREEEeoREeeEoREEEeoREEEEEEEorEEEeEorEEEeoREoREEEeoREEEEEoREEoReoreorEEEeEoREEEEEEeorEEEeoReEoREoREEEeoREEoReoroReEeoREoREEEeorEEEEeoReeoREEEeoREeeEoREEEeoREEEEEEEoreoReoReoREoREEEeoREEEEEoreeeeeEeEeoRee


                                                            Try it online!



                                                            Ungolfed



                                                            There might be some golfing oppurtunities with flags which I missed, but I'm done for now:



                                                            # "function" for 'e'
                                                            rEeEEeeEeE rrEE
                                                            re # remove duplicated argument
                                                            reeeEeeeee # print space
                                                            rEEEEe # decrement counter twice
                                                            REe re

                                                            # "function" for 'o'
                                                            rEeEEeEEEE rrEE
                                                            re # remove duplicated argument
                                                            rEEEEE # increment counter
                                                            REe re

                                                            # "function for 'r'
                                                            rEeEEEeeEe rrEE
                                                            re Re # remove duplicated argument & char
                                                            RE REEEe REEEEE # push 1
                                                            re rE rEEEe rEEEEE # replace 1
                                                            reE # goto 1
                                                            REe re

                                                            # Main

                                                            REEe REEEEeEee # read input & reverse
                                                            REEEe REeeE REEEe REEEEEEE # push length-1 & move to r

                                                            rEEEeE rEEEe # dummy loop-var (fucking do-whiles...)
                                                            RE REEEe REEEEE REE # while [label-1]

                                                            # Call the right procedure depending on current character,
                                                            # sets stacks up as follows:
                                                            # R [ .... *currentChar ]
                                                            # r [ (N-1) *count ]
                                                            Re re # pop 1 & loop-counter
                                                            rEEEeE # duplicate counter
                                                            REEEEEEe rEEEe # copy current char to other stack
                                                            ReE # jeq to 'o'-label or 'e'-label

                                                            # Output currentChar count times:
                                                            RE REEEe REE # while [label-0]:
                                                            Re # pop 0
                                                            rReEe # print character
                                                            RE REEEe # push 0
                                                            rEEEEe # decrement counter
                                                            Ree

                                                            REEEe REeeE REEEe REEEEEEE # push length-1 & move to r
                                                            re Re Re # pop 0, counter and 9((((currentChar
                                                            RE REEEe REEEEE # push 1
                                                            reeeeeEeEe # print new-line

                                                            Ree





                                                            share|improve this answer





















                                                            • I am impressed, that looks like an infuriating language to use. But if I use the input "re" it looks like it's dying somehow, my tab stops responding
                                                              – GammaGames
                                                              1 hour ago










                                                            • Invalid, cream lines need a space after as well
                                                              – ASCII-only
                                                              22 mins ago














                                                            2












                                                            2








                                                            2







                                                            Pepe, 364 bytes



                                                            Unfortunately the online interpreter does not take care of compressing comments, hence all o characters will be replaced by a space.. Neither the spaces nor the o are necessary, so this could be 295 bytes, but I like it more this way:





                                                            rEeEEeeEeEororEEoreoreeeEeeeeeorEEEEeoREeoreorEeEEeEEEEororEEoreorEEEEEoREeoreorEeEEEeeEeororEEoreoReoREoREEEeoREEEEEoreorEorEEEeorEEEEEoreEoREeoreoREEeoREEEEeEeeoREEEeoREeeEoREEEeoREEEEEEEorEEEeEorEEEeoREoREEEeoREEEEEoREEoReoreorEEEeEoREEEEEEeorEEEeoReEoREoREEEeoREEoReoroReEeoREoREEEeorEEEEeoReeoREEEeoREeeEoREEEeoREEEEEEEoreoReoReoREoREEEeoREEEEEoreeeeeEeEeoRee


                                                            Try it online!



                                                            Ungolfed



                                                            There might be some golfing oppurtunities with flags which I missed, but I'm done for now:



                                                            # "function" for 'e'
                                                            rEeEEeeEeE rrEE
                                                            re # remove duplicated argument
                                                            reeeEeeeee # print space
                                                            rEEEEe # decrement counter twice
                                                            REe re

                                                            # "function" for 'o'
                                                            rEeEEeEEEE rrEE
                                                            re # remove duplicated argument
                                                            rEEEEE # increment counter
                                                            REe re

                                                            # "function for 'r'
                                                            rEeEEEeeEe rrEE
                                                            re Re # remove duplicated argument & char
                                                            RE REEEe REEEEE # push 1
                                                            re rE rEEEe rEEEEE # replace 1
                                                            reE # goto 1
                                                            REe re

                                                            # Main

                                                            REEe REEEEeEee # read input & reverse
                                                            REEEe REeeE REEEe REEEEEEE # push length-1 & move to r

                                                            rEEEeE rEEEe # dummy loop-var (fucking do-whiles...)
                                                            RE REEEe REEEEE REE # while [label-1]

                                                            # Call the right procedure depending on current character,
                                                            # sets stacks up as follows:
                                                            # R [ .... *currentChar ]
                                                            # r [ (N-1) *count ]
                                                            Re re # pop 1 & loop-counter
                                                            rEEEeE # duplicate counter
                                                            REEEEEEe rEEEe # copy current char to other stack
                                                            ReE # jeq to 'o'-label or 'e'-label

                                                            # Output currentChar count times:
                                                            RE REEEe REE # while [label-0]:
                                                            Re # pop 0
                                                            rReEe # print character
                                                            RE REEEe # push 0
                                                            rEEEEe # decrement counter
                                                            Ree

                                                            REEEe REeeE REEEe REEEEEEE # push length-1 & move to r
                                                            re Re Re # pop 0, counter and 9((((currentChar
                                                            RE REEEe REEEEE # push 1
                                                            reeeeeEeEe # print new-line

                                                            Ree





                                                            share|improve this answer













                                                            Pepe, 364 bytes



                                                            Unfortunately the online interpreter does not take care of compressing comments, hence all o characters will be replaced by a space.. Neither the spaces nor the o are necessary, so this could be 295 bytes, but I like it more this way:





                                                            rEeEEeeEeEororEEoreoreeeEeeeeeorEEEEeoREeoreorEeEEeEEEEororEEoreorEEEEEoREeoreorEeEEEeeEeororEEoreoReoREoREEEeoREEEEEoreorEorEEEeorEEEEEoreEoREeoreoREEeoREEEEeEeeoREEEeoREeeEoREEEeoREEEEEEEorEEEeEorEEEeoREoREEEeoREEEEEoREEoReoreorEEEeEoREEEEEEeorEEEeoReEoREoREEEeoREEoReoroReEeoREoREEEeorEEEEeoReeoREEEeoREeeEoREEEeoREEEEEEEoreoReoReoREoREEEeoREEEEEoreeeeeEeEeoRee


                                                            Try it online!



                                                            Ungolfed



                                                            There might be some golfing oppurtunities with flags which I missed, but I'm done for now:



                                                            # "function" for 'e'
                                                            rEeEEeeEeE rrEE
                                                            re # remove duplicated argument
                                                            reeeEeeeee # print space
                                                            rEEEEe # decrement counter twice
                                                            REe re

                                                            # "function" for 'o'
                                                            rEeEEeEEEE rrEE
                                                            re # remove duplicated argument
                                                            rEEEEE # increment counter
                                                            REe re

                                                            # "function for 'r'
                                                            rEeEEEeeEe rrEE
                                                            re Re # remove duplicated argument & char
                                                            RE REEEe REEEEE # push 1
                                                            re rE rEEEe rEEEEE # replace 1
                                                            reE # goto 1
                                                            REe re

                                                            # Main

                                                            REEe REEEEeEee # read input & reverse
                                                            REEEe REeeE REEEe REEEEEEE # push length-1 & move to r

                                                            rEEEeE rEEEe # dummy loop-var (fucking do-whiles...)
                                                            RE REEEe REEEEE REE # while [label-1]

                                                            # Call the right procedure depending on current character,
                                                            # sets stacks up as follows:
                                                            # R [ .... *currentChar ]
                                                            # r [ (N-1) *count ]
                                                            Re re # pop 1 & loop-counter
                                                            rEEEeE # duplicate counter
                                                            REEEEEEe rEEEe # copy current char to other stack
                                                            ReE # jeq to 'o'-label or 'e'-label

                                                            # Output currentChar count times:
                                                            RE REEEe REE # while [label-0]:
                                                            Re # pop 0
                                                            rReEe # print character
                                                            RE REEEe # push 0
                                                            rEEEEe # decrement counter
                                                            Ree

                                                            REEEe REeeE REEEe REEEEEEE # push length-1 & move to r
                                                            re Re Re # pop 0, counter and 9((((currentChar
                                                            RE REEEe REEEEE # push 1
                                                            reeeeeEeEe # print new-line

                                                            Ree






                                                            share|improve this answer












                                                            share|improve this answer



                                                            share|improve this answer










                                                            answered 4 hours ago









                                                            BMO

                                                            11.6k22187




                                                            11.6k22187












                                                            • I am impressed, that looks like an infuriating language to use. But if I use the input "re" it looks like it's dying somehow, my tab stops responding
                                                              – GammaGames
                                                              1 hour ago










                                                            • Invalid, cream lines need a space after as well
                                                              – ASCII-only
                                                              22 mins ago


















                                                            • I am impressed, that looks like an infuriating language to use. But if I use the input "re" it looks like it's dying somehow, my tab stops responding
                                                              – GammaGames
                                                              1 hour ago










                                                            • Invalid, cream lines need a space after as well
                                                              – ASCII-only
                                                              22 mins ago
















                                                            I am impressed, that looks like an infuriating language to use. But if I use the input "re" it looks like it's dying somehow, my tab stops responding
                                                            – GammaGames
                                                            1 hour ago




                                                            I am impressed, that looks like an infuriating language to use. But if I use the input "re" it looks like it's dying somehow, my tab stops responding
                                                            – GammaGames
                                                            1 hour ago












                                                            Invalid, cream lines need a space after as well
                                                            – ASCII-only
                                                            22 mins ago




                                                            Invalid, cream lines need a space after as well
                                                            – ASCII-only
                                                            22 mins ago











                                                            1















                                                            Dart, 120 106 bytes



                                                            f(s)=>s.replaceAll('o',''.padRight(s.length,'#')+'n').replaceAll('re',' '.padRight(s.length-1,'-')+'n');


                                                            Try it online!






                                                            share|improve this answer




























                                                              1















                                                              Dart, 120 106 bytes



                                                              f(s)=>s.replaceAll('o',''.padRight(s.length,'#')+'n').replaceAll('re',' '.padRight(s.length-1,'-')+'n');


                                                              Try it online!






                                                              share|improve this answer


























                                                                1












                                                                1








                                                                1







                                                                Dart, 120 106 bytes



                                                                f(s)=>s.replaceAll('o',''.padRight(s.length,'#')+'n').replaceAll('re',' '.padRight(s.length-1,'-')+'n');


                                                                Try it online!






                                                                share|improve this answer















                                                                Dart, 120 106 bytes



                                                                f(s)=>s.replaceAll('o',''.padRight(s.length,'#')+'n').replaceAll('re',' '.padRight(s.length-1,'-')+'n');


                                                                Try it online!







                                                                share|improve this answer














                                                                share|improve this answer



                                                                share|improve this answer








                                                                edited 21 hours ago

























                                                                answered 21 hours ago









                                                                Elcan

                                                                31115




                                                                31115























                                                                    1















                                                                    C (gcc), 135 bytes





                                                                    #define $ putchar
                                                                    O(char*r){for(char*e,*o=r;*r;*++r&&$(10))if(*r-111){for($(32,r++),e=o+1;*++e;)$(42);$(32);}else for(e=o;*e++;)$(35);}


                                                                    Try it online!






                                                                    share|improve this answer























                                                                    • Shave off a few bytes with -D$=putchar
                                                                      – Rogem
                                                                      15 hours ago
















                                                                    1















                                                                    C (gcc), 135 bytes





                                                                    #define $ putchar
                                                                    O(char*r){for(char*e,*o=r;*r;*++r&&$(10))if(*r-111){for($(32,r++),e=o+1;*++e;)$(42);$(32);}else for(e=o;*e++;)$(35);}


                                                                    Try it online!






                                                                    share|improve this answer























                                                                    • Shave off a few bytes with -D$=putchar
                                                                      – Rogem
                                                                      15 hours ago














                                                                    1












                                                                    1








                                                                    1







                                                                    C (gcc), 135 bytes





                                                                    #define $ putchar
                                                                    O(char*r){for(char*e,*o=r;*r;*++r&&$(10))if(*r-111){for($(32,r++),e=o+1;*++e;)$(42);$(32);}else for(e=o;*e++;)$(35);}


                                                                    Try it online!






                                                                    share|improve this answer















                                                                    C (gcc), 135 bytes





                                                                    #define $ putchar
                                                                    O(char*r){for(char*e,*o=r;*r;*++r&&$(10))if(*r-111){for($(32,r++),e=o+1;*++e;)$(42);$(32);}else for(e=o;*e++;)$(35);}


                                                                    Try it online!







                                                                    share|improve this answer














                                                                    share|improve this answer



                                                                    share|improve this answer








                                                                    edited 20 hours ago

























                                                                    answered yesterday









                                                                    Jonathan Frech

                                                                    6,19311040




                                                                    6,19311040












                                                                    • Shave off a few bytes with -D$=putchar
                                                                      – Rogem
                                                                      15 hours ago


















                                                                    • Shave off a few bytes with -D$=putchar
                                                                      – Rogem
                                                                      15 hours ago
















                                                                    Shave off a few bytes with -D$=putchar
                                                                    – Rogem
                                                                    15 hours ago




                                                                    Shave off a few bytes with -D$=putchar
                                                                    – Rogem
                                                                    15 hours ago











                                                                    1















                                                                    Python 2, 77 76 72 bytes





                                                                    lambda i:'n'.join((x*len(i),' '+x*(len(i)-2))[x>'o']for x in i if'e'<x)


                                                                    Try it online!



                                                                    The outer part of the cookie is 'o' and the filling is 'r'.






                                                                    share|improve this answer




























                                                                      1















                                                                      Python 2, 77 76 72 bytes





                                                                      lambda i:'n'.join((x*len(i),' '+x*(len(i)-2))[x>'o']for x in i if'e'<x)


                                                                      Try it online!



                                                                      The outer part of the cookie is 'o' and the filling is 'r'.






                                                                      share|improve this answer


























                                                                        1












                                                                        1








                                                                        1







                                                                        Python 2, 77 76 72 bytes





                                                                        lambda i:'n'.join((x*len(i),' '+x*(len(i)-2))[x>'o']for x in i if'e'<x)


                                                                        Try it online!



                                                                        The outer part of the cookie is 'o' and the filling is 'r'.






                                                                        share|improve this answer















                                                                        Python 2, 77 76 72 bytes





                                                                        lambda i:'n'.join((x*len(i),' '+x*(len(i)-2))[x>'o']for x in i if'e'<x)


                                                                        Try it online!



                                                                        The outer part of the cookie is 'o' and the filling is 'r'.







                                                                        share|improve this answer














                                                                        share|improve this answer



                                                                        share|improve this answer








                                                                        edited 18 hours ago

























                                                                        answered 19 hours ago









                                                                        ElPedro

                                                                        3,4731023




                                                                        3,4731023























                                                                            1














                                                                            JavaScript, 72 65 bytes



                                                                            s=>s.replace(/o|re/g,([x,y])=>(y?`
                                                                            `:`
                                                                            `).padEnd(s.length+!y,x))


                                                                            Try it online






                                                                            share|improve this answer




























                                                                              1














                                                                              JavaScript, 72 65 bytes



                                                                              s=>s.replace(/o|re/g,([x,y])=>(y?`
                                                                              `:`
                                                                              `).padEnd(s.length+!y,x))


                                                                              Try it online






                                                                              share|improve this answer


























                                                                                1












                                                                                1








                                                                                1






                                                                                JavaScript, 72 65 bytes



                                                                                s=>s.replace(/o|re/g,([x,y])=>(y?`
                                                                                `:`
                                                                                `).padEnd(s.length+!y,x))


                                                                                Try it online






                                                                                share|improve this answer














                                                                                JavaScript, 72 65 bytes



                                                                                s=>s.replace(/o|re/g,([x,y])=>(y?`
                                                                                `:`
                                                                                `).padEnd(s.length+!y,x))


                                                                                Try it online







                                                                                share|improve this answer














                                                                                share|improve this answer



                                                                                share|improve this answer








                                                                                edited 18 hours ago

























                                                                                answered 18 hours ago









                                                                                Shaggy

                                                                                19k21666




                                                                                19k21666























                                                                                    1














                                                                                    Java 11, 110 bytes





                                                                                    s->{int l=s.length();return s.replace("re"," "+"~".repeat(l-(l<2?1:2))+"n").replace("o","=".repeat(l)+"n");}


                                                                                    Uses = for the cookie and ~ for the filling.



                                                                                    Try it online.



                                                                                    Explanation:



                                                                                    s->{                       // Method with String as both parameter and return-type
                                                                                    int l=s.length(); // Get the length of the input
                                                                                    return s // Return the input
                                                                                    .replace("re", // After we've replaced all "re" with:
                                                                                    " " // A space
                                                                                    +"~".repeat(l-(l<2?1:2))
                                                                                    // Appended with length-2 amount of "~"
                                                                                    // (or length-1 if the input-length was 1)
                                                                                    +"n") // Appended with a newline
                                                                                    .replace("o", // And we've also replaced all "o" with:
                                                                                    "=".repeat(l) // Length amount of "="
                                                                                    +"n");} // Appended with a newline




                                                                                    The above solution uses a replace. The following maps over the characters of the input instead:



                                                                                    Java 11, 113 112 bytes



                                                                                    s->s.chars().forEach(c->{if(c>101)System.out.println((c>111?" ":"")+(""+(char)c).repeat(s.length()-2*(~c&1)));})


                                                                                    -1 byte thanks to @Neil.



                                                                                    Try it online.



                                                                                    Explanation:



                                                                                    s->                           // Method with String parameter and no return-type
                                                                                    s.chars().forEach(c->{ // Loop over the characters as codepoint-integers
                                                                                    if(c>101) // If it's not an 'e':
                                                                                    System.out.println( // Print with trailing newline:
                                                                                    (c>111? // If it's an 'r'
                                                                                    " " // Start with a space
                                                                                    : // Else (it's an 'o' instead)
                                                                                    "") // Start with an empty string
                                                                                    +(""+(char)c).repeat( // And append the character itself
                                                                                    .repeat( // Repeated the following amount of times:
                                                                                    s.length() // The input-length
                                                                                    -2*(~c&1)));}) // Minus 2 if it's an "r", or 0 if it's an "o"





                                                                                    share|improve this answer



















                                                                                    • 1




                                                                                      Can you use ~c&1?
                                                                                      – Neil
                                                                                      17 hours ago










                                                                                    • @Neil I indeed can, thanks.
                                                                                      – Kevin Cruijssen
                                                                                      17 hours ago
















                                                                                    1














                                                                                    Java 11, 110 bytes





                                                                                    s->{int l=s.length();return s.replace("re"," "+"~".repeat(l-(l<2?1:2))+"n").replace("o","=".repeat(l)+"n");}


                                                                                    Uses = for the cookie and ~ for the filling.



                                                                                    Try it online.



                                                                                    Explanation:



                                                                                    s->{                       // Method with String as both parameter and return-type
                                                                                    int l=s.length(); // Get the length of the input
                                                                                    return s // Return the input
                                                                                    .replace("re", // After we've replaced all "re" with:
                                                                                    " " // A space
                                                                                    +"~".repeat(l-(l<2?1:2))
                                                                                    // Appended with length-2 amount of "~"
                                                                                    // (or length-1 if the input-length was 1)
                                                                                    +"n") // Appended with a newline
                                                                                    .replace("o", // And we've also replaced all "o" with:
                                                                                    "=".repeat(l) // Length amount of "="
                                                                                    +"n");} // Appended with a newline




                                                                                    The above solution uses a replace. The following maps over the characters of the input instead:



                                                                                    Java 11, 113 112 bytes



                                                                                    s->s.chars().forEach(c->{if(c>101)System.out.println((c>111?" ":"")+(""+(char)c).repeat(s.length()-2*(~c&1)));})


                                                                                    -1 byte thanks to @Neil.



                                                                                    Try it online.



                                                                                    Explanation:



                                                                                    s->                           // Method with String parameter and no return-type
                                                                                    s.chars().forEach(c->{ // Loop over the characters as codepoint-integers
                                                                                    if(c>101) // If it's not an 'e':
                                                                                    System.out.println( // Print with trailing newline:
                                                                                    (c>111? // If it's an 'r'
                                                                                    " " // Start with a space
                                                                                    : // Else (it's an 'o' instead)
                                                                                    "") // Start with an empty string
                                                                                    +(""+(char)c).repeat( // And append the character itself
                                                                                    .repeat( // Repeated the following amount of times:
                                                                                    s.length() // The input-length
                                                                                    -2*(~c&1)));}) // Minus 2 if it's an "r", or 0 if it's an "o"





                                                                                    share|improve this answer



















                                                                                    • 1




                                                                                      Can you use ~c&1?
                                                                                      – Neil
                                                                                      17 hours ago










                                                                                    • @Neil I indeed can, thanks.
                                                                                      – Kevin Cruijssen
                                                                                      17 hours ago














                                                                                    1












                                                                                    1








                                                                                    1






                                                                                    Java 11, 110 bytes





                                                                                    s->{int l=s.length();return s.replace("re"," "+"~".repeat(l-(l<2?1:2))+"n").replace("o","=".repeat(l)+"n");}


                                                                                    Uses = for the cookie and ~ for the filling.



                                                                                    Try it online.



                                                                                    Explanation:



                                                                                    s->{                       // Method with String as both parameter and return-type
                                                                                    int l=s.length(); // Get the length of the input
                                                                                    return s // Return the input
                                                                                    .replace("re", // After we've replaced all "re" with:
                                                                                    " " // A space
                                                                                    +"~".repeat(l-(l<2?1:2))
                                                                                    // Appended with length-2 amount of "~"
                                                                                    // (or length-1 if the input-length was 1)
                                                                                    +"n") // Appended with a newline
                                                                                    .replace("o", // And we've also replaced all "o" with:
                                                                                    "=".repeat(l) // Length amount of "="
                                                                                    +"n");} // Appended with a newline




                                                                                    The above solution uses a replace. The following maps over the characters of the input instead:



                                                                                    Java 11, 113 112 bytes



                                                                                    s->s.chars().forEach(c->{if(c>101)System.out.println((c>111?" ":"")+(""+(char)c).repeat(s.length()-2*(~c&1)));})


                                                                                    -1 byte thanks to @Neil.



                                                                                    Try it online.



                                                                                    Explanation:



                                                                                    s->                           // Method with String parameter and no return-type
                                                                                    s.chars().forEach(c->{ // Loop over the characters as codepoint-integers
                                                                                    if(c>101) // If it's not an 'e':
                                                                                    System.out.println( // Print with trailing newline:
                                                                                    (c>111? // If it's an 'r'
                                                                                    " " // Start with a space
                                                                                    : // Else (it's an 'o' instead)
                                                                                    "") // Start with an empty string
                                                                                    +(""+(char)c).repeat( // And append the character itself
                                                                                    .repeat( // Repeated the following amount of times:
                                                                                    s.length() // The input-length
                                                                                    -2*(~c&1)));}) // Minus 2 if it's an "r", or 0 if it's an "o"





                                                                                    share|improve this answer














                                                                                    Java 11, 110 bytes





                                                                                    s->{int l=s.length();return s.replace("re"," "+"~".repeat(l-(l<2?1:2))+"n").replace("o","=".repeat(l)+"n");}


                                                                                    Uses = for the cookie and ~ for the filling.



                                                                                    Try it online.



                                                                                    Explanation:



                                                                                    s->{                       // Method with String as both parameter and return-type
                                                                                    int l=s.length(); // Get the length of the input
                                                                                    return s // Return the input
                                                                                    .replace("re", // After we've replaced all "re" with:
                                                                                    " " // A space
                                                                                    +"~".repeat(l-(l<2?1:2))
                                                                                    // Appended with length-2 amount of "~"
                                                                                    // (or length-1 if the input-length was 1)
                                                                                    +"n") // Appended with a newline
                                                                                    .replace("o", // And we've also replaced all "o" with:
                                                                                    "=".repeat(l) // Length amount of "="
                                                                                    +"n");} // Appended with a newline




                                                                                    The above solution uses a replace. The following maps over the characters of the input instead:



                                                                                    Java 11, 113 112 bytes



                                                                                    s->s.chars().forEach(c->{if(c>101)System.out.println((c>111?" ":"")+(""+(char)c).repeat(s.length()-2*(~c&1)));})


                                                                                    -1 byte thanks to @Neil.



                                                                                    Try it online.



                                                                                    Explanation:



                                                                                    s->                           // Method with String parameter and no return-type
                                                                                    s.chars().forEach(c->{ // Loop over the characters as codepoint-integers
                                                                                    if(c>101) // If it's not an 'e':
                                                                                    System.out.println( // Print with trailing newline:
                                                                                    (c>111? // If it's an 'r'
                                                                                    " " // Start with a space
                                                                                    : // Else (it's an 'o' instead)
                                                                                    "") // Start with an empty string
                                                                                    +(""+(char)c).repeat( // And append the character itself
                                                                                    .repeat( // Repeated the following amount of times:
                                                                                    s.length() // The input-length
                                                                                    -2*(~c&1)));}) // Minus 2 if it's an "r", or 0 if it's an "o"






                                                                                    share|improve this answer














                                                                                    share|improve this answer



                                                                                    share|improve this answer








                                                                                    edited 17 hours ago

























                                                                                    answered 19 hours ago









                                                                                    Kevin Cruijssen

                                                                                    35.9k554188




                                                                                    35.9k554188








                                                                                    • 1




                                                                                      Can you use ~c&1?
                                                                                      – Neil
                                                                                      17 hours ago










                                                                                    • @Neil I indeed can, thanks.
                                                                                      – Kevin Cruijssen
                                                                                      17 hours ago














                                                                                    • 1




                                                                                      Can you use ~c&1?
                                                                                      – Neil
                                                                                      17 hours ago










                                                                                    • @Neil I indeed can, thanks.
                                                                                      – Kevin Cruijssen
                                                                                      17 hours ago








                                                                                    1




                                                                                    1




                                                                                    Can you use ~c&1?
                                                                                    – Neil
                                                                                    17 hours ago




                                                                                    Can you use ~c&1?
                                                                                    – Neil
                                                                                    17 hours ago












                                                                                    @Neil I indeed can, thanks.
                                                                                    – Kevin Cruijssen
                                                                                    17 hours ago




                                                                                    @Neil I indeed can, thanks.
                                                                                    – Kevin Cruijssen
                                                                                    17 hours ago











                                                                                    1















                                                                                    Pyth, 33 bytes



                                                                                    ::z"o"+*lz"="b"re"+.[lz*-lz2"░"db
                                                                                    :z"o" With the input, replace "o" with
                                                                                    *lz"=" "=" times the length of the input
                                                                                    + b and a newline added to the end
                                                                                    : "re" With the input, replace "re" with
                                                                                    * "~" "~" times
                                                                                    -lz2 the length of the input minus 2
                                                                                    .[ d padded on both sides with " " to
                                                                                    lz the size of the input string
                                                                                    + b and a newline added to the end


                                                                                    Try it here!



                                                                                    I really like python (it's what I wrote my original test scripts in), so I thought I'd do a pyth entry for fun :)



                                                                                    Edit: Here's a for loop, as well (35 bytes):



                                                                                    FNzIqN"o"*lzN)IqN"r".[lz*-lz2Nd
                                                                                    FNz For each value, N, in input
                                                                                    IqN"o" if the character is "o"
                                                                                    *lzN return the character times the length of the input
                                                                                    ) end if
                                                                                    IqN"r" if the character is "r"
                                                                                    *-lz2N return the character times length - 2
                                                                                    .[lz d padded on both sides with " " to the input string





                                                                                    share|improve this answer



















                                                                                    • 1




                                                                                      Isn't this 37 bytes? I thought Pyth uses default ASCII as its codepage just like Python, if I remember correctly. So even though your code is 33 characters, both and are three bytes each. Or am I missing something here?
                                                                                      – Kevin Cruijssen
                                                                                      22 hours ago










                                                                                    • Good call, I didn't realize that (I couldn't get pyth to work on tio.run, so I used the length counter on the herokuapp page). In the for loop I could just replace the character with N, even saving a few bytes!
                                                                                      – GammaGames
                                                                                      14 hours ago










                                                                                    • Thought something like that happened. :) I once had the same issue with a 05AB1E answer of mine that was using characters outside its code page. Unfortunately TIO displays chars and bytes the same for most golfing languages. For Java or Python TIO will correctly state 33 chars, 37 bytes, but not in golfing languages on TIO. But in your solutions just changing those characters indeed fixes the issue, so it's not that big of a deal here.
                                                                                      – Kevin Cruijssen
                                                                                      14 hours ago


















                                                                                    1















                                                                                    Pyth, 33 bytes



                                                                                    ::z"o"+*lz"="b"re"+.[lz*-lz2"░"db
                                                                                    :z"o" With the input, replace "o" with
                                                                                    *lz"=" "=" times the length of the input
                                                                                    + b and a newline added to the end
                                                                                    : "re" With the input, replace "re" with
                                                                                    * "~" "~" times
                                                                                    -lz2 the length of the input minus 2
                                                                                    .[ d padded on both sides with " " to
                                                                                    lz the size of the input string
                                                                                    + b and a newline added to the end


                                                                                    Try it here!



                                                                                    I really like python (it's what I wrote my original test scripts in), so I thought I'd do a pyth entry for fun :)



                                                                                    Edit: Here's a for loop, as well (35 bytes):



                                                                                    FNzIqN"o"*lzN)IqN"r".[lz*-lz2Nd
                                                                                    FNz For each value, N, in input
                                                                                    IqN"o" if the character is "o"
                                                                                    *lzN return the character times the length of the input
                                                                                    ) end if
                                                                                    IqN"r" if the character is "r"
                                                                                    *-lz2N return the character times length - 2
                                                                                    .[lz d padded on both sides with " " to the input string





                                                                                    share|improve this answer



















                                                                                    • 1




                                                                                      Isn't this 37 bytes? I thought Pyth uses default ASCII as its codepage just like Python, if I remember correctly. So even though your code is 33 characters, both and are three bytes each. Or am I missing something here?
                                                                                      – Kevin Cruijssen
                                                                                      22 hours ago










                                                                                    • Good call, I didn't realize that (I couldn't get pyth to work on tio.run, so I used the length counter on the herokuapp page). In the for loop I could just replace the character with N, even saving a few bytes!
                                                                                      – GammaGames
                                                                                      14 hours ago










                                                                                    • Thought something like that happened. :) I once had the same issue with a 05AB1E answer of mine that was using characters outside its code page. Unfortunately TIO displays chars and bytes the same for most golfing languages. For Java or Python TIO will correctly state 33 chars, 37 bytes, but not in golfing languages on TIO. But in your solutions just changing those characters indeed fixes the issue, so it's not that big of a deal here.
                                                                                      – Kevin Cruijssen
                                                                                      14 hours ago
















                                                                                    1












                                                                                    1








                                                                                    1







                                                                                    Pyth, 33 bytes



                                                                                    ::z"o"+*lz"="b"re"+.[lz*-lz2"░"db
                                                                                    :z"o" With the input, replace "o" with
                                                                                    *lz"=" "=" times the length of the input
                                                                                    + b and a newline added to the end
                                                                                    : "re" With the input, replace "re" with
                                                                                    * "~" "~" times
                                                                                    -lz2 the length of the input minus 2
                                                                                    .[ d padded on both sides with " " to
                                                                                    lz the size of the input string
                                                                                    + b and a newline added to the end


                                                                                    Try it here!



                                                                                    I really like python (it's what I wrote my original test scripts in), so I thought I'd do a pyth entry for fun :)



                                                                                    Edit: Here's a for loop, as well (35 bytes):



                                                                                    FNzIqN"o"*lzN)IqN"r".[lz*-lz2Nd
                                                                                    FNz For each value, N, in input
                                                                                    IqN"o" if the character is "o"
                                                                                    *lzN return the character times the length of the input
                                                                                    ) end if
                                                                                    IqN"r" if the character is "r"
                                                                                    *-lz2N return the character times length - 2
                                                                                    .[lz d padded on both sides with " " to the input string





                                                                                    share|improve this answer















                                                                                    Pyth, 33 bytes



                                                                                    ::z"o"+*lz"="b"re"+.[lz*-lz2"░"db
                                                                                    :z"o" With the input, replace "o" with
                                                                                    *lz"=" "=" times the length of the input
                                                                                    + b and a newline added to the end
                                                                                    : "re" With the input, replace "re" with
                                                                                    * "~" "~" times
                                                                                    -lz2 the length of the input minus 2
                                                                                    .[ d padded on both sides with " " to
                                                                                    lz the size of the input string
                                                                                    + b and a newline added to the end


                                                                                    Try it here!



                                                                                    I really like python (it's what I wrote my original test scripts in), so I thought I'd do a pyth entry for fun :)



                                                                                    Edit: Here's a for loop, as well (35 bytes):



                                                                                    FNzIqN"o"*lzN)IqN"r".[lz*-lz2Nd
                                                                                    FNz For each value, N, in input
                                                                                    IqN"o" if the character is "o"
                                                                                    *lzN return the character times the length of the input
                                                                                    ) end if
                                                                                    IqN"r" if the character is "r"
                                                                                    *-lz2N return the character times length - 2
                                                                                    .[lz d padded on both sides with " " to the input string






                                                                                    share|improve this answer














                                                                                    share|improve this answer



                                                                                    share|improve this answer








                                                                                    edited 14 hours ago

























                                                                                    answered 23 hours ago









                                                                                    GammaGames

                                                                                    465211




                                                                                    465211








                                                                                    • 1




                                                                                      Isn't this 37 bytes? I thought Pyth uses default ASCII as its codepage just like Python, if I remember correctly. So even though your code is 33 characters, both and are three bytes each. Or am I missing something here?
                                                                                      – Kevin Cruijssen
                                                                                      22 hours ago










                                                                                    • Good call, I didn't realize that (I couldn't get pyth to work on tio.run, so I used the length counter on the herokuapp page). In the for loop I could just replace the character with N, even saving a few bytes!
                                                                                      – GammaGames
                                                                                      14 hours ago










                                                                                    • Thought something like that happened. :) I once had the same issue with a 05AB1E answer of mine that was using characters outside its code page. Unfortunately TIO displays chars and bytes the same for most golfing languages. For Java or Python TIO will correctly state 33 chars, 37 bytes, but not in golfing languages on TIO. But in your solutions just changing those characters indeed fixes the issue, so it's not that big of a deal here.
                                                                                      – Kevin Cruijssen
                                                                                      14 hours ago
















                                                                                    • 1




                                                                                      Isn't this 37 bytes? I thought Pyth uses default ASCII as its codepage just like Python, if I remember correctly. So even though your code is 33 characters, both and are three bytes each. Or am I missing something here?
                                                                                      – Kevin Cruijssen
                                                                                      22 hours ago










                                                                                    • Good call, I didn't realize that (I couldn't get pyth to work on tio.run, so I used the length counter on the herokuapp page). In the for loop I could just replace the character with N, even saving a few bytes!
                                                                                      – GammaGames
                                                                                      14 hours ago










                                                                                    • Thought something like that happened. :) I once had the same issue with a 05AB1E answer of mine that was using characters outside its code page. Unfortunately TIO displays chars and bytes the same for most golfing languages. For Java or Python TIO will correctly state 33 chars, 37 bytes, but not in golfing languages on TIO. But in your solutions just changing those characters indeed fixes the issue, so it's not that big of a deal here.
                                                                                      – Kevin Cruijssen
                                                                                      14 hours ago










                                                                                    1




                                                                                    1




                                                                                    Isn't this 37 bytes? I thought Pyth uses default ASCII as its codepage just like Python, if I remember correctly. So even though your code is 33 characters, both and are three bytes each. Or am I missing something here?
                                                                                    – Kevin Cruijssen
                                                                                    22 hours ago




                                                                                    Isn't this 37 bytes? I thought Pyth uses default ASCII as its codepage just like Python, if I remember correctly. So even though your code is 33 characters, both and are three bytes each. Or am I missing something here?
                                                                                    – Kevin Cruijssen
                                                                                    22 hours ago












                                                                                    Good call, I didn't realize that (I couldn't get pyth to work on tio.run, so I used the length counter on the herokuapp page). In the for loop I could just replace the character with N, even saving a few bytes!
                                                                                    – GammaGames
                                                                                    14 hours ago




                                                                                    Good call, I didn't realize that (I couldn't get pyth to work on tio.run, so I used the length counter on the herokuapp page). In the for loop I could just replace the character with N, even saving a few bytes!
                                                                                    – GammaGames
                                                                                    14 hours ago












                                                                                    Thought something like that happened. :) I once had the same issue with a 05AB1E answer of mine that was using characters outside its code page. Unfortunately TIO displays chars and bytes the same for most golfing languages. For Java or Python TIO will correctly state 33 chars, 37 bytes, but not in golfing languages on TIO. But in your solutions just changing those characters indeed fixes the issue, so it's not that big of a deal here.
                                                                                    – Kevin Cruijssen
                                                                                    14 hours ago






                                                                                    Thought something like that happened. :) I once had the same issue with a 05AB1E answer of mine that was using characters outside its code page. Unfortunately TIO displays chars and bytes the same for most golfing languages. For Java or Python TIO will correctly state 33 chars, 37 bytes, but not in golfing languages on TIO. But in your solutions just changing those characters indeed fixes the issue, so it's not that big of a deal here.
                                                                                    – Kevin Cruijssen
                                                                                    14 hours ago













                                                                                    1















                                                                                    C# (.NET Core), 143 bytes



                                                                                    Without LINQ.





                                                                                    p=>{var q="";foreach(char c in p){if(c!='e'){for(var j=0;j<p.Length;j++)q+=(j<1|j>p.Length-2)&c>'q'?" ":c<'p'?"█":"░";q+="n";}}return q;};


                                                                                    Try it online!






                                                                                    share|improve this answer


























                                                                                      1















                                                                                      C# (.NET Core), 143 bytes



                                                                                      Without LINQ.





                                                                                      p=>{var q="";foreach(char c in p){if(c!='e'){for(var j=0;j<p.Length;j++)q+=(j<1|j>p.Length-2)&c>'q'?" ":c<'p'?"█":"░";q+="n";}}return q;};


                                                                                      Try it online!






                                                                                      share|improve this answer
























                                                                                        1












                                                                                        1








                                                                                        1







                                                                                        C# (.NET Core), 143 bytes



                                                                                        Without LINQ.





                                                                                        p=>{var q="";foreach(char c in p){if(c!='e'){for(var j=0;j<p.Length;j++)q+=(j<1|j>p.Length-2)&c>'q'?" ":c<'p'?"█":"░";q+="n";}}return q;};


                                                                                        Try it online!






                                                                                        share|improve this answer













                                                                                        C# (.NET Core), 143 bytes



                                                                                        Without LINQ.





                                                                                        p=>{var q="";foreach(char c in p){if(c!='e'){for(var j=0;j<p.Length;j++)q+=(j<1|j>p.Length-2)&c>'q'?" ":c<'p'?"█":"░";q+="n";}}return q;};


                                                                                        Try it online!







                                                                                        share|improve this answer












                                                                                        share|improve this answer



                                                                                        share|improve this answer










                                                                                        answered 12 hours ago









                                                                                        Destroigo

                                                                                        813




                                                                                        813























                                                                                            0















                                                                                            Perl 5 -p, 47 bytes





                                                                                            s|o|X x($i=y///c).$/|ge;s|re|$".O x($i-2).$/|ge


                                                                                            Try it online!






                                                                                            share|improve this answer


























                                                                                              0















                                                                                              Perl 5 -p, 47 bytes





                                                                                              s|o|X x($i=y///c).$/|ge;s|re|$".O x($i-2).$/|ge


                                                                                              Try it online!






                                                                                              share|improve this answer
























                                                                                                0












                                                                                                0








                                                                                                0







                                                                                                Perl 5 -p, 47 bytes





                                                                                                s|o|X x($i=y///c).$/|ge;s|re|$".O x($i-2).$/|ge


                                                                                                Try it online!






                                                                                                share|improve this answer













                                                                                                Perl 5 -p, 47 bytes





                                                                                                s|o|X x($i=y///c).$/|ge;s|re|$".O x($i-2).$/|ge


                                                                                                Try it online!







                                                                                                share|improve this answer












                                                                                                share|improve this answer



                                                                                                share|improve this answer










                                                                                                answered 13 hours ago









                                                                                                Xcali

                                                                                                5,188520




                                                                                                5,188520























                                                                                                    0















                                                                                                    SNOBOL4 (CSNOBOL4), 136 bytes



                                                                                                    	S =INPUT
                                                                                                    N =SIZE(S)
                                                                                                    S S ('o' | 're') . X REM . S :F(END)
                                                                                                    OUTPUT =IDENT('o',X) DUPL(X,N) :S(S)
                                                                                                    OUTPUT =' ' DUPL(0,N - 2) ' ' :(S)
                                                                                                    END


                                                                                                    Try it online!






                                                                                                    share|improve this answer


























                                                                                                      0















                                                                                                      SNOBOL4 (CSNOBOL4), 136 bytes



                                                                                                      	S =INPUT
                                                                                                      N =SIZE(S)
                                                                                                      S S ('o' | 're') . X REM . S :F(END)
                                                                                                      OUTPUT =IDENT('o',X) DUPL(X,N) :S(S)
                                                                                                      OUTPUT =' ' DUPL(0,N - 2) ' ' :(S)
                                                                                                      END


                                                                                                      Try it online!






                                                                                                      share|improve this answer
























                                                                                                        0












                                                                                                        0








                                                                                                        0







                                                                                                        SNOBOL4 (CSNOBOL4), 136 bytes



                                                                                                        	S =INPUT
                                                                                                        N =SIZE(S)
                                                                                                        S S ('o' | 're') . X REM . S :F(END)
                                                                                                        OUTPUT =IDENT('o',X) DUPL(X,N) :S(S)
                                                                                                        OUTPUT =' ' DUPL(0,N - 2) ' ' :(S)
                                                                                                        END


                                                                                                        Try it online!






                                                                                                        share|improve this answer













                                                                                                        SNOBOL4 (CSNOBOL4), 136 bytes



                                                                                                        	S =INPUT
                                                                                                        N =SIZE(S)
                                                                                                        S S ('o' | 're') . X REM . S :F(END)
                                                                                                        OUTPUT =IDENT('o',X) DUPL(X,N) :S(S)
                                                                                                        OUTPUT =' ' DUPL(0,N - 2) ' ' :(S)
                                                                                                        END


                                                                                                        Try it online!







                                                                                                        share|improve this answer












                                                                                                        share|improve this answer



                                                                                                        share|improve this answer










                                                                                                        answered 6 hours ago









                                                                                                        Giuseppe

                                                                                                        16.6k31052




                                                                                                        16.6k31052























                                                                                                            0















                                                                                                            PHP, 99 bytes





                                                                                                            $l=strlen($i=$argv[1]);$r=str_repeat;echo strtr($i,[o=>$r('#',$l)."n",re=>' '.$r('=',$l-2)."n"]);


                                                                                                            Try it online!



                                                                                                            OUCH. PHP's waaaay_too_long function names strike again!



                                                                                                            Output:



                                                                                                            $php oreo.php oreo
                                                                                                            ####
                                                                                                            ==
                                                                                                            ####

                                                                                                            $php oreo.php o
                                                                                                            #

                                                                                                            $php oreo.php rere
                                                                                                            ==
                                                                                                            ==

                                                                                                            $ php oreo.php oreoorererereoo
                                                                                                            ###############
                                                                                                            =============
                                                                                                            ###############
                                                                                                            ###############
                                                                                                            =============
                                                                                                            =============
                                                                                                            =============
                                                                                                            =============
                                                                                                            ###############
                                                                                                            ###############





                                                                                                            share|improve this answer





















                                                                                                            • Invalid, cream lines need a trailing space
                                                                                                              – ASCII-only
                                                                                                              23 mins ago
















                                                                                                            0















                                                                                                            PHP, 99 bytes





                                                                                                            $l=strlen($i=$argv[1]);$r=str_repeat;echo strtr($i,[o=>$r('#',$l)."n",re=>' '.$r('=',$l-2)."n"]);


                                                                                                            Try it online!



                                                                                                            OUCH. PHP's waaaay_too_long function names strike again!



                                                                                                            Output:



                                                                                                            $php oreo.php oreo
                                                                                                            ####
                                                                                                            ==
                                                                                                            ####

                                                                                                            $php oreo.php o
                                                                                                            #

                                                                                                            $php oreo.php rere
                                                                                                            ==
                                                                                                            ==

                                                                                                            $ php oreo.php oreoorererereoo
                                                                                                            ###############
                                                                                                            =============
                                                                                                            ###############
                                                                                                            ###############
                                                                                                            =============
                                                                                                            =============
                                                                                                            =============
                                                                                                            =============
                                                                                                            ###############
                                                                                                            ###############





                                                                                                            share|improve this answer





















                                                                                                            • Invalid, cream lines need a trailing space
                                                                                                              – ASCII-only
                                                                                                              23 mins ago














                                                                                                            0












                                                                                                            0








                                                                                                            0







                                                                                                            PHP, 99 bytes





                                                                                                            $l=strlen($i=$argv[1]);$r=str_repeat;echo strtr($i,[o=>$r('#',$l)."n",re=>' '.$r('=',$l-2)."n"]);


                                                                                                            Try it online!



                                                                                                            OUCH. PHP's waaaay_too_long function names strike again!



                                                                                                            Output:



                                                                                                            $php oreo.php oreo
                                                                                                            ####
                                                                                                            ==
                                                                                                            ####

                                                                                                            $php oreo.php o
                                                                                                            #

                                                                                                            $php oreo.php rere
                                                                                                            ==
                                                                                                            ==

                                                                                                            $ php oreo.php oreoorererereoo
                                                                                                            ###############
                                                                                                            =============
                                                                                                            ###############
                                                                                                            ###############
                                                                                                            =============
                                                                                                            =============
                                                                                                            =============
                                                                                                            =============
                                                                                                            ###############
                                                                                                            ###############





                                                                                                            share|improve this answer













                                                                                                            PHP, 99 bytes





                                                                                                            $l=strlen($i=$argv[1]);$r=str_repeat;echo strtr($i,[o=>$r('#',$l)."n",re=>' '.$r('=',$l-2)."n"]);


                                                                                                            Try it online!



                                                                                                            OUCH. PHP's waaaay_too_long function names strike again!



                                                                                                            Output:



                                                                                                            $php oreo.php oreo
                                                                                                            ####
                                                                                                            ==
                                                                                                            ####

                                                                                                            $php oreo.php o
                                                                                                            #

                                                                                                            $php oreo.php rere
                                                                                                            ==
                                                                                                            ==

                                                                                                            $ php oreo.php oreoorererereoo
                                                                                                            ###############
                                                                                                            =============
                                                                                                            ###############
                                                                                                            ###############
                                                                                                            =============
                                                                                                            =============
                                                                                                            =============
                                                                                                            =============
                                                                                                            ###############
                                                                                                            ###############






                                                                                                            share|improve this answer












                                                                                                            share|improve this answer



                                                                                                            share|improve this answer










                                                                                                            answered 5 hours ago









                                                                                                            gwaugh

                                                                                                            513




                                                                                                            513












                                                                                                            • Invalid, cream lines need a trailing space
                                                                                                              – ASCII-only
                                                                                                              23 mins ago


















                                                                                                            • Invalid, cream lines need a trailing space
                                                                                                              – ASCII-only
                                                                                                              23 mins ago
















                                                                                                            Invalid, cream lines need a trailing space
                                                                                                            – ASCII-only
                                                                                                            23 mins ago




                                                                                                            Invalid, cream lines need a trailing space
                                                                                                            – ASCII-only
                                                                                                            23 mins ago











                                                                                                            0














                                                                                                            Batch, 133 bytes



                                                                                                            @set/ps=
                                                                                                            @set o=%s:r=o%
                                                                                                            @set o=%o:e=o%
                                                                                                            @set r=%o:o=-%
                                                                                                            @set r= %r:~2%
                                                                                                            @set s=%s:e= %
                                                                                                            @for %%c in (%s:o=o %)do @call echo %%%%c%%


                                                                                                            Takes input on STDIN. Explanation:



                                                                                                            @set/ps=


                                                                                                            Input the string.



                                                                                                            @set o=%s:r=o%
                                                                                                            @set o=%o:e=o%


                                                                                                            Make a copy of the string with all of the rs and es replaced with os.



                                                                                                            @set r=%o:o=-%
                                                                                                            @set r= %r:~2%


                                                                                                            Make a copy of the string of os, change them to -s and replace the first two with a space.



                                                                                                            @set s=%s:e= %
                                                                                                            @for %%c in (%s:o=o %)do @call echo %%%%c%%


                                                                                                            Change the es into spaces and also add a space after each o, allowing the os and rs to be iterated over, printing the appropriate string each time.






                                                                                                            share|improve this answer


























                                                                                                              0














                                                                                                              Batch, 133 bytes



                                                                                                              @set/ps=
                                                                                                              @set o=%s:r=o%
                                                                                                              @set o=%o:e=o%
                                                                                                              @set r=%o:o=-%
                                                                                                              @set r= %r:~2%
                                                                                                              @set s=%s:e= %
                                                                                                              @for %%c in (%s:o=o %)do @call echo %%%%c%%


                                                                                                              Takes input on STDIN. Explanation:



                                                                                                              @set/ps=


                                                                                                              Input the string.



                                                                                                              @set o=%s:r=o%
                                                                                                              @set o=%o:e=o%


                                                                                                              Make a copy of the string with all of the rs and es replaced with os.



                                                                                                              @set r=%o:o=-%
                                                                                                              @set r= %r:~2%


                                                                                                              Make a copy of the string of os, change them to -s and replace the first two with a space.



                                                                                                              @set s=%s:e= %
                                                                                                              @for %%c in (%s:o=o %)do @call echo %%%%c%%


                                                                                                              Change the es into spaces and also add a space after each o, allowing the os and rs to be iterated over, printing the appropriate string each time.






                                                                                                              share|improve this answer
























                                                                                                                0












                                                                                                                0








                                                                                                                0






                                                                                                                Batch, 133 bytes



                                                                                                                @set/ps=
                                                                                                                @set o=%s:r=o%
                                                                                                                @set o=%o:e=o%
                                                                                                                @set r=%o:o=-%
                                                                                                                @set r= %r:~2%
                                                                                                                @set s=%s:e= %
                                                                                                                @for %%c in (%s:o=o %)do @call echo %%%%c%%


                                                                                                                Takes input on STDIN. Explanation:



                                                                                                                @set/ps=


                                                                                                                Input the string.



                                                                                                                @set o=%s:r=o%
                                                                                                                @set o=%o:e=o%


                                                                                                                Make a copy of the string with all of the rs and es replaced with os.



                                                                                                                @set r=%o:o=-%
                                                                                                                @set r= %r:~2%


                                                                                                                Make a copy of the string of os, change them to -s and replace the first two with a space.



                                                                                                                @set s=%s:e= %
                                                                                                                @for %%c in (%s:o=o %)do @call echo %%%%c%%


                                                                                                                Change the es into spaces and also add a space after each o, allowing the os and rs to be iterated over, printing the appropriate string each time.






                                                                                                                share|improve this answer












                                                                                                                Batch, 133 bytes



                                                                                                                @set/ps=
                                                                                                                @set o=%s:r=o%
                                                                                                                @set o=%o:e=o%
                                                                                                                @set r=%o:o=-%
                                                                                                                @set r= %r:~2%
                                                                                                                @set s=%s:e= %
                                                                                                                @for %%c in (%s:o=o %)do @call echo %%%%c%%


                                                                                                                Takes input on STDIN. Explanation:



                                                                                                                @set/ps=


                                                                                                                Input the string.



                                                                                                                @set o=%s:r=o%
                                                                                                                @set o=%o:e=o%


                                                                                                                Make a copy of the string with all of the rs and es replaced with os.



                                                                                                                @set r=%o:o=-%
                                                                                                                @set r= %r:~2%


                                                                                                                Make a copy of the string of os, change them to -s and replace the first two with a space.



                                                                                                                @set s=%s:e= %
                                                                                                                @for %%c in (%s:o=o %)do @call echo %%%%c%%


                                                                                                                Change the es into spaces and also add a space after each o, allowing the os and rs to be iterated over, printing the appropriate string each time.







                                                                                                                share|improve this answer












                                                                                                                share|improve this answer



                                                                                                                share|improve this answer










                                                                                                                answered 4 hours ago









                                                                                                                Neil

                                                                                                                79.5k744177




                                                                                                                79.5k744177























                                                                                                                    0














                                                                                                                    Mathematica, 111 bytes



                                                                                                                    (z=StringRepeat;n=StringLength@#;#~StringReplace~{"o"->"O"~z~n<>"n","re"->" "<>If[n>2,z["R",n-2],""]<>" n"})&


                                                                                                                    You can try it by going to https://develop.open.wolframcloud.com/app/ and clicking "Create a new notebook" and entering code like the following and then hitting Shift+Enter.



                                                                                                                    (z=StringRepeat;n=StringLength@#;#~StringReplace~{"o"->"O"~z~n<>"n","re"->" "<>If[n>2,z["R",n-2],""]<>" n"})&@"ooreoreore"




                                                                                                                    This code is not very fancy but it seems too expensive to convert away from strings and then back or to do anything else clever. In particular, with only 3-4 commands that have the name String, we don't save bytes at all by trying to abstract that away. For example, the following is 129 bytes:



                                                                                                                    (w=Symbol["String"<>#]&;z=w@"Repeat";n=w["Length"]@#;#~w@"Replace"~{"o"->"O"~z~n<>"n","re"->" "<>If[n>2,z["R",n-2],""]<>" n"})&





                                                                                                                    share|improve this answer


























                                                                                                                      0














                                                                                                                      Mathematica, 111 bytes



                                                                                                                      (z=StringRepeat;n=StringLength@#;#~StringReplace~{"o"->"O"~z~n<>"n","re"->" "<>If[n>2,z["R",n-2],""]<>" n"})&


                                                                                                                      You can try it by going to https://develop.open.wolframcloud.com/app/ and clicking "Create a new notebook" and entering code like the following and then hitting Shift+Enter.



                                                                                                                      (z=StringRepeat;n=StringLength@#;#~StringReplace~{"o"->"O"~z~n<>"n","re"->" "<>If[n>2,z["R",n-2],""]<>" n"})&@"ooreoreore"




                                                                                                                      This code is not very fancy but it seems too expensive to convert away from strings and then back or to do anything else clever. In particular, with only 3-4 commands that have the name String, we don't save bytes at all by trying to abstract that away. For example, the following is 129 bytes:



                                                                                                                      (w=Symbol["String"<>#]&;z=w@"Repeat";n=w["Length"]@#;#~w@"Replace"~{"o"->"O"~z~n<>"n","re"->" "<>If[n>2,z["R",n-2],""]<>" n"})&





                                                                                                                      share|improve this answer
























                                                                                                                        0












                                                                                                                        0








                                                                                                                        0






                                                                                                                        Mathematica, 111 bytes



                                                                                                                        (z=StringRepeat;n=StringLength@#;#~StringReplace~{"o"->"O"~z~n<>"n","re"->" "<>If[n>2,z["R",n-2],""]<>" n"})&


                                                                                                                        You can try it by going to https://develop.open.wolframcloud.com/app/ and clicking "Create a new notebook" and entering code like the following and then hitting Shift+Enter.



                                                                                                                        (z=StringRepeat;n=StringLength@#;#~StringReplace~{"o"->"O"~z~n<>"n","re"->" "<>If[n>2,z["R",n-2],""]<>" n"})&@"ooreoreore"




                                                                                                                        This code is not very fancy but it seems too expensive to convert away from strings and then back or to do anything else clever. In particular, with only 3-4 commands that have the name String, we don't save bytes at all by trying to abstract that away. For example, the following is 129 bytes:



                                                                                                                        (w=Symbol["String"<>#]&;z=w@"Repeat";n=w["Length"]@#;#~w@"Replace"~{"o"->"O"~z~n<>"n","re"->" "<>If[n>2,z["R",n-2],""]<>" n"})&





                                                                                                                        share|improve this answer












                                                                                                                        Mathematica, 111 bytes



                                                                                                                        (z=StringRepeat;n=StringLength@#;#~StringReplace~{"o"->"O"~z~n<>"n","re"->" "<>If[n>2,z["R",n-2],""]<>" n"})&


                                                                                                                        You can try it by going to https://develop.open.wolframcloud.com/app/ and clicking "Create a new notebook" and entering code like the following and then hitting Shift+Enter.



                                                                                                                        (z=StringRepeat;n=StringLength@#;#~StringReplace~{"o"->"O"~z~n<>"n","re"->" "<>If[n>2,z["R",n-2],""]<>" n"})&@"ooreoreore"




                                                                                                                        This code is not very fancy but it seems too expensive to convert away from strings and then back or to do anything else clever. In particular, with only 3-4 commands that have the name String, we don't save bytes at all by trying to abstract that away. For example, the following is 129 bytes:



                                                                                                                        (w=Symbol["String"<>#]&;z=w@"Repeat";n=w["Length"]@#;#~w@"Replace"~{"o"->"O"~z~n<>"n","re"->" "<>If[n>2,z["R",n-2],""]<>" n"})&






                                                                                                                        share|improve this answer












                                                                                                                        share|improve this answer



                                                                                                                        share|improve this answer










                                                                                                                        answered 3 hours ago









                                                                                                                        Mark S.

                                                                                                                        21117




                                                                                                                        21117























                                                                                                                            0















                                                                                                                            CJam, 27 bytes



                                                                                                                            q:T'e-{i2%T,'9*_:)2>S+?N}/


                                                                                                                            Try it online!



                                                                                                                            Explanation:



                                                                                                                            q                            read input:                    | "oreoo"
                                                                                                                            :T store in variable T | "oreoo", T="oreoo"
                                                                                                                            'e- remove all 'e' characters: | "oroo"
                                                                                                                            { }/ for each character: | 'o
                                                                                                                            i get Unicode value: | 79
                                                                                                                            2% modulo 2: | 1
                                                                                                                            T push original input: | 1 "oreoo"
                                                                                                                            , get length: | 1 5
                                                                                                                            '9* repeat '9' that many times: | 1 "99999"
                                                                                                                            _ duplicate: | 1 "99999" "99999"
                                                                                                                            :) increment every character: | 1 "99999" ":::::"
                                                                                                                            2> remove first two characters: | 1 "99999" ":::"
                                                                                                                            S+ prepend a space: | 1 "99999" " :::"
                                                                                                                            ? conditional: | "99999"
                                                                                                                            N add a newline: | "99999" N
                                                                                                                            (implicit output) | "99999" N " :::" N "99999" N "99999" N





                                                                                                                            share|improve this answer


























                                                                                                                              0















                                                                                                                              CJam, 27 bytes



                                                                                                                              q:T'e-{i2%T,'9*_:)2>S+?N}/


                                                                                                                              Try it online!



                                                                                                                              Explanation:



                                                                                                                              q                            read input:                    | "oreoo"
                                                                                                                              :T store in variable T | "oreoo", T="oreoo"
                                                                                                                              'e- remove all 'e' characters: | "oroo"
                                                                                                                              { }/ for each character: | 'o
                                                                                                                              i get Unicode value: | 79
                                                                                                                              2% modulo 2: | 1
                                                                                                                              T push original input: | 1 "oreoo"
                                                                                                                              , get length: | 1 5
                                                                                                                              '9* repeat '9' that many times: | 1 "99999"
                                                                                                                              _ duplicate: | 1 "99999" "99999"
                                                                                                                              :) increment every character: | 1 "99999" ":::::"
                                                                                                                              2> remove first two characters: | 1 "99999" ":::"
                                                                                                                              S+ prepend a space: | 1 "99999" " :::"
                                                                                                                              ? conditional: | "99999"
                                                                                                                              N add a newline: | "99999" N
                                                                                                                              (implicit output) | "99999" N " :::" N "99999" N "99999" N





                                                                                                                              share|improve this answer
























                                                                                                                                0












                                                                                                                                0








                                                                                                                                0







                                                                                                                                CJam, 27 bytes



                                                                                                                                q:T'e-{i2%T,'9*_:)2>S+?N}/


                                                                                                                                Try it online!



                                                                                                                                Explanation:



                                                                                                                                q                            read input:                    | "oreoo"
                                                                                                                                :T store in variable T | "oreoo", T="oreoo"
                                                                                                                                'e- remove all 'e' characters: | "oroo"
                                                                                                                                { }/ for each character: | 'o
                                                                                                                                i get Unicode value: | 79
                                                                                                                                2% modulo 2: | 1
                                                                                                                                T push original input: | 1 "oreoo"
                                                                                                                                , get length: | 1 5
                                                                                                                                '9* repeat '9' that many times: | 1 "99999"
                                                                                                                                _ duplicate: | 1 "99999" "99999"
                                                                                                                                :) increment every character: | 1 "99999" ":::::"
                                                                                                                                2> remove first two characters: | 1 "99999" ":::"
                                                                                                                                S+ prepend a space: | 1 "99999" " :::"
                                                                                                                                ? conditional: | "99999"
                                                                                                                                N add a newline: | "99999" N
                                                                                                                                (implicit output) | "99999" N " :::" N "99999" N "99999" N





                                                                                                                                share|improve this answer













                                                                                                                                CJam, 27 bytes



                                                                                                                                q:T'e-{i2%T,'9*_:)2>S+?N}/


                                                                                                                                Try it online!



                                                                                                                                Explanation:



                                                                                                                                q                            read input:                    | "oreoo"
                                                                                                                                :T store in variable T | "oreoo", T="oreoo"
                                                                                                                                'e- remove all 'e' characters: | "oroo"
                                                                                                                                { }/ for each character: | 'o
                                                                                                                                i get Unicode value: | 79
                                                                                                                                2% modulo 2: | 1
                                                                                                                                T push original input: | 1 "oreoo"
                                                                                                                                , get length: | 1 5
                                                                                                                                '9* repeat '9' that many times: | 1 "99999"
                                                                                                                                _ duplicate: | 1 "99999" "99999"
                                                                                                                                :) increment every character: | 1 "99999" ":::::"
                                                                                                                                2> remove first two characters: | 1 "99999" ":::"
                                                                                                                                S+ prepend a space: | 1 "99999" " :::"
                                                                                                                                ? conditional: | "99999"
                                                                                                                                N add a newline: | "99999" N
                                                                                                                                (implicit output) | "99999" N " :::" N "99999" N "99999" N






                                                                                                                                share|improve this answer












                                                                                                                                share|improve this answer



                                                                                                                                share|improve this answer










                                                                                                                                answered 3 hours ago









                                                                                                                                Esolanging Fruit

                                                                                                                                8,22432674




                                                                                                                                8,22432674























                                                                                                                                    0















                                                                                                                                    C# (Visual C# Interactive Compiler), 71 bytes





                                                                                                                                    s=>s.Aggregate("",(a,c)=>a+(c>111?" ":"n".PadLeft(s.Length+c/5-21,c)))


                                                                                                                                    Try it online!



                                                                                                                                    Borrowed some ideas from on Embodiment of Ignorance's answer for sure.



                                                                                                                                    -6 bytes thanks to @ASCIIOnly!



                                                                                                                                    The overall concept is to compute a string aggregate over the input characters following these rules:




                                                                                                                                    • If an r is encountered, append a single space character for indentation. We know the next character will be an e.

                                                                                                                                    • If an o or an e is encountered, generate a string by repeating the current character a specific number of times and prepending it to a newline. The number of times to repeat is determined by length of input string and whether the current line is indented.

                                                                                                                                    • The PadLeft function is used to generate the repeating character string.


                                                                                                                                    The result is the concatenation of all of these strings.






                                                                                                                                    share|improve this answer



















                                                                                                                                    • 1




                                                                                                                                      71
                                                                                                                                      – ASCII-only
                                                                                                                                      4 hours ago










                                                                                                                                    • @ASCIIOnly - Thanks :)
                                                                                                                                      – dana
                                                                                                                                      3 hours ago










                                                                                                                                    • > The whitespace padding on each side of the filling is required
                                                                                                                                      – ASCII-only
                                                                                                                                      29 mins ago










                                                                                                                                    • 85?
                                                                                                                                      – ASCII-only
                                                                                                                                      25 mins ago










                                                                                                                                    • I didn't notice that :) Although, in reviewing the posted answers about 1/2 have done this incorrectly as well. Good catch though!
                                                                                                                                      – dana
                                                                                                                                      18 mins ago
















                                                                                                                                    0















                                                                                                                                    C# (Visual C# Interactive Compiler), 71 bytes





                                                                                                                                    s=>s.Aggregate("",(a,c)=>a+(c>111?" ":"n".PadLeft(s.Length+c/5-21,c)))


                                                                                                                                    Try it online!



                                                                                                                                    Borrowed some ideas from on Embodiment of Ignorance's answer for sure.



                                                                                                                                    -6 bytes thanks to @ASCIIOnly!



                                                                                                                                    The overall concept is to compute a string aggregate over the input characters following these rules:




                                                                                                                                    • If an r is encountered, append a single space character for indentation. We know the next character will be an e.

                                                                                                                                    • If an o or an e is encountered, generate a string by repeating the current character a specific number of times and prepending it to a newline. The number of times to repeat is determined by length of input string and whether the current line is indented.

                                                                                                                                    • The PadLeft function is used to generate the repeating character string.


                                                                                                                                    The result is the concatenation of all of these strings.






                                                                                                                                    share|improve this answer



















                                                                                                                                    • 1




                                                                                                                                      71
                                                                                                                                      – ASCII-only
                                                                                                                                      4 hours ago










                                                                                                                                    • @ASCIIOnly - Thanks :)
                                                                                                                                      – dana
                                                                                                                                      3 hours ago










                                                                                                                                    • > The whitespace padding on each side of the filling is required
                                                                                                                                      – ASCII-only
                                                                                                                                      29 mins ago










                                                                                                                                    • 85?
                                                                                                                                      – ASCII-only
                                                                                                                                      25 mins ago










                                                                                                                                    • I didn't notice that :) Although, in reviewing the posted answers about 1/2 have done this incorrectly as well. Good catch though!
                                                                                                                                      – dana
                                                                                                                                      18 mins ago














                                                                                                                                    0












                                                                                                                                    0








                                                                                                                                    0







                                                                                                                                    C# (Visual C# Interactive Compiler), 71 bytes





                                                                                                                                    s=>s.Aggregate("",(a,c)=>a+(c>111?" ":"n".PadLeft(s.Length+c/5-21,c)))


                                                                                                                                    Try it online!



                                                                                                                                    Borrowed some ideas from on Embodiment of Ignorance's answer for sure.



                                                                                                                                    -6 bytes thanks to @ASCIIOnly!



                                                                                                                                    The overall concept is to compute a string aggregate over the input characters following these rules:




                                                                                                                                    • If an r is encountered, append a single space character for indentation. We know the next character will be an e.

                                                                                                                                    • If an o or an e is encountered, generate a string by repeating the current character a specific number of times and prepending it to a newline. The number of times to repeat is determined by length of input string and whether the current line is indented.

                                                                                                                                    • The PadLeft function is used to generate the repeating character string.


                                                                                                                                    The result is the concatenation of all of these strings.






                                                                                                                                    share|improve this answer















                                                                                                                                    C# (Visual C# Interactive Compiler), 71 bytes





                                                                                                                                    s=>s.Aggregate("",(a,c)=>a+(c>111?" ":"n".PadLeft(s.Length+c/5-21,c)))


                                                                                                                                    Try it online!



                                                                                                                                    Borrowed some ideas from on Embodiment of Ignorance's answer for sure.



                                                                                                                                    -6 bytes thanks to @ASCIIOnly!



                                                                                                                                    The overall concept is to compute a string aggregate over the input characters following these rules:




                                                                                                                                    • If an r is encountered, append a single space character for indentation. We know the next character will be an e.

                                                                                                                                    • If an o or an e is encountered, generate a string by repeating the current character a specific number of times and prepending it to a newline. The number of times to repeat is determined by length of input string and whether the current line is indented.

                                                                                                                                    • The PadLeft function is used to generate the repeating character string.


                                                                                                                                    The result is the concatenation of all of these strings.







                                                                                                                                    share|improve this answer














                                                                                                                                    share|improve this answer



                                                                                                                                    share|improve this answer








                                                                                                                                    edited 3 hours ago

























                                                                                                                                    answered 6 hours ago









                                                                                                                                    dana

                                                                                                                                    49135




                                                                                                                                    49135








                                                                                                                                    • 1




                                                                                                                                      71
                                                                                                                                      – ASCII-only
                                                                                                                                      4 hours ago










                                                                                                                                    • @ASCIIOnly - Thanks :)
                                                                                                                                      – dana
                                                                                                                                      3 hours ago










                                                                                                                                    • > The whitespace padding on each side of the filling is required
                                                                                                                                      – ASCII-only
                                                                                                                                      29 mins ago










                                                                                                                                    • 85?
                                                                                                                                      – ASCII-only
                                                                                                                                      25 mins ago










                                                                                                                                    • I didn't notice that :) Although, in reviewing the posted answers about 1/2 have done this incorrectly as well. Good catch though!
                                                                                                                                      – dana
                                                                                                                                      18 mins ago














                                                                                                                                    • 1




                                                                                                                                      71
                                                                                                                                      – ASCII-only
                                                                                                                                      4 hours ago










                                                                                                                                    • @ASCIIOnly - Thanks :)
                                                                                                                                      – dana
                                                                                                                                      3 hours ago










                                                                                                                                    • > The whitespace padding on each side of the filling is required
                                                                                                                                      – ASCII-only
                                                                                                                                      29 mins ago










                                                                                                                                    • 85?
                                                                                                                                      – ASCII-only
                                                                                                                                      25 mins ago










                                                                                                                                    • I didn't notice that :) Although, in reviewing the posted answers about 1/2 have done this incorrectly as well. Good catch though!
                                                                                                                                      – dana
                                                                                                                                      18 mins ago








                                                                                                                                    1




                                                                                                                                    1




                                                                                                                                    71
                                                                                                                                    – ASCII-only
                                                                                                                                    4 hours ago




                                                                                                                                    71
                                                                                                                                    – ASCII-only
                                                                                                                                    4 hours ago












                                                                                                                                    @ASCIIOnly - Thanks :)
                                                                                                                                    – dana
                                                                                                                                    3 hours ago




                                                                                                                                    @ASCIIOnly - Thanks :)
                                                                                                                                    – dana
                                                                                                                                    3 hours ago












                                                                                                                                    > The whitespace padding on each side of the filling is required
                                                                                                                                    – ASCII-only
                                                                                                                                    29 mins ago




                                                                                                                                    > The whitespace padding on each side of the filling is required
                                                                                                                                    – ASCII-only
                                                                                                                                    29 mins ago












                                                                                                                                    85?
                                                                                                                                    – ASCII-only
                                                                                                                                    25 mins ago




                                                                                                                                    85?
                                                                                                                                    – ASCII-only
                                                                                                                                    25 mins ago












                                                                                                                                    I didn't notice that :) Although, in reviewing the posted answers about 1/2 have done this incorrectly as well. Good catch though!
                                                                                                                                    – dana
                                                                                                                                    18 mins ago




                                                                                                                                    I didn't notice that :) Although, in reviewing the posted answers about 1/2 have done this incorrectly as well. Good catch though!
                                                                                                                                    – dana
                                                                                                                                    18 mins 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).






                                                                                                                                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                                                                                                                                    Please pay close attention to the following guidance:


                                                                                                                                    • Please be sure to answer the question. Provide details and share your research!

                                                                                                                                    But avoid



                                                                                                                                    • Asking for help, clarification, or responding to other answers.

                                                                                                                                    • Making statements based on opinion; back them up with references or personal experience.


                                                                                                                                    To learn more, see our tips on writing great answers.




                                                                                                                                    draft saved


                                                                                                                                    draft discarded














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

                                                                                                                                    1300-talet

                                                                                                                                    1300-talet

                                                                                                                                    Has there ever been an instance of an active nuclear power plant within or near a war zone?