# Question
Title: Script that outputs a script that prints a given input
Write a piece of code that takes a string as input, and outputs a piece of code in the **same language** that, when run, will output the initial input string.

It must be able to handle any combination of characters A-Z, a-z, and 0-9.

Example in Python:

```
import sys
print "print('" + sys.argv[1]  + "')"

```

Given the input of `testing123`, it will return `print('testing123')`.

Since this is , the shortest answer in bytes will win.

# Answer
> 31 votes
# pl, 0 bytes

### Code:

Try it online!

### Explanation:

An empty program in pl is simply a cat program, outputting the exact same as the input.

In pl, all ASCII characters are essentially variables, but when the variable doesn't exist (yet), pl assumes that they are part of a string.

# Answer
> 17 votes
# brainfuck, ~~56~~ ~~55~~ 33 bytes

*1 byte saved thanks to Gravitron, and 22 bytes saved thanks to Jo King!*

```
--[>+<++++++],[[->.<]>+++.--.-<,]

```

Try it online!

Output requires an interpreter that wraps on memory underflow and has EOI=0. TIO has such an interpreter.

## Explanation

`--[>+<++++++]` initializes the tape with a single `+`.

The input loop:

```
,[[->.<]>+++.--.-<,]
,                     take input
 [                ,]  while input is nonzero:
  [->.<]                  output `+` input times
        >+++.             output `.` (`+` + 3)
             --.          output `,` (`.` - 2)
                -<        restore `+` and move back to input

```

## Other solutions

Each line is its own solution.

```
+++[>+++++<-]>[>++++>+++<<-]>>-->,[[-<.>]<+++.---<.>>,]
--[>+<++++++],[[->.<]>+++.++++++++++++++++.-------------------<,]
++++++++++[>++++++>++++>++++<<<-]>>+++>++++++>,[[-<<.>>]<.<<.>>>,]
++++++++++[>++++++>++++>++++<<<-]>++>+++>++++++>,[[-<<.>>]<.<<.>>>,]

```

# Answer
> 16 votes
# Mornington Crescent, 27640 bytes

