Skip to main content
added 947 characters in body
Source Link
emanresu A
  • 44.2k
  • 5
  • 100
  • 240

Vyxal,  95 91 9155 bytes

@i|¥‛--oṘλ2ẇ«½∇«:\irß›,;Ẋ«∨uOŻN€bMċ∇Dk«⌈Ŀṅ\e/:£L‹(¥2wiL‹\e*$ṅ+;Ẋ‛eeo:\\erß›\e\-$r[@i;Q|Dh$t=[¥2ȯ‹|:«ƛẆ°«r[t«½∇«:1ǓĿ¥2ȯ+|t«½∇«:1ǔĿ¥2ȯ+‹]]£])@iV

Try it Online!Try it Online!

The messiest mess I've ever madePartially ported ovs. EvenDo I don't really understand it...

This goes through the first two characters of the string repeatedly, 'bubbling' -s to the end and eventually replacing double -s with nothing, then adding in ones if necessary.win 'Most improved'?

Borrowed a trick from @ovs by checking if the result isMakes a substring of -lot more sense now.

λ                                     ;                 # Lambda
 2ẇ                                                     # Chunks of 2
   «½∇«                                                 # Compressed `ijk`
       :Ẋ                                               # Cartesian square
         «∨uOŻN€bMċ∇Dk«                                 # Compressed string `e k ej ek e i j ei e`
                       ⌈                                # Split by spaces
                        Ŀ                               # Transliterate
                         ṅ                              # Join
                          \e/                           # Split by `e`
                             :                          # Duplicate
                              L‹\e*                     # (Length - 1) es
                                   $ṅ+                  # Prepended (so es are bubbled to start
                                       Ẋ                # Repeat on input until result doesn't change 
                                        ‛eeo            # Get rid of double es
                                            :\erß       # If result is a substring of 'e'
                                                 ›      # Append a 1
                                                  \e\-V # Replace es with -s

Vyxal,  95 91 bytes

@i|¥‛--oṘ:\irß›,;:£L‹(¥2wi:\-$r[@i;Q|Dh$t=[¥2ȯ‹|:«ƛẆ°«r[t«½∇«:1ǓĿ¥2ȯ+|t«½∇«:1ǔĿ¥2ȯ+‹]]£])@i

Try it Online!

The messiest mess I've ever made. Even I don't really understand it...

This goes through the first two characters of the string repeatedly, 'bubbling' -s to the end and eventually replacing double -s with nothing, then adding in ones if necessary.

Borrowed a trick from @ovs by checking if the result is a substring of -.

Vyxal,95 91 55 bytes

λ2ẇ«½∇«:Ẋ«∨uOŻN€bMċ∇Dk«⌈Ŀṅ\e/:L‹\e*$ṅ+;Ẋ‛eeo:\erß›\e\-V

Try it Online!

Partially ported ovs. Do I win 'Most improved'?

Makes a lot more sense now.

λ                                     ;                 # Lambda
 2ẇ                                                     # Chunks of 2
   «½∇«                                                 # Compressed `ijk`
       :Ẋ                                               # Cartesian square
         «∨uOŻN€bMċ∇Dk«                                 # Compressed string `e k ej ek e i j ei e`
                       ⌈                                # Split by spaces
                        Ŀ                               # Transliterate
                         ṅ                              # Join
                          \e/                           # Split by `e`
                             :                          # Duplicate
                              L‹\e*                     # (Length - 1) es
                                   $ṅ+                  # Prepended (so es are bubbled to start
                                       Ẋ                # Repeat on input until result doesn't change 
                                        ‛eeo            # Get rid of double es
                                            :\erß       # If result is a substring of 'e'
                                                 ›      # Append a 1
                                                  \e\-V # Replace es with -s
added 64 characters in body
Source Link
emanresu A
  • 44.2k
  • 5
  • 100
  • 240

Vyxal, 9595 91 bytes

