60
\$\begingroup\$

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 last, middle, and first character in your source code, in the form [last][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 unique characters.
  • Standard loopholes are forbidden.
  • This is , so shortest solution in characters wins.

Samples

# Form: [code] --> [output]
xyz --> zyx
abcd --> dbca
1 --> # not allowed: too short
abcde --> eca
aaabb --> # not allowed: not enough unique characters
System.out.print("S;pr"); --> ;prS
this is a test --> ts t
123[newline]45 --> 53[newline]1

Challenge Proposal

\$\endgroup\$
  • 6
    \$\begingroup\$ Maybe it's only me, but "Code must consist of >= 3 unique characters." suggests all characters of the program should be unique, while you only require to have at least 3 distinct characters. \$\endgroup\$ – Grzegorz Oledzki Jul 9 at 19:22
  • 4
    \$\begingroup\$ @Belhenix Fewer than three unique characters allows solutions as simple as 121 for a great many languages. \$\endgroup\$ – Khuldraeseth na'Barya Jul 9 at 19:32
  • 2
    \$\begingroup\$ If anyone can find a stack-based language that uses - for negation and implicitly prints with a linefeed, \n1- is a three-byter. My search has so far been fruitless. \$\endgroup\$ – Khuldraeseth na'Barya Jul 9 at 19:35
  • 3
    \$\begingroup\$ @Belhenix Whitespace is certainly possible, it has enough unique valid characters (space, linefeed, tab). \$\endgroup\$ – bigyihsuan Jul 9 at 19:46
  • 2
    \$\begingroup\$ Can't change it now with 58 answers, but requiring "first letter of code must be different from last letter of code" would have ruled out a lot of trivial answers, including the current top answer. That may have been the intent of ">= 3 unique characters", but that requirement isn't actually very hard. \$\endgroup\$ – manassehkatz-Reinstate Monica Jul 10 at 14:10

96 Answers 96

171
\$\begingroup\$

JavaScript, 9 7 bytes

N=>a=-N

Outputs: NaN

Try it online!

\$\endgroup\$
  • 4
    \$\begingroup\$ Very clever. This was the tact I was trying to take, but just couldn't stumble upon a language with curt enough error output. \$\endgroup\$ – ouflak Jul 10 at 6:33
  • 49
    \$\begingroup\$ This is one of the best Javascript answers I've ever seen here \$\endgroup\$ – Daniel Jul 10 at 7:42
21
\$\begingroup\$

Grass, 17 bytes

wWWwwwVVwWWwWWWww

Try it online!

-2 bytes thanks to jimmy23013.

Outputs www. Grass ignores all characters apart from w, W and v. The two Vs are thus ignored; they are there to ensure the middle character is a w – I have no idea how to output v or W in Grass… I could have used another character instead of V, but V preserves the aesthetic of the code.

\$\endgroup\$
  • 1
    \$\begingroup\$ "Luckily, the middle character ended up being a w and not a v or a W – I have no idea how to output v or W in Grass…" Lol. xD I tried to do something similar in Whitespace having also only three characters (space, tab, newline), but unfortunately I wasn't so lucky.. Luckily I can simply add a bunch of trailing no-ops to fix it, though. \$\endgroup\$ – Kevin Cruijssen Jul 9 at 14:56
  • \$\begingroup\$ @KevinCruijssen If the middle character had been anything else, I would probably have added in the middle a bunch of xs (or any other non-Grass character, which Grass ignores) to move a w into the correct place. \$\endgroup\$ – Robin Ryder Jul 9 at 16:51
  • \$\begingroup\$ Ah, I'm an idiot.. I can insert a non-whitespace character as well which Whitespace will ignore. ;) -2 bytes thanks to you. \$\endgroup\$ – Kevin Cruijssen Jul 9 at 17:03
  • 1
    \$\begingroup\$ 17 bytes: wWWwww  wWWwWWWww \$\endgroup\$ – jimmy23013 Jul 10 at 7:05
  • \$\begingroup\$ @jimmy23013 Thanks! And thanks for posting your tip; I needed it to understand what you did! I changed the spaces to Vs because I find it prettier. ;-) \$\endgroup\$ – Robin Ryder Jul 10 at 8:29
17
\$\begingroup\$

brainfuck, 17 bytes

U-[>+<-UU--]>...U

Try it online!

With unprintables this can be reduced to 7 bytes: ␀..␀_.␀

