Skip to main content
Commonmark migration
Source Link

#Japt, 35 32 22 20 16 15 bytes

Japt, 35 32 22 20 16 15 bytes

¡Y?(F-XnG)sG :X

Explanation:

¡                 //Take input and map (shortcut to "Um@"). Input should in the form of "#123456"
 Y?               //if Y is not 0, then return (F-XnG)sG, otherwise last step...
    F-XnG           //Subtract X, converted from hexadecimal (G is 16) to decimal, from 15
          sG        //convert decimal to hexadecimal
             :X   //...otherwise return X unchanged (happens only with #, the first char)

#Japt, 35 32 22 20 16 15 bytes

¡Y?(F-XnG)sG :X

Explanation:

¡                 //Take input and map (shortcut to "Um@"). Input should in the form of "#123456"
 Y?               //if Y is not 0, then return (F-XnG)sG, otherwise last step...
    F-XnG           //Subtract X, converted from hexadecimal (G is 16) to decimal, from 15
          sG        //convert decimal to hexadecimal
             :X   //...otherwise return X unchanged (happens only with #, the first char)

Japt, 35 32 22 20 16 15 bytes

¡Y?(F-XnG)sG :X

Explanation:

¡                 //Take input and map (shortcut to "Um@"). Input should in the form of "#123456"
 Y?               //if Y is not 0, then return (F-XnG)sG, otherwise last step...
    F-XnG           //Subtract X, converted from hexadecimal (G is 16) to decimal, from 15
          sG        //convert decimal to hexadecimal
             :X   //...otherwise return X unchanged (happens only with #, the first char)
deleted 39 characters in body
Source Link
nicael
  • 4.8k
  • 24
  • 43

#Japt, 35 32 22 20 1616 15 bytes

Ur"\\w"@F¡Y?(F-XnG)sG :X

Explanation:

U  ¡                 //Take input and map (shortcut to "Um@"). ShouldInput should in the form of "#123456"
 r..............    //.replace()...
Y?  "\\w"             //...anyif alphanumericY charis (i.e.not all0, butthen thereturn #(F-XnG) with..
    sG, otherwise last @.....step...    //anonymous function with parameters X,Y,Z (actually only first used)
    F-XnG    F-XnG       //Subtract X, converted from hexadecimal (G is 16) to decimal, from 15
          sG    sG    //convert decimal to hexadecimal 
 and return the result to @       :X   //...otherwise return X unchanged (happens only with #, the first char)

#Japt, 35 32 22 20 16 bytes

Ur"\\w"@F-XnG)sG

Explanation:

U                   //input. Should in the form of "#123456"
 r..............    //.replace()...
  "\\w"             //...any alphanumeric char (i.e. all but the #) with..
       @........    //anonymous function with parameters X,Y,Z (actually only first used)
        F-XnG       //Subtract X, converted from hexadecimal (G is 16) to decimal, from 15
              sG    //convert decimal to hexadecimal and return the result to @...

#Japt, 35 32 22 20 16 15 bytes

¡Y?(F-XnG)sG :X

Explanation:

¡                 //Take input and map (shortcut to "Um@"). Input should in the form of "#123456"
 Y?               //if Y is not 0, then return (F-XnG)sG, otherwise last step...
    F-XnG           //Subtract X, converted from hexadecimal (G is 16) to decimal, from 15
          sG        //convert decimal to hexadecimal 
             :X   //...otherwise return X unchanged (happens only with #, the first char)
added 443 characters in body; added 37 characters in body
Source Link
nicael
  • 4.8k
  • 24
  • 43

#Japt, 35 32 22 20 16 bytes

Ur"\\w"@F-XnG)sG

Explanation:

U                   //input. Should in the form of "#123456"
 r..............    //.replace()...
  "\\w"             //...any alphanumeric char (i.e. all but the #) with..
       @........    //anonymous function with parameters X,Y,Z (actually only first used)
        F-XnG       //Subtract X, converted from hexadecimal (G is 16) to decimal, from 15
              sG    //convert decimal to hexadecimal and return the result to @...

#Japt, 35 32 22 20 16 bytes

Ur"\\w"@F-XnG)sG

#Japt, 35 32 22 20 16 bytes

Ur"\\w"@F-XnG)sG

Explanation:

U                   //input. Should in the form of "#123456"
 r..............    //.replace()...
  "\\w"             //...any alphanumeric char (i.e. all but the #) with..
       @........    //anonymous function with parameters X,Y,Z (actually only first used)
        F-XnG       //Subtract X, converted from hexadecimal (G is 16) to decimal, from 15
              sG    //convert decimal to hexadecimal and return the result to @...
added 7 characters in body; deleted 1 character in body
Source Link
nicael
  • 4.8k
  • 24
  • 43
Loading
added 8 characters in body
Source Link
nicael
  • 4.8k
  • 24
  • 43
Loading
deleted 104 characters in body
Source Link
nicael
  • 4.8k
  • 24
  • 43
Loading
deleted 3 characters in body
Source Link
nicael
  • 4.8k
  • 24
  • 43
Loading
Post Undeleted by nicael
added 68 characters in body
Source Link
nicael
  • 4.8k
  • 24
  • 43
Loading
Post Deleted by nicael
Source Link
nicael
  • 4.8k
  • 24
  • 43
Loading