Skip to main content
added 17 characters in body
Source Link
rydwolf
  • 18.9k
  • 2
  • 83
  • 172

JavaScript (ES6), 2526 bytes

-1 thanks to @thejonymyster

-7 thanks to @Arnauld

-4 thanks to @l4m2

x=>x.replace(/pl|1-2|1/,z=>+z?'pl':1z=>~z)

Swaps the first instance of -12 and 1, saving 1 byte when the program compresses itself. Takes the list of bytes as input, as a string.

This is quite the community effort now :p

JavaScript (ES6), 25 bytes

-1 thanks to @thejonymyster

-7 thanks to @Arnauld

x=>x.replace(/pl|1/,z=>+z?'pl':1)

Swaps the first instance of -1 and 1, saving 1 byte when the program compresses itself. Takes the list of bytes as input, as a string.

This is quite the community effort now :p

JavaScript (ES6), 26 bytes

-1 thanks to @thejonymyster

-7 thanks to @Arnauld

-4 thanks to @l4m2

x=>x.replace(/-2|1/,z=>~z)

Swaps the first instance of -2 and 1, saving 1 byte when the program compresses itself. Takes the list of bytes as input, as a string.

This is quite the community effort now :p

deleted 16 characters in body
Source Link
rydwolf
  • 18.9k
  • 2
  • 83
  • 172

JavaScript (ES6), 25 bytes

-1 thanks to @thejonymyster

-7 thanks to @Arnauld

-5 thanks to @l4m2

x=>x.replace(/-?1pl|1/,z=>-zz=>+z?'pl':1)

Swaps the first instance of -1 and 1, saving 1 byte when the program compresses itself. Takes the list of bytes as input, as a string.

This is quite the community effort now :p

JavaScript (ES6), 25 bytes

-1 thanks to @thejonymyster

-7 thanks to @Arnauld

-5 thanks to @l4m2

x=>x.replace(/-?1/,z=>-z)

Swaps the first instance of -1 and 1, saving 1 byte when the program compresses itself. Takes the list of bytes as input, as a string.

This is quite the community effort now :p

JavaScript (ES6), 25 bytes

-1 thanks to @thejonymyster

-7 thanks to @Arnauld

x=>x.replace(/pl|1/,z=>+z?'pl':1)

Swaps the first instance of -1 and 1, saving 1 byte when the program compresses itself. Takes the list of bytes as input, as a string.

This is quite the community effort now :p

added 64 characters in body
Source Link
rydwolf
  • 18.9k
  • 2
  • 83
  • 172

JavaScript (ES6), 3025 bytes

-1 thanks to @thejonymyster

-7 thanks to @Arnauld

-5 thanks to @l4m2

x=>x.replace(/11|0-?1/,z=>!+z*11-z)

Swaps the first instance of 11-1 and 01, saving 1 byte when the program compresses itself. Takes the list of bytes as input, as a string.

This is quite the community effort now :p

JavaScript (ES6), 30 bytes

-1 thanks to @thejonymyster

-7 thanks to @Arnauld

x=>x.replace(/11|0/,z=>!+z*11)

Swaps the first instance of 11 and 0, saving 1 byte when the program compresses itself. Takes the list of bytes as input, as a string.

JavaScript (ES6), 25 bytes

-1 thanks to @thejonymyster

-7 thanks to @Arnauld

-5 thanks to @l4m2

x=>x.replace(/-?1/,z=>-z)

Swaps the first instance of -1 and 1, saving 1 byte when the program compresses itself. Takes the list of bytes as input, as a string.

This is quite the community effort now :p

deleted 3 characters in body
Source Link
rydwolf
  • 18.9k
  • 2
  • 83
  • 172
Loading
added 23 characters in body
Source Link
rydwolf
  • 18.9k
  • 2
  • 83
  • 172
Loading
added 32 characters in body
Source Link
rydwolf
  • 18.9k
  • 2
  • 83
  • 172
Loading
deleted 6 characters in body
Source Link
rydwolf
  • 18.9k
  • 2
  • 83
  • 172
Loading
Source Link
rydwolf
  • 18.9k
  • 2
  • 83
  • 172
Loading