@i|¥‛--oṘD\-=$¤=∨ß›oṘ:\irß›,;:£L‹(¥2wi:\-$r[@i;Q|Dh$t=[¥2ȯ‹|:«ƛẆ°«r[t«½∇«:1ǓĿ¥2ȯ+|t«½∇«:1ǔĿ¥2ȯ+‹]]£])@i

Try it Online!Try it Online!

The messiest mess I've ever made. Even I don't really understand it...

This goes through the first two characters of the string repeatedly, 'bubbling' -s to the end and eventually replacing double -s with nothing, then adding in ones if necessary.

Borrowed a trick from @ovs by checking if the result is a substring of -.

Vyxal, 95 bytes

@i|¥‛--oṘD\-=$¤=∨ß›,;:£L‹(¥2wi:\-$r[@i;Q|Dh$t=[¥2ȯ‹|:«ƛẆ°«r[t«½∇«:1ǓĿ¥2ȯ+|t«½∇«:1ǔĿ¥2ȯ+‹]]£])@i

Try it Online!

The messiest mess I've ever made. Even I don't really understand it...

This goes through the first two characters of the string repeatedly, 'bubbling' -s to the end and eventually replacing double -s with nothing, then adding in ones if necessary.

Vyxal, 95 91 bytes

@i|¥‛--oṘ:\irß›,;:£L‹(¥2wi:\-$r[@i;Q|Dh$t=[¥2ȯ‹|:«ƛẆ°«r[t«½∇«:1ǓĿ¥2ȯ+|t«½∇«:1ǔĿ¥2ȯ+‹]]£])@i

Try it Online!

The messiest mess I've ever made. Even I don't really understand it...

This goes through the first two characters of the string repeatedly, 'bubbling' -s to the end and eventually replacing double -s with nothing, then adding in ones if necessary.

Borrowed a trick from @ovs by checking if the result is a substring of -.

added 16 characters in body
Source Link
emanresu A
  • 44.2k
  • 5
  • 100
  • 240

Vyxal, 9695 bytes

@i|¥‛--oṘD\-=$¤=∨ß›,;:£L‹(¥2wi:\-$r[¥‛--oṘ:\-=[1+]:¤=[1+],Q|Dh$t=[¥2ȯ\-+|$r[@i;Q|Dh$t=[¥2ȯ‹|:«ƛẆ°«r[t«½∇«:1ǓĿ¥2ȯ+|t«½∇«:1ǔĿ¥2ȯ+\-+]]£]1ǔĿ¥2ȯ+‹]]£])¥@i

Try it Online!Try it Online!

The messiest mess I've ever made. Even I don't really understand it...

This goes through the first two characters of the string repeatedly, 'bubbling' -s to the end and eventually replacing double -s with nothing, then adding in ones if necessary.

Vyxal, 96 bytes

:£L‹(¥2wi:\-$r[¥‛--oṘ:\-=[1+]:¤=[1+],Q|Dh$t=[¥2ȯ\-+|:«ƛẆ°«r[t«½∇«:1ǓĿ¥2ȯ+|t«½∇«:1ǔĿ¥2ȯ+\-+]]£])¥

Try it Online!

The messiest mess I've ever made. Even I don't really understand it...

This goes through the first two characters of the string repeatedly, 'bubbling' -s to the end and eventually replacing double -s with nothing, then adding in ones if necessary.

Vyxal, 95 bytes

@i|¥‛--oṘD\-=$¤=∨ß›,;:£L‹(¥2wi:\-$r[@i;Q|Dh$t=[¥2ȯ‹|:«ƛẆ°«r[t«½∇«:1ǓĿ¥2ȯ+|t«½∇«:1ǔĿ¥2ȯ+‹]]£])@i

Try it Online!

The messiest mess I've ever made. Even I don't really understand it...

This goes through the first two characters of the string repeatedly, 'bubbling' -s to the end and eventually replacing double -s with nothing, then adding in ones if necessary.

Source Link
emanresu A
  • 44.2k
  • 5
  • 100
  • 240
Loading