\$\endgroup\$
  • 1
    \$\begingroup\$ Within the rules, but BF doesn't use U as an instruction. Functionally,the code is -[>+<---]>., so the expected output would be .--, which it does not output. \$\endgroup\$ – bigyihsuan Jul 9 at 15:20
  • 16
    \$\begingroup\$ @bigyihsuan but the source code still contains the Us and this interpreter happily ignores them. Should every answer which has comments or multiple spaces (or anything else that doesn't necessarily matter to the language) be not counted? \$\endgroup\$ – dzaima Jul 9 at 15:25
  • 1
    \$\begingroup\$ Shouldn't it be U-[>+<-UU--]>...U? In its current form the code only shows one U \$\endgroup\$ – Helena Jul 9 at 17:32
  • 1
    \$\begingroup\$ @Flater Yes, here they're used to make the challenge easier, but isn't that the whole purpose of the code-golf tag? Many answers here alone make their job easier by adding leading/trailing whitespace, and in general in code-golf here anything following the rules is allowed (and if I had to guess, if there was a rule disallowing unused characters (defining which objectively would already be pretty much impossible) would mean that the challenge might be still hovering at 0 score, and probably be closed as well). \$\endgroup\$ – dzaima Jul 11 at 14:05
  • 2
    \$\begingroup\$ Why don't you simply use ÿ-.ÿ..ÿ? That's printable and short. \$\endgroup\$ – Dorian Jul 25 at 8:09
17
\$\begingroup\$

Shakespeare Programming Language, 119 bytes

 ,.Ajax,.Page,.Act I:.Scene I:.[Enter Ajax and Page]
Ajax:  You big big big big big cat.Speak thy.Speak thy.Speak thy. 

Try it online!

Prints three spaces. Without printing spaces:

Shakespeare Programming Language, 227 bytes

,.Ajax,.Page,.Act I:.Scene I:.[Enter Ajax and Page]Ajax:You is the sum of a big big big big big big cat a big pig.
You is the sum of you a large huge large big pig.
Speak thy.Speak thy.You is the sum of you a big pig.Speak thy.

Try it online!

Like my newline-free INTERCAL answer, this is constructed to make the last character of the program the same as the middle character (although in this case it is not also the first), by un-golfing the second half of the code until they match. (I'm not sure if I could have constructed 46 in fewer bytes or not, or if I could have golfed other parts of the first half more.)

\$\endgroup\$
  • 2
    \$\begingroup\$ I wasn't expecting Shakespeare to show up for this. This is great \$\endgroup\$ – bigyihsuan Jul 10 at 2:34
  • 1
    \$\begingroup\$ Wish I could +1 just for learning this language existed! \$\endgroup\$ – Stilez Jul 10 at 22:15
  • 1
    \$\begingroup\$ even in the online interpreter's debug output messages, the authors' sense of humor shows: Warning at line 2: 'mind' expected \$\endgroup\$ – dlatikay Jul 12 at 12:52
  • 1
    \$\begingroup\$ 163 bytes for the second version by ending with a ! \$\endgroup\$ – Robin Ryder Jul 17 at 10:34
  • 1
    \$\begingroup\$ @UnrelatedString OK, thanks! Done. \$\endgroup\$ – Robin Ryder Jul 17 at 17:36
14
\$\begingroup\$

Python 2, 13 11 bytes


print' t' 

To make the whitespace clear:

$ xxd solution.py
0000000: 0a70 7269 6e74 2720 7427 20           .print' t'
$ python2 solution.py | xxd
0000000: 2074 0a                                t.

Try it online!

-2 bytes, thanks to wastl !

\$\endgroup\$
  • 6
    \$\begingroup\$ Both output trailing whitespace (newline), which is not allowed. Python 2 alternative: Try it online! \$\endgroup\$ – wastl Jul 9 at 13:59
  • \$\begingroup\$ Also, I don't think this is valid: Python requires you to have an empty newline at the end of your code. \$\endgroup\$ – Geza Kerecsenyi Jul 9 at 15:59
  • 5
    \$\begingroup\$ @GezaKerecsenyi As I understand it, a newline at the end of the source code is just a recommendation. See PEP8. \$\endgroup\$ – mypetlion Jul 9 at 16:48
  • 1
    \$\begingroup\$ @GezaKerecsenyi Just a guideline \$\endgroup\$ – mbomb007 Jul 9 at 19:01
  • \$\begingroup\$ @wastl Thanks! Fixed. \$\endgroup\$ – TFeld Jul 9 at 19:15
11
\$\begingroup\$

RProgN 2, 3 bytes

1
0

Try it online!

I think this is valid?

\$\endgroup\$
  • \$\begingroup\$ I'm guessing 1 and 0 are pushed onto a stack, then an implicit pop-print at the end of the program? Yes it's valid \$\endgroup\$ – bigyihsuan Jul 9 at 15:21
  • 2
    \$\begingroup\$ @bigyihsuan that's what I'm guessing too; I don't know the language, I just recall it does stuff like this :p \$\endgroup\$ – dzaima Jul 9 at 15:22
  • \$\begingroup\$ @dzaima Haha, when you post an answer and you don't even know how it works. xD I've indeed seen RProgN a few times before with old [quine] challenges, before the quine-rules got changed. \$\endgroup\$ – Kevin Cruijssen Jul 9 at 15:48
  • \$\begingroup\$ I believe this is polyglot in tac on Linux. \$\endgroup\$ – tsh Jul 10 at 6:38
11
\$\begingroup\$

05AB1E, 7 5 bytes


„ RR

Outputs R \n.

-2 bytes by taking inspiration from @Neil's Batch answer, so make sure to upvote him as well!

Try it online.

5 bytes alternative by @Grimy:


12,1

Outputs 12\n.

Try it online.

Initial 7 bytes answer:

'?„«'«?

Outputs ?«'.

Try it online.

Explanation:

          # No-op newline
„ R       # Push 2-char string " R"
   R      # Reverse this string to "R "
          # (output the result implicitly with trailing newline)

          # No-op newline
12,       # Print 12 with trailing newline
   1      # Push a 1 (no implicit printing, since we already did an explicit print)

'?       '# Push 1-char string "?"
  „«'    '# Push 2-char string "«'"
     «    # Concatenate them both together
      ?   # Output without trailing newline
\$\endgroup\$
8
\$\begingroup\$

PHP, 9 bytes

<?=";;<";

Try it online!

\$\endgroup\$
  • 3
    \$\begingroup\$ Actually, since PHP outputs code as text until the first <? tag, you could use one of the trivial 4-byte solutions like 1231 - anything without a special character as first and last, any other 2 characters in the middle. Your answer may be the shortest real code PHP answer. \$\endgroup\$ – manassehkatz-Reinstate Monica Jul 10 at 14:13
7
\$\begingroup\$

Jelly, 5 bytes

001 0

Try it online!

The output has two distinct characters, but the code also has a third one.

Trivial 4-byte version:

1231
\$\endgroup\$
  • \$\begingroup\$ Isn't 121 also a valid trivial answer? \$\endgroup\$ – Teleporting Goat Jul 10 at 9:51
  • \$\begingroup\$ @TeleportingGoat: No, because it has only two distinct characters \$\endgroup\$ – Oliver Hankeln Jul 10 at 13:28
7
\$\begingroup\$

Excel, 9 bytes

=("))=" )

So many Parentheses.

Note: The returned middle character can actually be any character since it's the middle of the code.

\$\endgroup\$
  • \$\begingroup\$ Parentheses! (Lightbulb) I got stuck with the last character needing to be ". Well done! \$\endgroup\$ – Wernisch Jul 11 at 8:34
  • \$\begingroup\$ Thanks! It was something I was trying to figure out as well, and then I remembered that parentheses would work. \$\endgroup\$ – william porter Jul 12 at 15:08
6
\$\begingroup\$

Ruby, 6 bytes


p " "

Try it online!

This outputs " " plus a newline. The code ends with a ", the middle two characters are and ", and it starts with a newline.

\$\endgroup\$
  • 3
    \$\begingroup\$ I like your badge, I believe it's a grayscale xor on N². I generated almost the same picture to help me for a Project Euler Nim problem. Does your badge have a story? \$\endgroup\$ – Damien Jul 9 at 14:54
  • 1
    \$\begingroup\$ Nice catch! I just like "doodling" during meetings by generating pictures using one-liners; xor was an early favorite. \$\endgroup\$ – histocrat Jul 9 at 15:23
6
\$\begingroup\$

DOS/Windows Batch Language, 9 bytes

@echo @o@
\$\endgroup\$
  • \$\begingroup\$ Welcome to Code Golf & Coding Challenges Stack Exchange, +1 for nice first post! \$\endgroup\$ – A̲̲ Jul 12 at 11:41
5
\$\begingroup\$

Ruby, 11 9 bytes

print:ptp

Try it online!

\$\endgroup\$
5
\$\begingroup\$

Batch, 9 characters


@echo hh

The middle and last character are both h, and then the echo prints a newline by default, which is the first character of the script.

\$\endgroup\$
5
\$\begingroup\$

PowerShell, 3 bytes

00000000: 0a0d 31                                  ..1

Works only in Microsoft Windows.

The output is unfortunately 8 bytes in UTF-16. But the question says output the characters, and not the bytes. Arguably UTF-16 is just one of the supported ways to represent the characters in PowerShell. They are not interpreted differently from an ASCII file.

\$\endgroup\$
  • \$\begingroup\$ it's smart answer \$\endgroup\$ – mazzy Jul 10 at 6:48
  • 1
    \$\begingroup\$ allowed because 0x0a != 0x0d != 0x31 :) \$\endgroup\$ – bigyihsuan Jul 10 at 12:55
5
\$\begingroup\$

Bash (15 11 characters)

echo -n e-e

which prints out

e-e
  • -4 chars by not using |rev
\$\endgroup\$
  • 1
    \$\begingroup\$ @racraman Your suggested edit of echo<space>e<space><space>e will output e<space>e<newline> instead of e<space>e, so I've rejected it. The newline is part of the output, which is why GrzegorzOledzki is using the -n option. Try echo -n e-e online vs Try echo e e online. And again, please don't edit other peoples answer. If you have a golf to suggest, leave a comment. \$\endgroup\$ – Kevin Cruijssen Jul 11 at 10:22
  • \$\begingroup\$ also 11 bytes with printf pfp, but only because we need two spaces due to that definition of middle character, otherwise it would be 10 ... \$\endgroup\$ – pLumo Jul 11 at 11:21
5
\$\begingroup\$

ArnoldC, 61 bytes

IT'S SHOWTIME
TALK TO THE HAND "D I"
YOU HAVE BEEN TERMINATED

Try it online!

Trivial answer in ArnoldC. The 31st byte is the space just before the string literal.

\$\endgroup\$
5
\$\begingroup\$

Underload, 9 bytes 7 bytes

Thanks to Khuldraeseth na'Barya for the improved solution!

W(SSW)S

As for as I can tell, this is now unimprovable since:

  • The first character has to be a no-op character, since every other instruction raises an error due to the stack being empty, with the exception being an opening bracket. However, it can't be that since there is no way to output an opening bracket on it's own in Underload.
  • You need to use at least 5 characters to add the 3 output characters to the stack.
  • You need to use S to output it.

Try it online!

\$\endgroup\$
  • \$\begingroup\$ Welcome to Code Golf SE! You can save a couple bytes by skipping the copy, like so. \$\endgroup\$ – Khuldraeseth na'Barya Jul 10 at 21:47
5
\$\begingroup\$

Shakespeare Programming Language, 163 153 bytes

-10 bytes thanks to Jo King.

B,.Ajax,.Page,.Act I:.Scene I:.[Enter Ajax and Page]Ajax:You is
the sum ofa Big Big Big BIG BIG cat a
CAT.Speak thy.You is twice you.Speak thy!SPEAK THY!

Try it online!

My first SPL answer! Outputs !BB.

There is another SPL answer by Unrelated String; in that answer, they output only spaces in 119 bytes, or output non-space characters in 227 bytes. This one comes in between, and also outputs non-space characters.

Two tricks are used here:

  1. An SPL sentence can end with ! rather than ., and ! is easier to get since its ASCII codepoint is 33 (=\$2^5+1\$), whereas the codepoint of . is 46.
  2. Doubling 33 gives 66, the codepoint of B, hence the play title is B and I need the second "big" to be "Big", which works since SPL is case-insensitive.

Since I needed that capital B and an exclamation mark at the end, I decided to have Ajax shout louder and louder through the scene.

\$\endgroup\$
4
\$\begingroup\$

CJam, 7 bytes

'@'' _@

Try it online!

\$\endgroup\$
  • 4
    \$\begingroup\$ Pretty sure 0 1 0 is shorter and also has three distinct characters (I don't want to repost my Jelly approach :P). \$\endgroup\$ – Erik the Outgolfer Jul 9 at 14:19
  • 1
    \$\begingroup\$ @EriktheOutgolfer Well though!. But that's just like your answerm so I'll leave this as is \$\endgroup\$ – Luis Mendo Jul 9 at 14:20
  • 2
    \$\begingroup\$ Yeah, that's why I commented, didn't really want to post the same thing twice. (Hm... this might be the optimal solution for many languages.) Anyway, yours might be applicable elsewhere too! \$\endgroup\$ – Erik the Outgolfer Jul 9 at 14:24
4
\$\begingroup\$

Befunge-93, 7 bytes

.",  @0

Try it online!

Explanation

Output is 0 .

.       pop value (0) from stack, output as number with a trailing space
 "      toggle string mode, wraps around and pushes every char to the stack
  ,     pop value (".") from stack, output as character 
        spaces are no-ops
     @  end the program
      0 trailing 0 to match the output
\$\endgroup\$
4
\$\begingroup\$

APL (Dyalog Unicode), 5 4 bytes

Full programs.

Boring solution from J.Sallé:

1231

Prints that number. A much more interesting solution:

010E1

Try it online!

APL ignores leading zeros, so this is simply scaled format for 10×10¹=100.

\$\endgroup\$
4
\$\begingroup\$

Chef, 447 bytes

Last Middle First Milkshake.

This recipe prints its last, middle and first character.
You could also use it to make a milkshake. 

Ingredients.
76 ml milk
32 ml chocolate syrup
46 teaspoons vanilla ice cream

Method.
Liquefy vanilla ice cream.
Put the milk into 1st mixing bowl.
Put the chocolate syrup into 1st mixing bowl.
Put the vanilla ice cream into 1st mixing bowl.
Pour contents of the 1st mixing bowl into the 1st baking dish.

Serves 1.

Try it online!

A serious submission, 196 177 bytes

thanks to A__

R.

Ingredients.
82 l a
103 l b
46 l c

Method.
Put a into mixing bowl.
Put b into mixing bowl.
Put c into mixing bowl.
Pour contents of mixing bowl into baking dish.

Serves 1.

Try it online!

\$\endgroup\$
  • \$\begingroup\$ Seeing Chef programs makes me wonder what is the bare minimum for it. \$\endgroup\$ – bigyihsuan Jul 11 at 13:35
  • \$\begingroup\$ @bigyihsuan see my edit \$\endgroup\$ – user24343 Jul 12 at 15:45
  • \$\begingroup\$ You can remove all the "the"'s and make the program still work. \$\endgroup\$ – A̲̲ Jul 13 at 4:15
  • \$\begingroup\$ I created a working program. (177 bytes) \$\endgroup\$ – A̲̲ Jul 13 at 4:27
4
\$\begingroup\$

Python 3, 19 bytes 13 bytes


print( ')(')

The print function appends a newline by default so the code starts with a newline. The last character of the code is a ")" so that's printed first. To make the number of characters uneven, a space in inserted before the argument of the print function. Please excuse the salaciousness of the code.

Outputs: )(\n

Try it online.

\$\endgroup\$
  • 1
    \$\begingroup\$ Depending on how the rules work I might have 13 bytes playing with your answer: ` print(")(" )` Note there is a new line above print and a whitespace inside print after ")(". Outputs: )( with a new line at the end. \$\endgroup\$ – Hoog Jul 10 at 12:38
  • \$\begingroup\$ Thanks, down to 13 bytes! As the question specifically refers to whitespaces but not newlines I'll assume trailing newlines, as the default end parameter of the print function, don't count. \$\endgroup\$ – jaaq Jul 10 at 12:50
  • \$\begingroup\$ This prints a trailing newline but doesn't account for it. \$\endgroup\$ – A̲̲ Jul 15 at 13:40
  • \$\begingroup\$ Not sure if newlines count as whitespaces but I added the 2nd also 13-byte version. \$\endgroup\$ – jaaq Jul 16 at 9:53
  • 1
    \$\begingroup\$ Yes, newlines count as whitespace, just like tabs and spaces among others \$\endgroup\$ – Jo King Jul 16 at 11:47
4
\$\begingroup\$

Whitespace, 31 29 bytes

[S aS S T   S S S S S N
_Push_32][S N
S _Duplicate_32][S N
S _Duplicate_32][T  N
S S _Print_as_character][T  N
S S _Print_as_character][T  N
S S _Print_as_character]

-2 bytes thanks to @RobinRyder.

Letters S (space), T (tab), and N (new-line) added as highlighting only.
[..._some_action] added as explanation only.

Try it online (with raw spaces, tabs, and new-lines only).

Contains a no-op a (can be any non-whitespace character) to make the length odd. It is added before the first halve of the program so the middle character is a space as well, since the middle character would have become a newline if it was at the second halve of the program. All non-whitespace characters are ignored in Whitespace programs.

\$\endgroup\$
3
\$\begingroup\$

Haskell, 17 bytes

main=putStr"\"Sm"

Try it online!

\$\endgroup\$
3
\$\begingroup\$

MathGolf, 5 4 bytes

1231

-1 byte by using the trivial solution presented by @ErikTheOutgolfer in his Jelly answer, which works for any language with implicit output without trailing newline.

Try it online.

Original 5 bytes answer:

ùù xx

Outputs x ù.

Try it online.

Explanation:

ùù x   # Push 3-char string "ù x"
    x  # Reverse it to "x ù"
       # (output the entire string joined together implicitly without trailing newline)
\$\endgroup\$
3
\$\begingroup\$

Brain-Flak, 11 bytes

(((())))

Try it online!

Explanation

We need to put 3 things on the stack. The fastest way to do that is to put 3 1s (or zeros) on the stack. Now since  (code point 1) does nothing in Brain-Flak we can add these to the program at the first middle and last places. Now this feels a bit cheaty so here are two more answers that are less cheaty in my opinion.

Prints braces, 31 bytes

( (((((()()()()()){}){}){}))())

Try it online!

This answer prints braces so that the characters printed are actually relevant to the code, it does have one padding character to make the length odd so we only have to print 1 middle character.

Contains only braces, 32 bytes

(((()((((()(()()){}){}){}){}))))

Try it online!

This is a braces only program both the source and (consequently) the output are made up entirely of braces (character Brain-Flak actually cares about).

\$\endgroup\$
3
\$\begingroup\$

AsciiDots - 9 bytes

.---$'.$.

Output: .$.

The code starts with a ., ends with a ., and the middle character is a $. The single quote in the middle sets the dot print mode to simply read characters straight into the output stream.

It is possible that this could be made smaller, but I'm starting to doubt that it can. In order to print three characters, the single quote must be used, as the double quote would require an end to the string in order to output. However, this means that the single quote has to a) be followed by three characters and b) cannot be the center character. In order to crunch this down to seven bytes, I was considering trying to reuse the dot's start as one of the printed characters (sort of like AsciiDot's quine program). However, I found that the shortest sequence available for printing was ($' which would have had to print four characters in the space of three, or three characters in the space of four. I also tried some hacky alternative methods like trying to print the dot's value (which is 0) as one of the characters. While there may be some system that works, I've found these to be rather complex and large. Thus, I think that the above is the smallest solution. (I will update if I find something smaller)

\$\endgroup\$
  • \$\begingroup\$ Welcome to Code Golf SE! I messed around with this for a few minutes and came to the same conclusion you did. Nice first post! \$\endgroup\$ – Khuldraeseth na'Barya Jul 11 at 18:23
  • 1
    \$\begingroup\$ Alternative 9 bytes - /'$'-.[newline]\.Try it online! \$\endgroup\$ – Alion Jul 13 at 14:34
3
\$\begingroup\$

MATLAB, 1315 bytes

disp(  ') d')

Outputs ) d

Previous version (15 bytes, less strict output):

'''';1;''''''''

Outputs '''

\$\endgroup\$
  • \$\begingroup\$ I see now, now worries. \$\endgroup\$ – Wheat Wizard Jul 11 at 0:40
  • \$\begingroup\$ Doesn't this output trailing whitespace? \$\endgroup\$ – Sanchises Jul 14 at 12:13
  • \$\begingroup\$ @Sanchises nope, size(ans)==3 \$\endgroup\$ – aaaaa says reinstate Monica Jul 14 at 16:03
  • \$\begingroup\$ Yes, but the actual output is ans =\n '''\n. Usually that's not a problem but this challenge seems to set a stricter standard. But then I may be interpreting the challenge wrong. \$\endgroup\$ – Sanchises Jul 14 at 17:36
  • \$\begingroup\$ @Sanchises hm, i see. i might misunderstand what codegolf considers "output" then, your output seems to be literally the output, formatted by MATLAB \$\endgroup\$ – aaaaa says reinstate Monica Jul 14 at 18:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.