Skip to main content
link to challenge post
Source Link
bigyihsuan
  • 10.8k
  • 6
  • 8

Print the ends and middle of your code

The challenge is simple: Print the last, middle, and first character of your program's source code, in that order.

The middle character is defined as follows, assuming a source length of n characters, and 1-indexing:

  • If n is even, print the n/2-th and n/2 + 1-th character. (abcdef == cd)
  • If n is odd, print (n-1)/2 + 1-th character. (abcde == c)

Rules

  • Given no input, print the first, middle, and last character in your source code, in the form [end][middle][first]. This will be 3-4 characters long.
  • Output must not contain any trailing whitespace. However, if whitespace is a first, middle, or last character, it must be printed as such.
  • Source code must be n >= 3 characters long. Code must consist of >= 3 distinct characters.
  • Standard loopholes are forbidden.
  • This is , so shortest solution in characters wins.

Samples

# Form: [code] --> [output]
xyz --> zyx
print('p)(') --> )(p
abcd --> dbca
1 --> # not allowed
abcde --> eca
aaabb --> # not allowed
System.out.print("S;pr"); --> ;prS
this is a test --> s tt
123[newline]45 --> 53[newline]1

Tags:Posted here

Print the ends and middle of your code

The challenge is simple: Print the last, middle, and first character of your program's source code, in that order.

The middle character is defined as follows, assuming a source length of n characters, and 1-indexing:

  • If n is even, print the n/2-th and n/2 + 1-th character. (abcdef == cd)
  • If n is odd, print (n-1)/2 + 1-th character. (abcde == c)

Rules

  • Given no input, print the first, middle, and last character in your source code, in the form [end][middle][first]. This will be 3-4 characters long.
  • Output must not contain any trailing whitespace. However, if whitespace is a first, middle, or last character, it must be printed as such.
  • Source code must be n >= 3 characters long. Code must consist of >= 3 distinct characters.
  • Standard loopholes are forbidden.
  • This is , so shortest solution in characters wins.

Samples

# Form: [code] --> [output]
xyz --> zyx
print('p)(') --> )(p
abcd --> dbca
1 --> # not allowed
abcde --> eca
aaabb --> # not allowed
System.out.print("S;pr"); --> ;prS
this is a test --> s tt
123[newline]45 --> 53[newline]1

Tags:

Posted here

added 30 characters in body
Source Link
bigyihsuan
  • 10.8k
  • 6
  • 8

Print the ends and middle of your code

The challenge is simple: Print the last, middle, and first character of your program's source code, in that order.

The middle character is defined as follows, assuming a source length of n characters, and 1-indexing:

  • If n is even, print the n/2-th and n/2 + 1-th character. (abcdef == cd)
  • If n is odd, print (n-1)/2 + 1-th character. (abcde == c)

Rules

  • Given no input, print the first, middle, and last character in your source code, in the form [end][middle][first]. This will be 3-4 characters long.
  • Output must not contain any trailing whitespace. However, if whitespace is a first, middle, or last character, it must be printed as such.
  • Source code must be n >= 3 characters long. Code must consist of >= 3 distinct characters.
  • Standard loopholes are forbidden.
  • This is , so shortest solution in characters wins.

Samples

# Form: [code] --> [output]
xyz --> zyx
print('p)(') --> )(p
abcd --> dbca
1 --> # not allowed
abcde --> eca
aaabb --> # not allowed
System.out.print("S;pr"); --> ;prS
this is a test --> s tt
123[newline]45 --> 53[newline]1

Tags:

Print the ends and middle of your code

The challenge is simple: Print the last, middle, and first character of your program's source code, in that order.

The middle character is defined as follows, assuming a source length of n characters, and 1-indexing:

  • If n is even, print the n/2-th and n/2 + 1-th character. (abcdef == cd)
  • If n is odd, print (n-1)/2 + 1-th character. (abcde == c)

Rules

  • Given no input, print the first, middle, and last character in your source code, in the form [end][middle][first]. This will be 3-4 characters long.
  • Output must not contain any trailing whitespace. However, if whitespace is a first, middle, or last character, it must be printed as such.
  • Source code must be n >= 3 characters long. Code must consist of >= 3 distinct characters.
  • Standard loopholes are forbidden.
  • This is , so shortest solution in characters wins.

Samples

xyz --> zyx
print('p)(') --> )(p
abcd --> dbca
1 --> # not allowed
abcde --> eca
aaabb --> # not allowed
System.out.print("S;pr"); --> ;prS
this is a test --> s tt
123[newline]45 --> 53[newline]1

Tags:

Print the ends and middle of your code

The challenge is simple: Print the last, middle, and first character of your program's source code, in that order.

The middle character is defined as follows, assuming a source length of n characters, and 1-indexing:

  • If n is even, print the n/2-th and n/2 + 1-th character. (abcdef == cd)
  • If n is odd, print (n-1)/2 + 1-th character. (abcde == c)

Rules

  • Given no input, print the first, middle, and last character in your source code, in the form [end][middle][first]. This will be 3-4 characters long.
  • Output must not contain any trailing whitespace. However, if whitespace is a first, middle, or last character, it must be printed as such.
  • Source code must be n >= 3 characters long. Code must consist of >= 3 distinct characters.
  • Standard loopholes are forbidden.
  • This is , so shortest solution in characters wins.

Samples

# Form: [code] --> [output]
xyz --> zyx
print('p)(') --> )(p
abcd --> dbca
1 --> # not allowed
abcde --> eca
aaabb --> # not allowed
System.out.print("S;pr"); --> ;prS
this is a test --> s tt
123[newline]45 --> 53[newline]1

Tags:

3 character example
Source Link
bigyihsuan
  • 10.8k
  • 6
  • 8

Print the ends and middle of your code

The challenge is simple: Print the last, middle, and first character of your program's source code, in that order.

The middle character is defined as follows, assuming a source length of n characters, and 1-indexing:

  • If n is even, print the n/2-th and n/2 + 1-th character. (abcdef == cd)
  • If n is odd, print (n-1)/2 + 1-th character. (abcde == c)

Rules

  • Given no input, print the first, middle, and last character in your source code, in the form [end][middle][first]. This will be 3-4 characters long.
  • Output must not contain any trailing whitespace. However, if whitespace is a first, middle, or last character, it must be printed as such.
  • Source code must be n >= 3 characters long. Code must consist of >= 3 distinct characters.
  • Standard loopholes are forbidden.
  • This is , so shortest solution in characters wins.

Samples

xyz --> zyx
print('p)(') --> )(p
abcd --> dbca
1 --> # not allowed
abcde --> eca
aaabb --> # not allowed
System.out.print("S;pr"); --> ;prS
this is a test --> s tt
123[newline]45 --> 53[newline]1

Tags:

Print the ends and middle of your code

The challenge is simple: Print the last, middle, and first character of your program's source code, in that order.

The middle character is defined as follows, assuming a source length of n characters, and 1-indexing:

  • If n is even, print the n/2-th and n/2 + 1-th character. (abcdef == cd)
  • If n is odd, print (n-1)/2 + 1-th character. (abcde == c)

Rules

  • Given no input, print the first, middle, and last character in your source code, in the form [end][middle][first].
  • Output must not contain any trailing whitespace. However, if whitespace is a first, middle, or last character, it must be printed as such.
  • Source code must be n >= 3 characters long. Code must consist of >= 3 distinct characters.
  • This is , so shortest solution in characters wins.

Samples

print('p)(') --> )(p
abcd --> dbca
1 --> # not allowed
abcde --> eca
aaabb --> # not allowed
System.out.print("S;pr"); --> ;prS
this is a test --> s tt
123[newline]45 --> 53[newline]1

Tags:

Print the ends and middle of your code

The challenge is simple: Print the last, middle, and first character of your program's source code, in that order.

The middle character is defined as follows, assuming a source length of n characters, and 1-indexing:

  • If n is even, print the n/2-th and n/2 + 1-th character. (abcdef == cd)
  • If n is odd, print (n-1)/2 + 1-th character. (abcde == c)

Rules

  • Given no input, print the first, middle, and last character in your source code, in the form [end][middle][first]. This will be 3-4 characters long.
  • Output must not contain any trailing whitespace. However, if whitespace is a first, middle, or last character, it must be printed as such.
  • Source code must be n >= 3 characters long. Code must consist of >= 3 distinct characters.
  • Standard loopholes are forbidden.
  • This is , so shortest solution in characters wins.

Samples

xyz --> zyx
print('p)(') --> )(p
abcd --> dbca
1 --> # not allowed
abcde --> eca
aaabb --> # not allowed
System.out.print("S;pr"); --> ;prS
this is a test --> s tt
123[newline]45 --> 53[newline]1

Tags:

change first example
Source Link
bigyihsuan
  • 10.8k
  • 6
  • 8
Loading
fully reversed output (last, middle, first)
Source Link
bigyihsuan
  • 10.8k
  • 6
  • 8
Loading
added 57 characters in body
Source Link
bigyihsuan
  • 10.8k
  • 6
  • 8
Loading
added 33 characters in body
Source Link
bigyihsuan
  • 10.8k
  • 6
  • 8
Loading
Source Link
bigyihsuan
  • 10.8k
  • 6
  • 8
Loading