```
Take Northern Line to Moorgate
Take Circle Line to Moorgate
Take Circle Line to Westminster
Take Circle Line to Hammersmith
Take Circle Line to Aldgate
Take Circle Line to Bank
Take Circle Line to Barbican
Take Circle Line to Victoria
Take Circle Line to Victoria
Take Victoria Line to Seven Sisters
Take Victoria Line to Victoria
Take Circle Line to Victoria
Take Circle Line to Bank
Take Circle Line to Hammersmith
Take District Line to Upminster
Take District Line to Bayswater
Take District Line to Barons Court
Take District Line to Gunnersbury
Take District Line to Hammersmith
Take District Line to Gunnersbury
Take District Line to Mile End
Take District Line to Cannon Street
Take Circle Line to Moorgate
Take Circle Line to Hammersmith
Take Circle Line to Cannon Street
Take Circle Line to Hammersmith
Take Circle Line to Cannon Street
Take Circle Line to Bank
Take Circle Line to Hammersmith
Take District Line to Mile End
Take District Line to Barking
Take District Line to Hammersmith
Take District Line to Upminster
Take District Line to Upminster
Take District Line to Upminster
Take District Line to Hammersmith
Take District Line to Upminster
Take District Line to Bank
Take Circle Line to Bank
Take Northern Line to Charing Cross
Take Northern Line to Charing Cross
Take Bakerloo Line to Paddington
Take Circle Line to Royal Oak
Take Circle Line to Tower Hill
Take District Line to Gunnersbury
Take District Line to Hammersmith
Take District Line to Gunnersbury
Take District Line to Paddington
Take Circle Line to Paddington
Take Circle Line to Hammersmith
Take District Line to Upminster
Take District Line to Upminster
Take District Line to Mile End
Take District Line to Hammersmith
Take District Line to Upminster
Take District Line to Upminster
Take District Line to Gunnersbury
Take District Line to Bank
Take Circle Line to Baker Street
Take Circle Line to Bank
Take Circle Line to Hammersmith
Take District Line to Gunnersbury
Take District Line to Mile End
Take District Line to Paddington
Take Circle Line to Paddington
Take Circle Line to Bank
Take Circle Line to Baker Street
Take Circle Line to Bank
Take Circle Line to Bank
Take District Line to Barking
Take District Line to Bank
Take Circle Line to Hammersmith
Take Circle Line to Paddington
Take Circle Line to Liverpool Street
Take Circle Line to Bank
Take District Line to Barking
Take District Line to Bank
Take District Line to Gunnersbury
Take District Line to Upminster
Take District Line to East Ham
Take District Line to Hammersmith
Take District Line to Upminster
Take District Line to Hammersmith
Take District Line to Upminster
Take District Line to Gunnersbury
Take District Line to Paddington
Take Circle Line to Paddington
Take Circle Line to Sloane Square
Take District Line to Gunnersbury
Take District Line to Hammersmith
Take Circle Line to Cannon Street
Take District Line to Gunnersbury
Take District Line to Mile End
Take District Line to East Ham
Take District Line to Mile End
Take District Line to Paddington
Take Circle Line to Paddington
Take Circle Line to Hammersmith
Take District Line to Upminster
Take District Line to Gunnersbury
Take District Line to Plaistow
Take District Line to Mile End
Take District Line to Gunnersbury
Take District Line to Paddington
Take Circle Line to Paddington
Take District Line to Barking
Take District Line to Bank
Take District Line to Barking
Take District Line to Hammersmith
Take Circle Line to Paddington
Take Circle Line to Wood Lane
Take Circle Line to Liverpool Street
Take Circle Line to Bank
Take Circle Line to Liverpool Street
Take Circle Line to Hammersmith
Take Circle Line to Paddington
Take District Line to Barking
Take District Line to Bank
Take District Line to Barking
Take District Line to Hammersmith
Take District Line to Gunnersbury
Take District Line to Dagenham East
Take District Line to Gunnersbury
Take District Line to Paddington
Take Circle Line to Paddington
Take Circle Line to Hammersmith
Take District Line to Upminster
Take District Line to Upminster
Take District Line to Gunnersbury
Take District Line to Hammersmith
Take District Line to Upminster
Take District Line to Upminster
Take District Line to Upminster
Take District Line to Hammersmith
Take District Line to Upminster
Take District Line to Mile End
Take District Line to Gunnersbury
Take District Line to Paddington
Take Circle Line to Paddington
Take Circle Line to Hammersmith
Take District Line to Upminster
Take District Line to Gunnersbury
Take District Line to Hammersmith
Take District Line to Upminster
Take District Line to Upminster
Take District Line to Mile End
Take District Line to Victoria
Take Circle Line to Bank
Take Circle Line to Victoria
Take Circle Line to Hammersmith
Take District Line to Mile End
Take District Line to Gunnersbury
Take District Line to Paddington
Take Circle Line to Paddington
Take Circle Line to Hammersmith
Take District Line to Gunnersbury
Take District Line to Upminster
Take District Line to Mile End
Take Central Line to Bank
Take Circle Line to Victoria
Take Circle Line to Bank
Take Circle Line to Hammersmith
Take District Line to Upminster
Take District Line to Hammersmith
Take District Line to Upminster
Take District Line to Upminster
Take District Line to Upminster
Take District Line to Hammersmith
Take District Line to Upminster
Take District Line to Gunnersbury
Take District Line to Mile End
Take District Line to Paddington
Take Circle Line to Paddington
Take Circle Line to Bank
Take Circle Line to Wood Lane
Take Circle Line to Bank
Take Circle Line to Hammersmith
Take Circle Line to Paddington
Take District Line to Elm Park
Take District Line to Bank
Take Circle Line to Wood Lane
Take Circle Line to Bank
Take Circle Line to Bank
Take District Line to Barking
Take District Line to Bank
Take Circle Line to Hammersmith
Take Circle Line to Paddington
Take Circle Line to Bank
Take District Line to Barking
Take District Line to Bank
Take Circle Line to Hammersmith
Take District Line to Gunnersbury
Take District Line to Upminster
Take District Line to Gunnersbury
Take District Line to Bank
Take Central Line to Northolt
Take Central Line to Bank
Take Circle Line to Bank
Take District Line to Gunnersbury
Take District Line to Paddington
Take Circle Line to Paddington
Take Circle Line to Hammersmith
Take District Line to Upminster
Take District Line to Hammersmith
Take District Line to Upminster
Take District Line to Mile End
Take District Line to Barons Court
Take District Line to Mile End
Take District Line to Paddington
Take Circle Line to Paddington
Take District Line to Upminster
Take District Line to Mile End
Take District Line to Wimbledon
Take District Line to Mile End
Take District Line to Paddington
Take Circle Line to Paddington
Take Circle Line to Bank
Take Circle Line to Wood Lane
Take Circle Line to Bank
Take Circle Line to Hammersmith
Take Circle Line to Paddington
Take Circle Line to Tower Hill
Take Circle Line to Bank
Take Circle Line to Wood Lane
Take Circle Line to Bank
Take Circle Line to Bank
Take District Line to Barking
Take District Line to Bank
Take Circle Line to Hammersmith
Take Circle Line to Paddington
Take Circle Line to Bank
Take District Line to Barking
Take District Line to Bank
Take Circle Line to Hammersmith
Take District Line to Upminster
Take District Line to Hammersmith
Take District Line to Upminster
Take District Line to Upminster
Take District Line to Upminster
Take District Line to Hammersmith
Take District Line to Upminster
Take District Line to Bank
Take Circle Line to Hammersmith
Take District Line to Gunnersbury
Take District Line to Hammersmith
Take District Line to Mile End
Take District Line to Upminster
Take District Line to Bank
Take Circle Line to Baker Street
Take Circle Line to Bank
Take Circle Line to Bank
Take District Line to Gunnersbury
Take District Line to Paddington
Take Circle Line to Paddington
Take Bakerloo Line to Waterloo
Take Northern Line to Bank
Take Circle Line to Bank
Take Central Line to Mile End
Take District Line to Paddington
Take Circle Line to Paddington
Take Circle Line to Bank
Take Circle Line to Wood Lane
Take Circle Line to Bank
Take Circle Line to Hammersmith
Take Circle Line to Paddington
Take Circle Line to Blackfriars
Take Circle Line to Bank
Take Circle Line to Wood Lane
Take Circle Line to Bank
Take District Line to Barking
Take District Line to Paddington
Take Circle Line to Bank
Take Circle Line to Victoria
Take Circle Line to Bank
Take Circle Line to Hammersmith
Take Circle Line to Paddington
Take Circle Line to Paddington
Take Circle Line to Bank
Take Circle Line to Victoria
Take Circle Line to Wood Lane
Take Circle Line to Paddington
Take Circle Line to Bank
Take Circle Line to Hammersmith
Take Circle Line to Wood Lane
Take Circle Line to Bank
Take Circle Line to Paddington
Take Circle Line to Victoria
Take Circle Line to Victoria
Take Victoria Line to Euston
Take Victoria Line to Victoria
Take Circle Line to Victoria
Take Circle Line to Paddington
Take Circle Line to Bank
Take Circle Line to Hammersmith
Take Circle Line to Paddington
Take Circle Line to Hammersmith
Take Circle Line to Paddington
Take Circle Line to Wood Lane
Take Circle Line to Paddington
Take Circle Line to Bank
Take Central Line to Northolt
Take Central Line to Bank
Take District Line to Southfields
Take District Line to Gunnersbury
Take District Line to Hammersmith
Take District Line to Gunnersbury
Take District Line to Paddington
Take Circle Line to Paddington
Take District Line to Upminster
Take District Line to Gunnersbury
Take District Line to Paddington
Take Circle Line to Paddington
Take Circle Line to Baker Street
Take Circle Line to Bank
Take Circle Line to Bank
Take District Line to Upminster
Take District Line to Ravenscourt Park
Take District Line to Gunnersbury
Take District Line to Hammersmith
Take District Line to Upminster
Take District Line to Gunnersbury
Take District Line to Mile End
Take District Line to Hammersmith
Take District Line to Upminster
Take District Line to Hammersmith
Take District Line to Upminster
Take District Line to Upminster
Take District Line to Mile End
Take District Line to Paddington
Take Circle Line to Paddington
Take District Line to Upminster
Take District Line to Mile End
Take Central Line to Bank
Take Circle Line to Bank
Take Northern Line to Old Street
Take Northern Line to Bank
Take Circle Line to Bank
Take District Line to Gunnersbury
Take District Line to Mile End
Take District Line to Paddington
Take Circle Line to Paddington
Take District Line to Mile End
Take Central Line to Theydon Bois
Take Central Line to Mile End
Take District Line to Hammersmith
Take District Line to Upminster
Take District Line to Hammersmith
Take District Line to Upminster
Take District Line to Mile End
Take District Line to Paddington
Take Circle Line to Paddington
Take Circle Line to Bank
Take Circle Line to Bank
Take Northern Line to Old Street
Take Northern Line to Bank
Take Circle Line to Bank
Take District Line to Upminster
Take District Line to Hammersmith
Take District Line to Upminster
Take District Line to Mile End
Take District Line to Acton Town
Take Piccadilly Line to Cockfosters
Take Piccadilly Line to Acton Town
Take District Line to Acton Town
Take District Line to Mile End
Take District Line to Paddington
Take Circle Line to Paddington
Take Circle Line to Wood Lane
Take Circle Line to Paddington
Take Circle Line to Wood Lane
Take Circle Line to Bank
Take District Line to Elm Park
Take District Line to Bank
Take Circle Line to Hammersmith
Take Circle Line to Paddington
Take Circle Line to Bayswater
Take Circle Line to Paddington
Take Circle Line to Bayswater
Take Circle Line to Hammersmith
Take Circle Line to Paddington
Take Circle Line to Bank
Take Circle Line to Aldgate
Take Circle Line to Bank
Take Circle Line to Hammersmith
Take Circle Line to Paddington
Take Circle Line to Bayswater
Take Circle Line to Bank
Take Circle Line to Aldgate
Take Circle Line to Bank
Take Circle Line to Bank
Take District Line to Barking
Take District Line to Hammersmith
Take Circle Line to Paddington
Take Circle Line to Bayswater
Take Circle Line to Paddington
Take Circle Line to Paddington
Take Circle Line to Hammersmith
Take Circle Line to Paddington
Take Circle Line to Bayswater
Take District Line to Barking
Take District Line to Bank
Take Circle Line to Hammersmith
Take Circle Line to Paddington
Take Circle Line to Bank
Take Circle Line to Barbican
Take Circle Line to Bank
Take Circle Line to Hammersmith
Take Circle Line to Paddington
Take Circle Line to Bank
Take Circle Line to Barbican
Take Circle Line to Bank
Take Circle Line to Bank
Take District Line to East Ham
Take District Line to Hammersmith
Take Circle Line to Paddington
Take Circle Line to Hammersmith
Take Circle Line to Paddington
Take District Line to Elm Park
Take District Line to Bank
Take Central Line to Chancery Lane
Take Central Line to Bank
Take Circle Line to Bank
Take District Line to Gunnersbury
Take District Line to Hammersmith
Take District Line to Upminster
Take District Line to Upminster
Take District Line to Gunnersbury
Take District Line to Paddington
Take Circle Line to Hammersmith
Take District Line to Upminster
Take District Line to Gunnersbury
Take District Line to Upminster
Take District Line to Gunnersbury
Take District Line to Bank
Take District Line to Plaistow
Take District Line to Bank
Take Circle Line to Hammersmith
Take District Line to Mile End
Take Central Line to Bank
Take Circle Line to Bank
Take Circle Line to Farringdon
Take Circle Line to Bank
Take Circle Line to Bank
Take Central Line to Mile End
Take District Line to Gunnersbury
Take District Line to Paddington
Take Circle Line to Paddington
Take Circle Line to Bank
Take Circle Line to Bank
Take Northern Line to Brent Cross
Take Northern Line to Bank
Take Circle Line to Bank
Take Central Line to Mile End
Take District Line to Hammersmith
Take District Line to Upminster
Take District Line to Hammersmith
Take District Line to Upminster
Take District Line to Upminster
Take District Line to Hammersmith
Take Circle Line to Notting Hill Gate
Take Circle Line to Notting Hill Gate
Take District Line to Upminster
Take District Line to Mile End
Take District Line to Paddington
Take Circle Line to Farringdon
Take Circle Line to Bank
Take Circle Line to Tower Hill
Take Circle Line to Bank
Take Circle Line to Hammersmith
Take Circle Line to Paddington
Take Circle Line to Bank
Take Circle Line to Farringdon
Take Circle Line to Bank
Take Circle Line to Hammersmith
Take Circle Line to Paddington
Take Circle Line to Bank
Take Circle Line to Farringdon
Take Circle Line to Bank
Take Circle Line to Bank
Take District Line to Southfields
Take District Line to Hammersmith
Take Circle Line to Paddington
Take Circle Line to Hammersmith
Take Circle Line to Paddington
Take District Line to Elm Park
Take District Line to Bank
Take Circle Line to Hammersmith
Take Circle Line to Paddington
Take Circle Line to Bank
Take District Line to Elm Park
Take District Line to Paddington
Take Circle Line to Blackfriars
Take Circle Line to Bank
Take Circle Line to Hammersmith
Take Circle Line to Paddington
Take Circle Line to Bank
Take Circle Line to Royal Oak
Take Circle Line to Bank
Take Circle Line to Hammersmith
Take Circle Line to Paddington
Take Circle Line to Bank
Take District Line to Barons Court
Take District Line to Hammersmith
Take Circle Line to Paddington
Take Circle Line to Hammersmith
Take Circle Line to Paddington
Take Circle Line to Blackfriars
Take Circle Line to Paddington
Take Circle Line to Blackfriars
Take Circle Line to Paddington
Take Circle Line to Paddington
Take Circle Line to Royal Oak
Take Circle Line to Paddington
Take Circle Line to Paddington
Take Circle Line to Farringdon
Take Circle Line to Paddington
Take Circle Line to Paddington
Take District Line to Southfields
Take District Line to Bank
Take Circle Line to Hammersmith
Take Circle Line to Paddington
Take Circle Line to Paddington
Take Circle Line to Embankment
Take Circle Line to Paddington
Take Circle Line to Paddington
Take Circle Line to Bank
Take District Line to East Ham
Take District Line to Bank
Take Circle Line to Hammersmith
Take Circle Line to Paddington
Take Circle Line to Paddington
Take Circle Line to Bank
Take Circle Line to Aldgate
Take Circle Line to Bank
Take Circle Line to Hammersmith
Take Circle Line to Paddington
Take District Line to East Ham
Take District Line to Bank
Take District Line to Barking
Take District Line to Hammersmith
Take Circle Line to Paddington
Take Circle Line to Bank
Take Circle Line to Barbican
Take Circle Line to Bank
Take Circle Line to Hammersmith
Take Circle Line to Paddington
Take Circle Line to Bank
Take District Line to West Ham
Take District Line to Hammersmith
Take Circle Line to Paddington
Take Circle Line to Hammersmith
Take Circle Line to Paddington
Take Circle Line to Paddington
Take Circle Line to Aldgate
Take Circle Line to Bank
Take Circle Line to Hammersmith
Take Circle Line to Paddington
Take Circle Line to Paddington
Take District Line to Barons Court
Take District Line to Paddington
Take Circle Line to Paddington
Take Circle Line to Hammersmith
Take Circle Line to Paddington
Take Circle Line to Paddington
Take Circle Line to Victoria
Take Circle Line to Paddington
Take Circle Line to Paddington
Take Circle Line to Wood Lane
Take Circle Line to Paddington
Take Circle Line to Paddington
Take Circle Line to Aldgate
Take Circle Line to Paddington
Take Circle Line to Aldgate
Take Circle Line to Hammersmith
Take Circle Line to Paddington
Take District Line to Barking
Take District Line to Paddington
Take Circle Line to Bank
Take District Line to Barking
Take District Line to Hammersmith
Take Circle Line to Paddington
Take Circle Line to Bank
Take District Line to Barking
Take District Line to Bank
Take Circle Line to Hammersmith
Take Circle Line to Paddington
Take Circle Line to Paddington
Take Circle Line to Moorgate
Take Circle Line to Paddington
Take Circle Line to Bank
Take Circle Line to Aldgate
Take Circle Line to Paddington
Take Circle Line to Hammersmith
Take Circle Line to Paddington
Take Circle Line to Paddington
Take Circle Line to Hammersmith
Take Circle Line to Paddington
Take Circle Line to Paddington
Take Circle Line to Bank
Take Central Line to Chancery Lane
Take Central Line to Bank
Take Circle Line to Hammersmith
Take Circle Line to Paddington
Take Circle Line to Paddington
Take District Line to Barking
Take District Line to Paddington
Take Circle Line to Westminster
Take Circle Line to Paddington
Take District Line to Plaistow
Take District Line to Bank
Take Circle Line to Moorgate
Take Circle Line to Hammersmith
Take Circle Line to Bank
Take Northern Line to Charing Cross
Take Northern Line to Charing Cross
Take Northern Line to Bank
Take Circle Line to Bank
Take Circle Line to Paddington
Take Circle Line to Westminster
Take Circle Line to Paddington
Take Circle Line to Hammersmith
Take Circle Line to Aldgate
Take Circle Line to Temple
Take Circle Line to Hammersmith
Take District Line to Mile End
Take Central Line to Bank
Take Circle Line to Aldgate
Take Circle Line to Bank
Take Circle Line to Hammersmith
Take District Line to Gunnersbury
Take District Line to Bank
Take Circle Line to Westminster
Take Circle Line to Bank
Take Circle Line to Hammersmith
Take District Line to Gunnersbury
Take District Line to Mile End
Take Central Line to Bank
Take Circle Line to Bank
Take Northern Line to Charing Cross
Take Northern Line to Charing Cross
Take Northern Line to Bank
Take Circle Line to Tower Hill
Take Circle Line to Hammersmith
Take District Line to Upminster
Take District Line to Hammersmith
Take District Line to Upminster
Take District Line to Upminster
Take District Line to Hammersmith
Take Circle Line to Notting Hill Gate
Take Circle Line to Notting Hill Gate
Take District Line to Upminster
Take District Line to Tower Hill
Take Circle Line to Bank
Take Circle Line to Temple
Take Circle Line to Bank
Take Circle Line to Bayswater
Take Circle Line to Bank
Take Circle Line to Hammersmith
Take Circle Line to Paddington
Take Circle Line to Paddington
Take Circle Line to Bank
Take Circle Line to Bayswater
Take Circle Line to Tower Hill
Take Circle Line to Bank
Take Circle Line to Hammersmith
Take District Line to Upminster
Take District Line to Hammersmith
Take District Line to Upminster
Take District Line to Upminster
Take District Line to Hammersmith
Take Circle Line to Notting Hill Gate
Take Circle Line to Notting Hill Gate
Take District Line to Upminster
Take District Line to Bank
Take Circle Line to Hammersmith
Take Circle Line to Embankment
Take Circle Line to Hammersmith
Take Circle Line to Tower Hill
Take Circle Line to Bank
Take Circle Line to Embankment
Take Northern Line to Angel
Take Northern Line to Bank
Take Central Line to Marble Arch
Take Central Line to Bank
Take Circle Line to Bank
Take Circle Line to Westminster
Take District Line to Upminster
Take District Line to Bank
Take Circle Line to Aldgate
Take Circle Line to Bank
Take Circle Line to Hammersmith
Take District Line to Upminster
Take District Line to Bank
Take Circle Line to Aldgate
Take Circle Line to Hammersmith
Take District Line to Gunnersbury
Take District Line to Mile End
Take Central Line to Bank
Take Circle Line to Aldgate
Take Circle Line to Bank
Take Circle Line to Hammersmith
Take District Line to Mile End
Take Central Line to Bank
Take Circle Line to Bank
Take Northern Line to Charing Cross
Take Northern Line to Charing Cross
Take Northern Line to Bank
Take Circle Line to Tower Hill
Take Circle Line to Hammersmith
Take District Line to Upminster
Take District Line to Hammersmith
Take District Line to Upminster
Take District Line to Upminster
Take District Line to Hammersmith
Take Circle Line to Notting Hill Gate
Take Circle Line to Notting Hill Gate
Take District Line to Upminster
Take District Line to Embankment
Take Circle Line to Bank
Take Circle Line to Hammersmith
Take Piccadilly Line to Bounds Green
Take Piccadilly Line to Hammersmith
Take Circle Line to Embankment
Take Circle Line to Bank
Take Circle Line to Hammersmith
Take Circle Line to Cannon Street
Take Circle Line to Hammersmith
Take Circle Line to Cannon Street
Take District Line to Acton Town
Take District Line to Acton Town
Take Piccadilly Line to Bounds Green
Take Piccadilly Line to Holborn
Take Central Line to Holborn
Take Central Line to Bank
Take Circle Line to Hammersmith
Take District Line to West Ham
Take District Line to Bank
Take Circle Line to Aldgate
Take Circle Line to Aldgate
Take Metropolitan Line to Chalfont & Latimer
Take Metropolitan Line to King's Cross St. Pancras
Take Victoria Line to Seven Sisters
Take Victoria Line to Euston
Take Victoria Line to Euston
Take Northern Line to Bank
Take Circle Line to Hammersmith
Take District Line to Upminster
Take District Line to Hammersmith
Take District Line to Upminster
Take District Line to Upminster
Take District Line to Bank
Take Circle Line to Tower Hill
Take Circle Line to Bank
Take Circle Line to Hammersmith
Take District Line to Upminster
Take District Line to Upminster
Take District Line to Upminster
Take District Line to Hammersmith
Take District Line to Upminster
Take District Line to Stepney Green
Take District Line to Hammersmith
Take District Line to Upminster
Take District Line to Hammersmith
Take District Line to Upminster
Take District Line to Upminster
Take District Line to Stepney Green
Take Hammersmith & City Line to Moorgate
Take Circle Line to Moorgate
Take Metropolitan Line to Chalfont & Latimer
Take Metropolitan Line to Moorgate
Take Circle Line to Moorgate
Take Circle Line to Bank
Take Circle Line to Bank
Take District Line to Upminster
Take District Line to Bank
Take Circle Line to Tower Hill
Take Circle Line to Bank
Take Circle Line to Hammersmith
Take District Line to Upminster
Take District Line to Upminster
Take District Line to Upminster
Take District Line to Hammersmith
Take Piccadilly Line to Russell Square
Take Piccadilly Line to Russell Square
Take Piccadilly Line to Acton Town
Take District Line to Acton Town
Take District Line to Bank
Take Circle Line to Hammersmith
Take District Line to Upminster
Take District Line to Upminster
Take District Line to Upminster
Take District Line to Hammersmith
Take District Line to Upminster
Take District Line to Gunnersbury
Take District Line to Bank
Take District Line to East Ham
Take District Line to Bank
Take Circle Line to Hammersmith
Take District Line to Gunnersbury
Take District Line to Paddington
Take Circle Line to Paddington
Take Circle Line to Bank
Take District Line to East Ham
Take District Line to Tower Hill
Take Circle Line to Bank
Take District Line to West Ham
Take District Line to Bank
Take Circle Line to Bank
Take Northern Line to Angel
Take Northern Line to Bank
Take Circle Line to Moorgate
Take Circle Line to Bank
Take Circle Line to Hammersmith
Take Circle Line to Paddington
Take Circle Line to Paddington
Take Circle Line to Bank
Take Circle Line to Paddington
Take Circle Line to Paddington
Take Circle Line to Barbican
Take Circle Line to Paddington
Take Circle Line to Paddington
Take Circle Line to Moorgate
Take Circle Line to Bank
Take Northern Line to Morden
Take Northern Line to Bank
Take Circle Line to Bank
Take District Line to Gunnersbury
Take District Line to Hammersmith
Take District Line to Upminster
Take District Line to Hammersmith
Take District Line to Upminster
Take District Line to Upminster
Take District Line to Gunnersbury
Take District Line to Paddington
Take Circle Line to Paddington
Take Circle Line to Victoria
Take Victoria Line to Seven Sisters
Take Victoria Line to Victoria
Take Circle Line to Victoria
Take District Line to Mile End
Take District Line to Embankment
Take Northern Line to Kennington
Take Northern Line to Bank
Take Circle Line to Bank
Take Central Line to Mile End
Take District Line to Paddington
Take Circle Line to Paddington
Take Circle Line to Liverpool Street
Take Circle Line to Paddington
Take Circle Line to Paddington
Take Circle Line to Aldgate
Take Metropolitan Line to Croxley
Take Metropolitan Line to Aldgate
Take Circle Line to Aldgate
Take Circle Line to Bank
Take Circle Line to Bank
Take District Line to Gunnersbury
Take District Line to Upminster
Take District Line to Gunnersbury
Take District Line to Paddington
Take Circle Line to Paddington
Take Circle Line to Hammersmith
Take District Line to Gunnersbury
Take District Line to Upminster
Take District Line to Hammersmith
Take District Line to Upminster
Take District Line to Gunnersbury
Take District Line to West Brompton
Take District Line to Gunnersbury
Take District Line to Mile End
Take District Line to Acton Town
Take District Line to Mile End
Take District Line to Paddington
Take Circle Line to Paddington
Take Circle Line to Victoria
Take Victoria Line to Seven Sisters
Take Victoria Line to Victoria
Take Circle Line to Victoria
Take District Line to Mile End
Take District Line to Acton Town
Take District Line to Acton Town
Take Piccadilly Line to Hounslow Central
Take Piccadilly Line to Acton Town
Take District Line to Acton Town
Take District Line to Mile End
Take District Line to Gunnersbury
Take District Line to Hammersmith
Take District Line to Upminster
Take District Line to Upminster
Take District Line to Upminster
Take District Line to Hammersmith
Take District Line to Upminster
Take District Line to Gunnersbury
Take District Line to Paddington
Take Circle Line to Bank
Take Circle Line to Bank
Take Northern Line to Mornington Crescent

```

