Skip to main content
Commonmark migration
Source Link

#Japt -P, 11 bytes

Japt -P, 11 bytes

Takes advantage of the fact that spaces can be coerced to 0 in JavaScript when trying to perform a mathematical or, in this case, bitwise operation on it.

c_¤ù7Ãä^ i1

Try it or run all test cases

c_¤ù7Ãä^ i1     :Implicit input of string
c_              :Map codepoints
  ¤             :  Convert to binary string
   ù7           :  Left pad with spaces to length 7
     Ã          :End map
      ä^        :XOR consecutive pairs
         i1     :Prepend 1
                :Implicitly join and output

#Japt -P, 11 bytes

Takes advantage of the fact that spaces can be coerced to 0 in JavaScript when trying to perform a mathematical or, in this case, bitwise operation on it.

c_¤ù7Ãä^ i1

Try it or run all test cases

c_¤ù7Ãä^ i1     :Implicit input of string
c_              :Map codepoints
  ¤             :  Convert to binary string
   ù7           :  Left pad with spaces to length 7
     Ã          :End map
      ä^        :XOR consecutive pairs
         i1     :Prepend 1
                :Implicitly join and output

Japt -P, 11 bytes

Takes advantage of the fact that spaces can be coerced to 0 in JavaScript when trying to perform a mathematical or, in this case, bitwise operation on it.

c_¤ù7Ãä^ i1

Try it or run all test cases

c_¤ù7Ãä^ i1     :Implicit input of string
c_              :Map codepoints
  ¤             :  Convert to binary string
   ù7           :  Left pad with spaces to length 7
     Ã          :End map
      ä^        :XOR consecutive pairs
         i1     :Prepend 1
                :Implicitly join and output
added 268 characters in body; added 7 characters in body
Source Link
Shaggy
  • 42.2k
  • 4
  • 34
  • 94

#Japt -P, 11 bytes

Takes advantage of the fact that spaces can be coerced to 0 in JavaScript when trying to perform a mathematical or, in this case, bitwise operation on it.

c_¤ù7Ãä^ i1

Try it or run all test cases

c_¤ù7Ãä^ i1     :Implicit input of string
c_              :Map codepoints
  ¤             :  Convert to binary string
   ù7           :  Left pad with spaces to length 7
     Ã          :End map
      ä^        :XOR consecutive pairs
         i1     :Prepend 1
                :Implicitly join and output

#Japt -P, 11 bytes

Takes advantage of the fact that spaces can be coerced to 0 in JavaScript.

c_¤ù7Ãä^ i1

Try it

c_¤ù7Ãä^ i1     :Implicit input of string
c_              :Map codepoints
  ¤             :  Convert to binary string
   ù7           :  Left pad with spaces to length 7
     Ã          :End map
      ä^        :XOR consecutive pairs
         i1     :Prepend 1
                :Implicitly join and output

#Japt -P, 11 bytes

Takes advantage of the fact that spaces can be coerced to 0 in JavaScript when trying to perform a mathematical or, in this case, bitwise operation on it.

c_¤ù7Ãä^ i1

Try it or run all test cases

c_¤ù7Ãä^ i1     :Implicit input of string
c_              :Map codepoints
  ¤             :  Convert to binary string
   ù7           :  Left pad with spaces to length 7
     Ã          :End map
      ä^        :XOR consecutive pairs
         i1     :Prepend 1
                :Implicitly join and output
deleted 15 characters in body
Source Link
Shaggy
  • 42.2k
  • 4
  • 34
  • 94

#Japt -P, 12 11 911 bytes

Takes advantage of the fact that spaces can be coerced to 0 in JavaScript.

c_¤ù7Ãä^Tc_¤ù7Ãä^ i1

Try itTry it

c_¤ù7Ãä^Tc_¤ù7Ãä^ i1     :Implicit input of string
c_              :Map codepoints
  ¤             :  Convert to binary string
   ù7           :  Left pad with spaces to length 7
     Ã          :End map
      ä^        :XOR consecutive pairs
        T i1    :After first:Prepend prepending1
 a 0
              :Implicitly join and output

#Japt -P, 12 11 9 bytes

c_¤ù7Ãä^T

Try it

c_¤ù7Ãä^T     :Implicit input of string
c_            :Map codepoints
  ¤           :  Convert to binary string
   ù7         :  Left pad with spaces to length 7
     Ã        :End map
      ä^      :XOR consecutive pairs
        T     :After first prepending a 0
              :Implicitly join and output

#Japt -P, 11 bytes

Takes advantage of the fact that spaces can be coerced to 0 in JavaScript.

c_¤ù7Ãä^ i1

Try it

c_¤ù7Ãä^ i1     :Implicit input of string
c_              :Map codepoints
  ¤             :  Convert to binary string
   ù7           :  Left pad with spaces to length 7
     Ã          :End map
      ä^        :XOR consecutive pairs
         i1     :Prepend 1
                :Implicitly join and output
added 413 characters in body
Source Link
Shaggy
  • 42.2k
  • 4
  • 34
  • 94
Loading
added 413 characters in body
Source Link
Shaggy
  • 42.2k
  • 4
  • 34
  • 94
Loading
added 34 characters in body
Source Link
Shaggy
  • 42.2k
  • 4
  • 34
  • 94
Loading
Source Link
Shaggy
  • 42.2k
  • 4
  • 34
  • 94
Loading