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

#MATL , 8 bytes

MATL , 8 bytes

With thanks to @Dennis, who suggested that MATL should incorporate modular indexing, and to @Suever, who had the idea of automatic pairwise operations.

1Y2t&+Q)

Try it online!

1Y2 % Predefined literal: string 'AB...Z'
t % Push another copy of it
&+ % 2D array with all pairwise additions of ASCII code points from that string.
 % Gives the ×ばつ26 array [130 131... 155; 131 132... 146; ...; 155 156... 180] 
Q % Add 1 to each element. First entry is now 131, etc
) % Index into string 'AB...Z'. Since it has length 26 and MATL uses modular
 % indexing, 131 is the first entry (character 'A'), etc. Implicitly display

#MATL , 8 bytes

With thanks to @Dennis, who suggested that MATL should incorporate modular indexing, and to @Suever, who had the idea of automatic pairwise operations.

1Y2t&+Q)

Try it online!

1Y2 % Predefined literal: string 'AB...Z'
t % Push another copy of it
&+ % 2D array with all pairwise additions of ASCII code points from that string.
 % Gives the ×ばつ26 array [130 131... 155; 131 132... 146; ...; 155 156... 180] 
Q % Add 1 to each element. First entry is now 131, etc
) % Index into string 'AB...Z'. Since it has length 26 and MATL uses modular
 % indexing, 131 is the first entry (character 'A'), etc. Implicitly display

MATL , 8 bytes

With thanks to @Dennis, who suggested that MATL should incorporate modular indexing, and to @Suever, who had the idea of automatic pairwise operations.

1Y2t&+Q)

Try it online!

1Y2 % Predefined literal: string 'AB...Z'
t % Push another copy of it
&+ % 2D array with all pairwise additions of ASCII code points from that string.
 % Gives the ×ばつ26 array [130 131... 155; 131 132... 146; ...; 155 156... 180] 
Q % Add 1 to each element. First entry is now 131, etc
) % Index into string 'AB...Z'. Since it has length 26 and MATL uses modular
 % indexing, 131 is the first entry (character 'A'), etc. Implicitly display
replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
Source Link

#MATL, 8 bytes

With thanks to @Dennis @Dennis, who suggested suggested that MATL should incorporate modular indexing, and to @Suever @Suever, who had the idea idea of automatic pairwise operations.

1Y2t&+Q)

Try it online!

1Y2 % Predefined literal: string 'AB...Z'
t % Push another copy of it
&+ % 2D array with all pairwise additions of ASCII code points from that string.
 % Gives the ×ばつ26 array [130 131... 155; 131 132... 146; ...; 155 156... 180] 
Q % Add 1 to each element. First entry is now 131, etc
) % Index into string 'AB...Z'. Since it has length 26 and MATL uses modular
 % indexing, 131 is the first entry (character 'A'), etc. Implicitly display

#MATL, 8 bytes

With thanks to @Dennis, who suggested that MATL should incorporate modular indexing, and to @Suever, who had the idea of automatic pairwise operations.

1Y2t&+Q)

Try it online!

1Y2 % Predefined literal: string 'AB...Z'
t % Push another copy of it
&+ % 2D array with all pairwise additions of ASCII code points from that string.
 % Gives the ×ばつ26 array [130 131... 155; 131 132... 146; ...; 155 156... 180] 
Q % Add 1 to each element. First entry is now 131, etc
) % Index into string 'AB...Z'. Since it has length 26 and MATL uses modular
 % indexing, 131 is the first entry (character 'A'), etc. Implicitly display

#MATL, 8 bytes

With thanks to @Dennis, who suggested that MATL should incorporate modular indexing, and to @Suever, who had the idea of automatic pairwise operations.

1Y2t&+Q)

Try it online!

1Y2 % Predefined literal: string 'AB...Z'
t % Push another copy of it
&+ % 2D array with all pairwise additions of ASCII code points from that string.
 % Gives the ×ばつ26 array [130 131... 155; 131 132... 146; ...; 155 156... 180] 
Q % Add 1 to each element. First entry is now 131, etc
) % Index into string 'AB...Z'. Since it has length 26 and MATL uses modular
 % indexing, 131 is the first entry (character 'A'), etc. Implicitly display
added 161 characters in body
Source Link
Luis Mendo
  • 106.7k
  • 10
  • 139
  • 382

#MATL, 8 bytes

With thanks to Dennis@Dennis, who suggested that MATL should incorporate modular indexing, and to @Suever , who had the idea of automatic pairwise operations.

1Y2t&+Q)

Try it online!

1Y2 % Predefined literal: string 'AB...Z'
t % Push another copy of it
&+ % 2D array with all pairwise additions of ASCII code points from that string.
 % Gives the ×ばつ26 array [130 131... 155; 131 132... 146; ...; 155 156... 180] 
Q % Add 1 to each element. First entry is now 131, etc
) % Index into string 'AB...Z'. Since it has length 26 and MATL uses modular
 % indexing, 131 is the first entry (character 'A'), etc. Implicitly display

#MATL, 8 bytes

With thanks to Dennis, who suggested that MATL should incorporate modular indexing.

1Y2t&+Q)

Try it online!

1Y2 % Predefined literal: string 'AB...Z'
t % Push another copy of it
&+ % 2D array with all pairwise additions of ASCII code points from that string.
 % Gives the ×ばつ26 array [130 131... 155; 131 132... 146; ...; 155 156... 180] 
Q % Add 1 to each element. First entry is now 131, etc
) % Index into string 'AB...Z'. Since it has length 26 and MATL uses modular
 % indexing, 131 is the first entry (character 'A'), etc. Implicitly display

#MATL, 8 bytes

With thanks to @Dennis, who suggested that MATL should incorporate modular indexing, and to @Suever , who had the idea of automatic pairwise operations.

1Y2t&+Q)

Try it online!

1Y2 % Predefined literal: string 'AB...Z'
t % Push another copy of it
&+ % 2D array with all pairwise additions of ASCII code points from that string.
 % Gives the ×ばつ26 array [130 131... 155; 131 132... 146; ...; 155 156... 180] 
Q % Add 1 to each element. First entry is now 131, etc
) % Index into string 'AB...Z'. Since it has length 26 and MATL uses modular
 % indexing, 131 is the first entry (character 'A'), etc. Implicitly display
added 2 characters in body
Source Link
Luis Mendo
  • 106.7k
  • 10
  • 139
  • 382
Loading
added 509 characters in body
Source Link
Luis Mendo
  • 106.7k
  • 10
  • 139
  • 382
Loading
Source Link
Luis Mendo
  • 106.7k
  • 10
  • 139
  • 382
Loading

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