Try it online!

## Explanation

First, a quick refresher on Mornington Crescent:

* each station can either hold a string of arbitrary length or a bigint
* there's also an accumulator which also holds a string or a bigint
* all stations start with their own name as their value
* at the beginning, the accumulator contains your program's input
* each time you go to a station, the station's value and the accumulator are swapped
* some stations are special and override this behavior
* the line you use to get to a station doesn't matter
* you start at Mornington Crescent
* to end the program, you go to Mornington Crescent too
* at the end, the value of the accumulator is printed

Since printing strings is hard (see Martin Ender's Mornington Crescent "Hello, World!" program), we will need a simple template that can be used to output generic strings. Since the length of the generated programs don't matter, I've settled on this:

```
Take Northern Line to Bank
Take Northern Line to Bank
Take District Line to Paddington

```

We'll need to generate each character separately and concatenate them, since the substring approach used by Martin is much harder to implement in the general case. Paddington is the station that performs string concatenation. When you arrive at Paddington, the following happens:

```
accumulator, paddington = paddington + accumulator, accumulator

```

This behavior is used to initialize Paddington to the empty string that's assumed to be the input.

```
Take District Line to Victoria
Take Victoria Line to Seven Sisters
Take Victoria Line to Euston
Take Victoria Line to Euston
Take Northern Line to Bank

```

Go to Seven Sisters, which sets the accumulator to 7, and store it in the Bank. The Bank is the only way to copy values - Hammersmith is a readonly copy of Bank's value.

```
Take District Line to Hammersmith
Take District Line to Cannon Street
Take District Line to Hammersmith
Take District Line to Cannon Street
Take District Line to Bank

```

Divide 7 by 7 to get 1, a divisor of all ASCII values we need to support.

```
Take District Line to Hammersmith
Take District Line to Upminster

```

For each character, start by copying the 1 to Upminster.

```
Take District Line to Hammersmith
Take District Line to Upminster
Take District Line to Upminster
Take District Line to Hammersmith
Take District Line to Upminster
Take District Line to Upminster
Take District Line to Hammersmith
Take District Line to Upminster
Take District Line to Upminster

```

Add more ones as necessary.

```
Take District Line to Hammersmith
Take District Line to Upminster
Take District Line to Bank
Take District Line to Bank
Take Northern Line to Charing Cross
Take Northern Line to Charing Cross
Take Bakerloo Line to Paddington
Take Bakerloo Line to Paddington
Take Bakerloo Line to Charing Cross
Take Northern Line to Embankment

```

Finish up by going to Upminster only once, to keep the new value in the accumulator instead of storing it again. Take it to Charing Cross to turn the ASCII value into a character and append it to the string. The last two lines are there because I've misread the specification, so I'll stop here and golf my program down first.

# Answer
> 9 votes
# Jelly, 1 byte

Woo builtins!

The builtin  unevals the input.

Try it online!

A more interesting one:

```
⁾“”j

```

Joins the string "“”" by the input.

Try it online!

# Answer
> 8 votes
# Charcoal, 1 byte

```
θ

```

By default, a string of ASCII characters  .. `~` simply prints itself, so it just remains to print the input.

# Answer
> 7 votes
# C (gcc), ~~89~~ ~~87~~ ~~58~~ 56 bytes

*Saved two bytes thanks to Jakob!*

```
main(a,c)char**c;{printf("main(){puts(\"%s\");}",c[1]);}

```

Try it online!

# Answer
> 6 votes
# Japt, 2 bytes

```
iQ

```

Try it online!

`i` is a function that inserts a specified string at a specified index into the input. `Q` is a variable that defaults to a quotation mark `"`, and since there's no index given, this defaults to `0`. The end result is a quotation mark inserted at the beginning of the string, which Japt auto-finishes when running.

This works on strings containing anything except `"`, `{`, or `\`, though of course the string is guaranteed to consist of alphanumeric chars so this doesn't matter.

# Answer
> 4 votes
# Python 2, 22 bytes

```
print'print%r'%input()

```

Try it online!

# Answer
> 4 votes
# MATLAB / Octave, 15 bytes

```
@(t)['disp ',t]

```

Try it online!

I completely overlooked the fact that the program only needs to handle alphanumeric characters, or, importantly, does **not** need to handle space characters. This means we can use the 'command' syntax, which uses significantly less bytes.

### MATLAB, 27 bytes

For completeness, here's a version that can handle arbitrary input:

```
@(t)['disp(',mat2str(t),41]

```

Defines an anonymous function taking the string `t`, and converts it to the program. Curiously, this does not work in Octave, which seems to have different ideas of what `mat2str` should do.

# Answer
> 3 votes
# PowerShell, 9 Bytes

```
"'$args'"

```

single or double quotes in powershell can be used to contain strings, but only double-quotes allow variable expansion.

with an input of `foo` this will output `'foo'` which is a valid powershell program which outputs `foo`

# Answer
> 3 votes
# Befunge-98 (FBBI), ~~21~~ ~~16~~ 12 bytes

-5 bytes thanks to NieDzejkob
-4 bytes thanks to Jo King

```
#,~'',,',,'@

```

Try it online!

Outputs `'t,'e,'s,'t,@` for an input of `test`

### How?

Initially the pointer moves East:

```
#,           # skips the next instruction
  ~          push a byte of input
   '',       push ' and print it
      ,      print the byte of input
       ',,   push , and print it
          '@ push @ to the stack

```

If there is no more input left, `~` reverses the direction of the pointer:

```
 ,           print @
#            skip nothing
           @ terminate

```

# Answer
> 3 votes
# Emojicode, 88 bytes

```
➡❌❌

```

Try it online!

**Input:**

```
anyString

```

**Output:**

```
anyString

```

**Script Output:**

```
anyString

```

# Answer
> 2 votes
# QBIC, 7 bytes

```
?@?@`+;

```

## Explanation

```
?           PRINT on the screen
 @  `       a literal
  ?@         question mark and at
     +;     and append the input

```

## Sample run

```
Command line: lala
?@lala

```

The output is a string literal containing the input, preceded with a `PRINT` command.

# Answer
> 2 votes
# Batch 11 bytes

I'm sure there's away to get it smaller, but this is pretty small.

```
set/p=echo

```

### The breakdown:

```
set             ::Define new variable
   /p           ::Create prompt
     =          ::Define a variable in prompt
      echo      ::Prompt begins with 'echo '

```

## In English:

The user is asked for input with a leading phrase `echo`. Then the user may type in whatever, and the program terminates (e.g; `echo hello world!`). This leaves us with a program that when ran, will output `hello world!`.

*Yes, the whitespace is supposed to be there*

# Answer
> 2 votes
# D, ~~92~~ 89 bytes

```
void main(){import std.stdio;write(`void main(){import std.stdio;"`~readln~`".write;}`);}

```

Try it online!

# Answer
> 2 votes
# V, 2 bytes

```
ii

```

In Vim, `i` changes to insert mode and allows inserting text. In this case, it just inserts the `i` in front of the input text (to create the second program). V is Vim compatible, but adds an implicit `<esc>` to the end of the program, so I don't need to worry about it here.

# Answer
> 2 votes
# Cubically, 87 bytes

```
U3D1R3L1F3B1U1D3~:7+1(-1@3(-1%1)6:1+3111@6%1-31111+004@6:1+11111%6:1+45@6:1-1%6~:7+1)6

```

Try it online!

A port of my answer here. There already existed a challenge to take input and output Cubically code that produced that input, and I had an answer in Cubically so... profit?

# Answer
> 2 votes
# SmileBASIC, 21 bytes

Maybe this is cheating...

```
LINPUT"?"+CHR$(34);S$

```

Asks for input with the prompt `?"`. (? is short for PRINT, and closing quotes are not required). So the "output" program is `?"<text>`

# Answer
> 2 votes
# Python 2, 17 bytes

```
'print%r'.__mod__

```

Try it online!

# Answer
> 1 votes
# Pyth, ~~2~~ 1 byte

```
z

```

Try it online!

Just outputs the input. Requires strings to be in quotes.

*-1 byte thanks to KarlKastor*

# Answer
> 1 votes
# SOGL V0.12, 2 bytes

```
$+

```

Try it Here! (expects input on stack so `,` is added for ease-of-use)

`$` pushes , `+` joins that after the input on the stack.

# Answer
> 1 votes
# Perl 6, 19 bytes

```
say "say "~get.perl

```

Try it

This should work for any Unicode input in NFC

# Answer
> 1 votes
# 8th, ~~34~~ 37 bytes

**Code**

```
: f >s "\"" tuck s:+ s:+ " ." s:+ . ;

```

**Example**

```
ok> "Print 42" f
"Print 42" .
ok> "Print 42" .
Print 42

```

# Answer
> 1 votes
# PHP, 12 bytes

```
<?=$argv[1];

```

Try it online!

This is to be run from the command line with the input as the parameter argument. And yes, it simply outputs the input string—but that is valid PHP: anything outside the `<?php` `?>` delimiters is output unprocessed.

Here is the script produced by the 'testing123' input in action as a demonstration: Try it online!

# Answer
> 1 votes
## Haskell, 2 bytes

```
id

```

`id` returns it's argument unchanged.

`id "abc"` returns `"abc"` which evaluates to itself, which is a valid output method according to or standard rules. `id` is polymorphic and works for all kind of input types, so it also works for integer inputs.

The challenge requires to "output a piece of code". As @TannerSwett point out in a comment, the output of `id` is not valid Haskell source code, but a Haskell value or function that can be evaluated further, so it might also qualify as "code". If "code" means "source code" then we have a 4 byte answer

### Haskell, 4 bytes (outputs source code)

```
show

```

# Answer
> 1 votes
# JavaScript ES6, 25 bytes (outputs code to "standard output")

```
s=>alert(`alert('${s}')`)

```

# JavaScript ES6, 23 bytes (returns code, that outputs to "standard output")

```
s=>`alert('${s}')`

```

# JavaScript ES6, 14 bytes (returns a function, that returns the result)

```
s=>`_=>"${s}"`

```

# Answer
> 1 votes
# MATL, 2 bytes

```
&D

```

Try it online!

Simply wraps the string in quotes using `&D`, which is MATL's equivalent to MATLAB's `mat2str`, a function specifically made to make something that, when `eval`'d, will give the original matrix (or in this case, string).

The resulting 'program' is just the input string wrapped in quotes, which is thus pushed on the stack, and implicitly displayed.

# Answer
> 1 votes
# Java 8, 16 bytes

A rather strange challenge, especially given that the solution is only required to support alphanumeric strings.

```
s->"v->\""+s+'"'

```

This is a lambda from a string to the string representation of a lambda taking an empty argument of any type and returning the string.

# Answer
> 1 votes
## Batch, 14 bytes

```
@echo @echo(%*

```

Works for special characters too if they are quoted using `"`s rather than `^`.

# Answer
> 1 votes
# eacal, 38 bytes

```
strap string put string
put strap arg

```

Try it online!

Simply appends the string `put string` to the memory string, then appends the argument, which is printed.

# Answer
> 1 votes
# Ly, 14 bytes

```
"\""&i"\"&o"&o

```

Try it online!

### Explanation

```
"\""&i"\"&o"&o

"\""           # push `"`
    &i         # take input
      "\"&o"   # push `"&o`
            &o # output stack
               # test -> "test"&o
               # "test"&o = push "test" and output stack

```

# Answer
> 1 votes
# Bash, 10 bytes

<sup>Saved 2 bytes thanks to @manatwork!</sup>

```
echo{,} $1

```

Try it online!

# Answer
> 1 votes
# R (+ pryr), ~~27~~ 25 bytes

```
pryr::f(function()cat(x))

```

which evaluates to the function:

```
function (x)
function() cat(x)

```

which returns the function:

```
function()cat(x)

```

where `x` is defined in the scope of the first function, and taken directly from its input.

# Answer
> 1 votes
# Carrot, 1 byte

```
#

```

How it works

```
# //Takes the input and places it onto the string stack
  //This is then output implicitly

{input} //The next program then consists of the input string
        //This is then placed directly onto the string stack
        //Then output implicitly

```

An alternative, also at 1 byte is:

```
$

```

This works the same as the above but only takes the first line of input. Seeing as input will only ever be `[A-Za-z0-9]` this is fine.

# Answer
> 1 votes
# Brain-Flak, ~~92~~ 68 bytes

-22 bytes thanks to Wheat Wizard

Includes +2 for `-cr`

```
{<>(((((()()()()()){}){}){})())<>{({}[()])<>((({}[()])()))<>}{}}<>

```

Try it online!

```
# For every character
{

   # Put ")(" on the off stack
   <>(((((()()()()()){}){}){})())<>

   # for 0 to the ASCII value of this character
   {({}[()])

      # Replace the ")" with "(" and add "))"
      <>((({}[()])()))<>

   # End for
   }{}

# end for and switch to the off stack for printing (in reverse order because of -r)
}<>

```

# Answer
> 1 votes
# QBasic, ~~25~~ 23 bytes

```
INPUT s$
?"?";
WRITE s$

```

Gets input from the user, and then prints a question mark followed by the input wrapped in double quotes. (Question mark is a shortcut for `PRINT`.)

# Answer
> 1 votes
# \>\<\>, 29 bytes

```
/->:?v";"o;
/l^  >"o''"o{ooo1

```

Takes input using the `-s` flag Prints a program that reads and print the original input character by character.

```
input -> 'i'o'n'o'p'o'u'o't'o;

```

# Answer
> 1 votes
# Lua, 31 bytes

```
print('print([['..(...)..']])')

```

Try it online!

# Answer
> 1 votes
# AWK, 25 bytes

```
$0="BEGIN{print\""$0"\"}"

```

Try it online!

Should work for most input other than `"`.

If some (possibly empty) input is allowed for the secondary program this could be shortened to:

```
$0="$0=\""$0"\""

```

# Answer
> 1 votes
# dc, 10 bytes

```
91Pn93PACP

```

Try it online!

Straightforward: print an open bracket, then the input, then the close bracket and the letter `p` for the print command. `91Pn23920P` also works.

# Answer
> 1 votes
# Julia 0.6, 8 bytes

```
s->()->s

```

Try it online!

Function that takes a string, and returns a closure that returns the string when called.

Alternately, a program outputting a program:

# Julia 0.6, 28 26 bytes

```
print(:(show($(ARGS[1]))))

```

Try it online!

(Removed, of all things, a trailing whitespace. *Smh.* Also changed inner `print` to `show`.)

# Answer
> 1 votes
# R, ~~41~~ 37 characters

```
function(x)"[[<-"(sys.call(),1,"cat")

```

How it works:

`sys.call` (makes only sense if used from within a function) returns the call; the first element of it is the name of the function; this is replaced on-the-fly by `cat` (which will print its arguments).

A nicer version:

```
sqk <- function(x)"[[<-"(sys.call(),1,as.name("cat"))
# will print cat(args) instead of "cat"(args) - both are functional but the 2nd is nicer

```

Example with output:

```
> sqk("The paws")
cat("The paws")

```

# Answer
> 1 votes
# APL (Dyalog Unicode), 12 bytes

```
∊'⍞←'''⍞''''

```

Outputs programs as `⍞←'input'`

Try it online!

# Answer
> 1 votes
# 05AB1E, 0 bytes

Try it online! Takes input surrounded in any of `"‘’“”` (as long as the first and last quotes are the same).

# Explanation

The program immediately reaches the end, so it triggers implicit output. Since the length of the stack (0) is less than the arity of the print function (1), it implicitly checks if there's input (which there is), and if so uses it as the argument. It outputs with a trailing newline, but that doesn't matter since newlines are nops in 05AB1E.

### TL;DR: The null program in 05AB1E is a one-line `cat`.

Finally, each of `"‘’“”` are used for strings. The difference is that `‘’“”` are used for compressed strings while `"` is regular. However, `‘’“”` treat all ASCII characters normally, so they don't make a difference for this challenge. Declaring strings pushes them to the stack, so now the original input is on the stack of the generated program. At the end, it implicitly outputs the top of the stack - which is, you guessed it, the original input.

# Example

Say you input `"testing123"`. Since the program is a one-line `cat`, it outputs `"testing123"`. Running this will push everything between `""` to the stack, therefore pushing the string `"testing123"`. Finally, it implicitly outputs the top of the stack, printing `testing123`.

# Answer
> 1 votes
# naz, 110 bytes

```
2x0v1x1f1r3x0v4e2x1v2f0x1x2f1v3x0v3e1s2x1v0m1a1o8m4m3m1a1o2f0x1x3f0m1a1o8m3m5m9s1o2d7s1o3d7m3s1o1f0x1x4f0a0x1f

```

Works for any null-terminated input string, with some caveats: programs generated for strings containing any control characters between SOH and TAB (values 1-9) will produce incorrect output due to a language quirk, and programs generated for strings containing any control characters between VT and US (values 11-31), or the control character DEL (value 127), will error out with `invalid output value` if run. Luckily, none of these cases are required by the challenge.

Output programs are generated naïvely and are thus near-irreducible; the output program for an input of `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789` will take around 125 milliseconds to generate, but around 10 seconds to run.

**Explanation** (with `0x` commands removed)

```
2x0v                                 # Set variable 0 equal to 0
1x1f                                 # Function 1
    1r                               # Read a byte of input
      3x0v4e                         # Goto function 4 if it equals variable 0
            2x1v                     # Otherwise, store it in variable 1,
                2f                   # and call function 2
1x2f                                 # Function 2
    1v                               # Set the register equal to the value of variable 1
      3x0v3e                         # Goto function 3 if this equals variable 0
            1s2x1v                   # Otherwise, subtract 1 from variable 1,
                  0m1a1o8m4m3m1a1o   # output "1a",
                                  2f # and jump back to the start of function 2
1x3f                                 # Function 3
    0m1a1o8m3m5m9s1o2d7s1o3d7m3s1o   # Output "1o0m"
                                  1f # Call function 1
1x4f                                 # Function 4
    0a                               # Add 0 to the register
1f                                   # Call function 1

```

# Answer
> 1 votes
# Vyxal, 1 byte

```
q

```

Try it Online!

Note Vyxal uses backticks for strings, not the usual quotes.

# Answer
> 0 votes
# Proton, 15 bytes

```
'print(%r)'&(%)

```

Try it online!

Binds `'print(%r)'` to the left argument of `%` string formatting. When the input is given, it is applied as the second (right) argument which formats into the print statement.

# Answer
> 0 votes
# Pyth, 3 bytes

```
+Nz

```

Try it online!

**Explaination:**

```
+Nz   expects any input
+     joins on same line
 N    quotation mark
  z   input as string

```

# Answer
> 0 votes
# Lua, 30 bytes

```
print("print(\"".. ....."\")")

```

Try it online!

# Answer
> 0 votes
# Mathematica, 15 bytes

```
"\""<>#<>"\"&"&

```

Not much.

# Answer
> 0 votes
# 05AB1E, 3 bytes

```
'"«

```

Try it online!

---

Surround input with quotes.

-1 @Adnan.

# Answer
> 0 votes
# Mathematica, 14 bytes

```
Defer@Print@#&

```

For input `"test"`, this function will output `Print["test"]`, which prints `"test"` when run.

# Answer
> 0 votes
# Rexx (Regina), 14 bytes

```
say say arg(1)

```

Try it online!

# Answer
> 0 votes
## C++, 125 bytes

Warning : the code that will be printed will be invalid if input contains at least one of the character `"`

```
#include<iostream>
int main(int a,char**v){std::cout<<"#include<iostream>\nint main(){std::cout<<\""<<(a>1?v[1]:"")<<"\";}";}

```

## C++, 116 bytes, undefined behavior if nothing is passed as console argument

If empty strings are considered as invalid input :

```
#include<iostream>
int main(int a,char**v){std::cout<<"#include<iostream>\nint main(){std::cout<<\""<<v[1]<<"\";}";}

```

# Answer
> 0 votes
## Retina, 5 bytes

```
\`^
¶

```

Try it online!

For an input like `testing123` returns the program:

```

testing123

```

which in turn produces the desired output.

Try it online!

There might be a trick to disable the newline append with shorter syntax, but I don't know it!

# Answer
> 0 votes
# C#, 16 bytes

```
s=>$"()=>\"{s}\""

```

# Answer
> 0 votes
# Common Lisp, 13 bytes

```
`,(read-line)

```

Try it online!

For instance, given the input `john`, the output will be "john", which evaluates to itself.

For a program that works through printing and not through the REPL:

# Common Lisp, 20 bytes

```
`(princ,(read-line))

```

that produces `(princ input-string)`.

# Answer
> 0 votes
# \>\<\>, 37 bytes

```
i:1+?!v
-1"#"~<.1fo;!?l"<.09o;!?l"r}:

```

Try it online!

Fairly simple;

Takes input, prints out a printing loop with the string attached to the end.

# Answer
> 0 votes
# Swift, 47 bytes

```
print("print(\"\(CommandLine.arguments[1])\")")

```

I think this is pretty straight forward.

# Answer
> 0 votes
# CJam, 2 bytes

```
q`

```

Explanation:

```
q  e# Input
`  e# String representation

```

# Answer
> 0 votes
# Befunge-98 (PyFunge), 30 bytes

```
'":v
~\#[
<v">:#,_""#
<>4k,'@,

```

Try it online!

This prints a program in the form `"...ihgfedcba">:#,_@`, which prints `abcdefghi...`

### Explanation

The code boils down to:

```
'":v    Push 2 quotation marks

~\#[    Get input and swap the top 2 items until EOF.
            Because every time we put a new value from input on the stack we also swap,
            the second quotation mark will float to the top, surrounding the input.

   >:#,_       A standard "print until the top is 0" loop
        ""#    Pushes a space, which is fine, since we control how much we print later
<v">:#,_"      When the IP gets reversed, we actually push the loop backwards onto
               the stack. This lets us print it later, instead of having to hardcode it.

 >4k,'@,       Prints 5 characters, being the printing loop from before, along with a @
<     @,       Prints an extra space, but it doesn't matter, and ends the program

```

# Answer
> 0 votes
# , 12 bytes

```
'echo',quote

```

Try it online!

# Answer
> 0 votes
# Ruby `-n`, 12 bytes

```
$><<"p'#$_'"

```

Try it online!

# Answer
> 0 votes
# Aceto, ~~14~~ ~~13~~ 11 bytes

```
'"drsJJp'pp

```

Try it online!

```
'"       push a quote character
  d       duplicate
   r       get input
    s       swap top stack items, so the input is between the two quotes
     JJ      Join top two items, 2x
       p  p    print
        'p      push literal:p

```

# Answer
> 0 votes
# Javascript, 20 bytes

Uses eval to make a new function from the input string.

```
a=>eval(`a=>'${a}'`)

```

# Answer
> 0 votes
# Julia 0.6, 18 bytes

```
x->"print(\"$x\")"

```

Try it online!

# Answer
> 0 votes
# JavaScript Firefox, 6 bytes

```
uneval

```

# Answer
> 0 votes
# WinDbg, 14 bytes

```
.echo.echo $u0

```

Input is taken by setting the fixed name alias `$u0` (so that input can be either a string or number).

Running this will print:

```
.echo {value_of_$u0}

```

Which when executed prints the input.

Example:

```
$$ set input
r$.u0=testing123

$$ run code
.echo.echo $u0
$$output: .echo testing123

$$ run output
.echo testing123
$$output: testing123

```

How it works:

```
.echo            $$ print the rest of the statement
     .echo       $$ part of the string that gets printed
           $u0   $$ automatically expands to the value of the fixed name alias,
                 $$ the expanded alias is printed
                 $$ because only a-zA-Z0-9 needs to be handled, no special logic around the
                 $$ alias expansion with regard to spaces, ", or ; interfering with the
                 $$ next .echo needs to be done

```

How the output works:

```
.echo            $$ print the rest of the statement
      {string}   $$ the string that gets printed, guaranteed to be one statement because
                 $$ it can't contain ; or " and can't start with a space

```

# Answer
> 0 votes
# T-SQL, 28 bytes

```
SELECT'PRINT'''+s+''''FROM t

```

An input table is allowed per our IO rules, so I simply create a `PRINT` statement with the appropriate quotation marks.

An input of `FooBarBaz109481` in the input table *t* will result in the following output:

```
PRINT'FooBarBaz109481'

```

Which will output the original string.

The original question says the string will only contain alphanumerics, so we won't have to handle any quote marks in the input itself.

# Answer
> 0 votes
## JavaScript (Node.js), 49 bytes

```
console.log('console.log("'+process.argv[2]+'")')

```

Try it online!

Takes input through `argv[2]`, the first argument in TIO (May be different depending on where it is tested), and prints in the `console.log("YOUR_MESSAGE")` format. Requires a string **without** quotes (unless escaped with `\`) with available characters `A-Z`, `a-z`, and `0-9`.

### Explanation

```
console.log(           // Log the output (open the outer log statement)
  'console.log("'      // Take console.log with opening parenthesis and quote
    + process.argv[2]  // Add the command-line argument after the quote (the input)
    + '")'             // Add the closing quote and parenthesis
)                      // Close the outer log statement

```

# Answer
> 0 votes
# R, ~~5~~ ~~4~~ ~~1~~ 0 bytes

Thanks to JayCe for contributing the one-byte answer!

There are a number of short R programs that would ...

> take a string as input, and output a piece of code in the same language that, when run, will output the initial input string

. Some of these are listed below, one on each row, in descending order of length:

```
identity     # 8 bytes
force        # 5 bytes
print
eval         # 4 bytes
c            # 1 byte
             # 0 bytes

```

This is inspired by NoOneIsHere's 1-byte answer in Pyth which is said to "just evaluate the input". This is exactly what `force` and `identity` do. `eval` and `c` achieve the same result in different ways. But why stop here? When you feed a string into R, it will be evaluated (to itself) and printed in quotes. A quoted string is a valid R program. That's the idea of the 0-byte answer.

Uniquely, the same program works identically in R and Python:

## R way

```
> "yo ho ho and a bottle of rum"
[1] "yo ho ho and a bottle of rum"

```

## Python way

```
>>> 'yo ho ho and a bottle of rum'
'yo ho ho and a bottle of rum'

```

# Answer
> 0 votes
# , 34 bytes

```
cat("cat(",scan(,""),")",sep="\"")

```

Try it online!

Non-functional answer - longer than the functional one

# Answer
> 0 votes
# Excel VBA, 10 bytes

An anonymous function that outputs an anonymous function that prints the value of cell `A1`.

```
?"?"""[A1]

```

### Example I/O

Given that cell `[A1]` that is populated with `One`

```
?"?"""[A1]
?"One
One

```

# Answer
> 0 votes
# Yabasic, 22 bytes

An anonymous function that takes input, `S$` as a string and outputs a function that outputs `S$` to the console.

This relies on the fact that the `Input` Call will print a `?` character to the console as a prompt when no explicit prompt is provided

```
Input S$
?"\""+S$+"\""

```

Try it online!

# Answer
> 0 votes
# Lua, 29 bytes

```
print('print("'.. ... ..'")')

```

Try it online!

# Answer
> 0 votes
# Scala, 79 bytes

```
println(s"""object x{def main(a:Array[String])=println("${args.mkString}")}""")

```

Try it online!

# Answer
> 0 votes
# Perl 5 `-p`, 12 bytes

```
$_="say'$_'"

```

Try it online!

# Answer
> 0 votes
# Rust, 26 bytes

Input needs to be enclosed in double quotes: `""`

```
|a|print!("||print!({a})")

```

Playground

# Answer
> 0 votes
# Thunno 2, 1 byte

Attempt This Online!

Built-in for "repr" (Thunno 2 has implicit input). Essentially this surrounds the string with double quotes. So, when you run the program a string gets pushed to the stack and gets implicitly output.

---
Tags: code-golf, code-generation
---