Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

Commonmark migration
Source Link

#05AB1E , 23 (12+11) bytes

05AB1E , 23 (12+11) bytes

#05AB1E , 23 (12+11) bytes

05AB1E , 23 (12+11) bytes

Added debug-TIO
Source Link
Kevin Cruijssen
  • 136.2k
  • 14
  • 154
  • 394
Source Link
Kevin Cruijssen
  • 136.2k
  • 14
  • 154
  • 394

#05AB1E, 23 (12+11) bytes

Uses the 05AB1E encoding for the Caesar-shifting.

Encoder:

žĆDII(._kI+è

Input order as string, shift, (optional Caesar-shift). I/O of the strings as character-list.

Try it online.

Decoder:

žĆDIkI-èI._

Input order as string, (optional Caesar-shift), shift. I/O of the strings as character-list.

Try it online.

Explanation:

 # ENCODER:
žĆ # Push the 05AB1E codepage
 D # Duplicate it
 I # Push the first character-list input
 I # Push the second shift integer
 ( # Negate it
 ._ # Shift the character-list that many times towards the left
 k # Get the index of each character in the duplicated codepage
 I # Push the second shift input again or the optional third Caesar-shift input
 + # Add it to each index
 è # And index it into the 05AB1E codepage
 # (after which the resulting character-list is output implicitly as result)
 # DECODER:
žĆ # Push the 05AB1E codepage
 D # Duplicate it
 I # Push the first character-list input
 k # Get the index of each in the duplicated codepage
 I # Push the optional Caesar-shift or shift integer
 - # Subtract it from each index
 è # Index it into the 05AB1E codepage
 I # Push the second/third shift integer
 ._ # And rotate the character-list that many times towards the left
 # (after which the resulting character-list is output implicitly as result)

AltStyle によって変換されたページ (->オリジナル) /