Skip to main content
edited body
Source Link
Dennis
  • 210.6k
  • 41
  • 370
  • 825

Pyth, 1919 18 bytes

j" ~BOO!~ "cz]OStlz"cz]OtUz

Try it online.Thanks to @Jakube for golfing off 1 byte!

Try it online.

How it works

                     (implicit) Store the input in z.
                 lzUz  Compute the length[0, of... len(z)-1].
                t    Subtract 1.
               S     TurnRemove the integer n into [1, ... ,first n]element.
              O      Select an integer, pseudo-randomly.
             ]       Wrap it in an array.
           cz        Split the input string at that point.
j" ~BOO!~ "          Join the split string, using " ~BOO!~ " as separator.

Pyth, 19 bytes

j" ~BOO!~ "cz]OStlz

Try it online.

How it works

                     (implicit) Store the input in z.
                 lz  Compute the length of z.
                t    Subtract 1.
               S     Turn the integer n into [1, ... , n].
              O      Select an integer, pseudo-randomly.
             ]       Wrap it in an array.
           cz        Split the input string at that point.
j" ~BOO!~ "          Join the split string, using " ~BOO!~ " as separator.

Pyth, 19 18 bytes

j" ~BOO!~ "cz]OtUz

Thanks to @Jakube for golfing off 1 byte!

Try it online.

How it works

                    (implicit) Store the input in z.
                Uz  Compute [0, ... len(z)-1].
               t    Remove the first element.
              O     Select an integer, pseudo-randomly.
             ]      Wrap it in an array.
           cz       Split the input string at that point.
j" ~BOO!~ "         Join the split string, using " ~BOO!~ " as separator.
added 487 characters in body
Source Link
Dennis
  • 210.6k
  • 41
  • 370
  • 825

Pyth, 19 bytes

j" ~BOO!~ "cz]OPSlz"cz]OStlz

Try it online.Try it online.

How it works

                     (implicit) Store the input in z.
                 lz  Compute the length of z.
                t    Subtract 1.
               S     Turn the integer n into [1, ... , n].
              O      Select an integer, pseudo-randomly.
             ]       Wrap it in an array.
           cz        Split the input string at that point.
j" ~BOO!~ "          Join the split string, using " ~BOO!~ " as separator.

Pyth, 19 bytes

j" ~BOO!~ "cz]OPSlz

Try it online.

Pyth, 19 bytes

j" ~BOO!~ "cz]OStlz

Try it online.

How it works

                     (implicit) Store the input in z.
                 lz  Compute the length of z.
                t    Subtract 1.
               S     Turn the integer n into [1, ... , n].
              O      Select an integer, pseudo-randomly.
             ]       Wrap it in an array.
           cz        Split the input string at that point.
j" ~BOO!~ "          Join the split string, using " ~BOO!~ " as separator.
Source Link
Dennis
  • 210.6k
  • 41
  • 370
  • 825

Pyth, 19 bytes

j" ~BOO!~ "cz]OPSlz

Try it online.