Skip to main content
Commonmark migration
Source Link

#Japt -R, 24 23 17 15 bytes

Japt -R, 24 23 17 15 bytes

Outputs an array, includes a leading newline and a leading & trailing space on each line.

IòUc ÏçSiXd¹iYç

Test it

  • 1 byte saved with help from Oliver and a further 6 thanks to him pointing out a better way to generate the initial array.

#Japt -R, 24 23 17 15 bytes

Outputs an array, includes a leading newline and a leading & trailing space on each line.

IòUc ÏçSiXd¹iYç

Test it

  • 1 byte saved with help from Oliver and a further 6 thanks to him pointing out a better way to generate the initial array.

Japt -R, 24 23 17 15 bytes

Outputs an array, includes a leading newline and a leading & trailing space on each line.

IòUc ÏçSiXd¹iYç

Test it

  • 1 byte saved with help from Oliver and a further 6 thanks to him pointing out a better way to generate the initial array.
deleted 713 characters in body
Source Link
Shaggy
  • 43.5k
  • 4
  • 36
  • 94

#Japt -R, 24 23 1717 15 bytes

Outputs an array, includes a leading newline and a leading & trailing space on each line.

IòUc @SiXd)pY)iYçÏçSiXd¹iYç

Test itTest it

  • 1 byte saved with help from Oliver and a further 6 thanks to him pointing out a better way to generate the initial array.

We can get rid of the leading newline and spaces at the cost of 2 bytes:

IòUc)Å£SiXd)pYÄ)iYç

Test it


##Explanation Implicit input of uppercase character string U.

IòUc

Generate an array of integers (ò) from 64 (I) to U's character code, inclusive.

@

Pass each through a function where X is the current integer and Y is the current index.

SiXd)

Prepend (i) a space (S) with the character at codepoint X.

pY

Repeat that Y times.

iYç

To that prepend a space character repeated Y times.

Implicit output of resulting array.

#Japt, 24 23 17 bytes

Outputs an array, includes a leading newline and a leading & trailing space on each line.

IòUc @SiXd)pY)iYç

Test it

  • 1 byte saved with help from Oliver and a further 6 thanks to him pointing out a better way to generate the initial array.

We can get rid of the leading newline and spaces at the cost of 2 bytes:

IòUc)Å£SiXd)pYÄ)iYç

Test it


##Explanation Implicit input of uppercase character string U.

IòUc

Generate an array of integers (ò) from 64 (I) to U's character code, inclusive.

@

Pass each through a function where X is the current integer and Y is the current index.

SiXd)

Prepend (i) a space (S) with the character at codepoint X.

pY

Repeat that Y times.

iYç

To that prepend a space character repeated Y times.

Implicit output of resulting array.

#Japt -R, 24 23 17 15 bytes

Outputs an array, includes a leading newline and a leading & trailing space on each line.

IòUc ÏçSiXd¹iYç

Test it

  • 1 byte saved with help from Oliver and a further 6 thanks to him pointing out a better way to generate the initial array.
deleted 539 characters in body
Source Link
Shaggy
  • 43.5k
  • 4
  • 36
  • 94

#Japt, 24 23 17 bytes

Outputs an array, includes a leading newline and a leading & trailing space on each line.

IòUc @SiXd)pY)iYç

Test it

  • 1 byte saved with help from Oliver and a further 6 thanks to him pointing out a better way to generate the initial array.

We can get rid of the leading newline and spaces at the cost of 2 bytes:

IòUc)Å£SiXd)pYÄ)iYç

Test it


##Explanation Implicit input of uppercase character string U.

IòUc

Generate an array of integers (ò) from 64 (I) to U's character code, inclusive.

@

Pass each through a function where X is the current integer and Y is the current index.

SiXd)

Prepend (i) a space (S) with the character at codepoint X.

pY

Repeat that Y times.

iYç

To that prepend a space character repeated Y times.

Implicit output of resulting array.

#Japt, 24 23 17 bytes

Outputs an array, includes a leading newline and a leading & trailing space on each line.

IòUc @SiXd)pY)iYç

Test it

  • 1 byte saved with help from Oliver and a further 6 thanks to him pointing out a better way to generate the initial array.

We can get rid of the leading newline and spaces at the cost of 2 bytes:

IòUc)Å£SiXd)pYÄ)iYç

Test it

#Japt, 24 23 17 bytes

Outputs an array, includes a leading newline and a leading & trailing space on each line.

IòUc @SiXd)pY)iYç

Test it

  • 1 byte saved with help from Oliver and a further 6 thanks to him pointing out a better way to generate the initial array.

We can get rid of the leading newline and spaces at the cost of 2 bytes:

IòUc)Å£SiXd)pYÄ)iYç

Test it


##Explanation Implicit input of uppercase character string U.

IòUc

Generate an array of integers (ò) from 64 (I) to U's character code, inclusive.

@

Pass each through a function where X is the current integer and Y is the current index.

SiXd)

Prepend (i) a space (S) with the character at codepoint X.

pY

Repeat that Y times.

iYç

To that prepend a space character repeated Y times.

Implicit output of resulting array.

deleted 539 characters in body
Source Link
Shaggy
  • 43.5k
  • 4
  • 36
  • 94
Loading
added 713 characters in body
Source Link
Shaggy
  • 43.5k
  • 4
  • 36
  • 94
Loading
added 50 characters in body
Source Link
Shaggy
  • 43.5k
  • 4
  • 36
  • 94
Loading
Source Link
Shaggy
  • 43.5k
  • 4
  • 36
  • 94
Loading