주어진 입력을 인쇄하는 스크립트를 출력하는 스크립트


29

문자열을 입력으로 사용하고 실행시 초기 입력 문자열을 출력하는 것과 동일한 언어로 코드를 출력하는 코드를 작성하십시오 .

문자 AZ, az 및 0-9의 모든 조합을 처리 할 수 ​​있어야합니다.

파이썬의 예 :

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

의 입력이 주어지면를 testing123반환 print('testing123')합니다.

이것이 이므로 바이트 단위의 최단 답변이 이길 것입니다.


기능이 될 수 있습니까?
완전히 인간적인

@manatwork (S) 그는 지금 막 편집했다.
NoOneIsHere 여기

입력은 문자열이어야합니까? 아니면 정수가 될 수 있습니까?
Shaggy

정수 및 문자열 입력을 모두 처리 할 수 ​​있어야합니다.
Quartzic

2
메타에 대한 defauts에 따라 함수를 출력 할 수 있습니까?
JAD

답변:


28

pl , 0 바이트

암호:

온라인으로 사용해보십시오!

설명:

pl의 빈 프로그램은 단순히 cat 프로그램이며 입력과 정확히 동일하게 출력됩니다.

pl에서 모든 ASCII 문자는 본질적으로 변수이지만 변수가 존재하지 않는 경우 (아직) pl은 해당 문자가 문자열의 일부라고 가정합니다.


3
나는 이런 언어가 있다는 것을 알았지 만 그것을 찾을 수 없었습니다 :(
Stephen

2
같은 맥락에서 파이썬과 같이 해석되는 언어 인 고양이를 참조하십시오. 대부분의 최신 Linux 배포판에는 cat통역사가 제공됩니다. ;)
Quuxplusone

1
이 솔루션은 입력이 프로그램 소스 코드에 추가되는 것으로 간주하는 경우 ///에서도 작동합니다 (//는 입력 메커니즘이 없기 때문에). ///는 프로그램 시작 부분의 영숫자 문자가 단순히 출력되는 많은 언어 중 하나입니다.
Tanner Swett

6
ungolfed 버전을 게시 할 수 있습니까? ;)
maxathousand

17

brainfuck , 56 55 33 바이트

Gravitron 덕분에 1 바이트 절약, Jo King 덕분에 22 바이트 절약!

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

온라인으로 사용해보십시오!

출력에는 메모리 언더 플로우를 랩핑하고 EOI = 0 인 인터프리터가 필요합니다. TIO는 그런 통역사가 있습니다.

설명

--[>+<++++++]단일 테이프를 초기화합니다 +.

입력 루프 :

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

다른 솔루션

각 라인은 자체 솔루션입니다.

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

1
+1. 나는 Brainfuck을 모르지만, 이와 같은 문제를 해결하려고 시도하는 것을 상상할 수 없습니다.
Jakob

++++++++++++++++++[>+++++<-]>(From brainfuck constants ) 로 대체하여 1 바이트를 절약 할 수 있습니다
Graviton

@Graviton 아, 감사합니다
코너 오브라이언

당신은 설명에서 그것을 대체하지 않았습니다
Destructible Lemon

4
당신은 Brainfuck를 모르십니까? 한 의견으로 가르쳐 드리겠습니다! 우리 0는 값에 대한 포인터와 함께 테이프로 시작 합니다. +값을 증가시키고, 값을 -감소 시키며, >포인터를 오른쪽으로 <이동하고, 포인터를 왼쪽으로 이동하고, 포인터 ,에 대한 입력을 ASCII 문자로 읽고, 포인터 .값을 ASCII 문자로 출력하고 [, 루프를 시작하고 ], 해당하는 [경우 포인터의 값이 아닙니다 0. 나는 설명하기에 나쁘지만 Brainfuck이 얼마나 쉬운가. 그리고 좋은 골프 코너!
Zacharý

13

모닝 턴 초승달 , 27640 바이트

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

온라인으로 사용해보십시오!

설명

먼저 Mornington Crescent의 빠른 업데이트 :

  • 각 스테이션은 임의 길이의 문자열 또는 bigint를 보유 할 수 있습니다.
  • 또한 문자열이나 bigint를 보유한 누산기가 있습니다
  • 모든 스테이션은 자신의 이름으로 시작합니다
  • 처음에는 누산기가 프로그램의 입력을 포함합니다.
  • 스테이션에 갈 때마다 스테이션의 값과 누산기가 교환됩니다
  • 일부 방송국은 특별하며이 동작을 무시합니다
  • 당신이 역에 도착하는 데 사용하는 선은 중요하지 않습니다
  • 당신은 Mornington Crescent에서 시작합니다
  • 프로그램을 끝내려면 Mornington Crescent로 이동하십시오.
  • 마지막으로 누산기의 값이 인쇄됩니다

문자열 인쇄가 어렵 기 때문에 ( Martin Ender의 Mornington Crescent "Hello, World!"프로그램 참조 ) 일반 문자열을 출력하는 데 사용할 수있는 간단한 템플릿이 필요합니다. 생성 된 프로그램의 길이는 중요하지 않기 때문에 다음과 같이 설정했습니다.

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

Martin이 사용하는 하위 문자열 접근 방식은 일반적인 경우 구현하기가 훨씬 어렵 기 때문에 각 문자를 개별적으로 생성하고 연결해야합니다. 패딩턴은 문자열 연결을 수행하는 스테이션입니다. 패딩턴에 도착하면 다음이 발생합니다.

accumulator, paddington = paddington + accumulator, accumulator

이 동작은 Paddington을 입력으로 간주되는 빈 문자열로 초기화하는 데 사용됩니다.

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

세븐 시스터즈로 가십시오. 어큐뮬레이터를 7로 설정하고 은행에 보관하십시오. Bank는 값을 복사하는 유일한 방법입니다-Hammersmith는 Bank 값의 읽기 전용 복사본입니다.

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

7을 7로 나누면 지원해야하는 모든 ASCII 값의 제수 인 1이됩니다.

Take District Line to Hammersmith
Take District Line to Upminster

각 캐릭터마다 1을 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

필요에 따라 더 추가하십시오.

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

새 값을 다시 저장하는 대신 누적기에 유지하려면 Upminster로 한 번만 이동하여 완료하십시오. ASCII 값을 문자로 바꾸고 문자열에 추가하려면 Charing Cross로 가져 가십시오. 마지막 두 줄은 사양을 잘못 읽었으므로 여기에 멈추고 내 프로그램을 먼저 골프화합니다.


(면책 조항 : 방금이 언어를 배웠습니다) 내가 생각할 수있는 것과 동일한 접근법에 대해 (7 / 7 = 1). 하지만 프로그램 시작시 Upminister를 한 번만 설정하지 않는 이유는 무엇입니까?
user202729

@ user202729 어떻게 작동합니까? / 재미있는 사실 : 반복 된 Take District Line to Upminster선은 피보나치 수열을 계산합니다
NieDzejkob

내가 사양을 오해 것 같습니다 . 그러나 그것은 정확히 거기에 나와 있습니다 ... 누군가 위키를 편집해야합니다.
user202729


7

숯, 1 바이트

θ

기본적으로 ASCII 문자 .. 의 문자열은 ~단순히 자체 인쇄하므로 입력을 인쇄하기 만합니다.


나는이 같은 대답을 추가하려고했습니다. :-)
Charlie

@CarlosAlejo 글쎄, 그것은 다른 대답이있는 것처럼되지 않습니다 ...
Neil

2
그럼 : P
ASCII 전용

@ASCII 전용 Touché!
Neil

6

C (gcc) , 89 87 58 56 바이트

Jakob 덕분에 2 바이트를 절약했습니다!

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

온라인으로 사용해보십시오!


"문자 AZ, az 및 0-9의 모든 조합을 처리 할 수 ​​있어야합니다." 결국 탈출 전략과 함께 가고 싶을 수도 있습니다.
Jakob

@Jakob 그래, 난 그냥 읽어 : /, 감사합니다
코너 오브라이언

또한 Java 솔루션에 대한 이스케이프 정규식 작성을 마쳤습니다. 버머.
Jakob

@Jakob 그래, 나에게도 동일하지만 열악한. RIP
코너 오브라이언

puts인쇄 된 프로그램에서 2 바이트를 절약 할 수 있습니다 . 아니면 개행을 추가하는 것이 문제입니까?
Jakob

5

Japt , 2 바이트

iQ

온라인으로 사용해보십시오!

i지정된 인덱스에 지정된 문자열을 입력에 삽입하는 함수입니다. Q은 따옴표로 기본 설정되는 변수이며 "지정된 색인이 없으므로 기본값은 0입니다. 최종 결과는 문자열 시작 부분에 따옴표가 삽입되어 실행시 Japt가 자동 종료됩니다.

이 제외하고는 아무 것도 포함하는 문자열에 작품 ", {또는 \물론 문자열이 문제가되지 않도록 영숫자 문자로 구성 보장하지만.


4

파이썬 2 , 22 바이트

print'print%r'%input()

온라인으로 사용해보십시오!


2
대체 22 바이트 솔루션은 print'print'+`input()`입니다.
notjagan

이 작동하지 않습니다. input파이썬 2에서와 같습니다 eval(raw_input()). 그래서 그것은 작동하기 위해 pythonic 표현이어야합니다.
Zizouz212

그렇습니다. --- 적절한 메타를 찾도록하겠습니다 ...--- 아하, 찾았습니다.
완전히 인간적인


4

MATLAB / 옥타브 , 15 바이트

@(t)['disp ',t]

온라인으로 사용해보십시오!

나는 프로그램이 영숫자 문자 만 처리해야하거나 중요하지 않다는 사실을 완전히 간과했습니다. 공백 문자를 처리 할 필요 . 이것은 우리가 훨씬 적은 바이트를 사용하는 '명령'구문을 사용할 수 있음을 의미합니다.

MATLAB, 27 바이트

완전성을 위해 다음은 임의의 입력을 처리 할 수있는 버전입니다.

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

string을 취하는 익명 함수를 정의하고 t이를 프로그램으로 변환합니다. 흥미롭게도 옥타브에서는 작동하지 않습니다 mat2str.


나는 이것을 테스트 할 수 없지만 나는 생각 @(t)['disp ',mat2str(t)]해야한다.
Stewie Griffin

@StewieGriffin mat2str명령 구문에 필요 하지 않은 따옴표를 추가 하므로 작동하지 않습니다 . mat2str입력에서 공백을 처리하기 위해 함수 구문을 결합 했지만 챌린지를 다시 읽을 때 실제로 필요하지 않으므로 바이트 수를 거의 절반으로 줄였습니다. 감사!
Sanchises

입력에 공백이 있으면 따옴표가 필요하다고 생각했지만 잘못되었을 수 있습니다. 나는 입력이 영숫자임을 고지하지 않았다 중 ...
스튜이 그리핀


@StewieGriffin 당신이 옳습니다, 나는 명령 구문이 작동하는 방식을 잘못 판단했습니다. 그러나 명령 구문은 놀랍게 가득한 것 같습니다. 온라인으로 사용해보십시오!
Sanchises

3

Befunge-98 (FBBI) , 21 16 12 바이트

NieDzejkob 덕분에 -5 바이트, Jo King
덕분에 -4 바이트

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

온라인으로 사용해보십시오!

출력 't,'e,'s,'t,@입력에 대한test

방법?

처음에는 포인터가 동쪽으로 이동합니다.

#,           # 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

더 이상 입력이 없으면 ~포인터 방향을 반대로 바꿉니다.

 ,           print @
#            skip nothing
           @ terminate


2

QBIC , 7 바이트

?@?@`+;

설명

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

샘플 런

Command line: lala
?@lala

출력은 PRINT명령이 앞에 오는 입력을 포함하는 문자열 리터럴 입니다.


2

일괄 11 바이트

더 작아 질 것이라고 확신하지만 이것은 매우 작습니다.

set/p=echo 

고장 :

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

영어로:

사용자에게 선행 문구를 입력하라는 메시지가 표시 echo됩니다. 그러면 사용자는 무엇이든 입력 할 수 있으며 프로그램은 종료됩니다 (예 :) echo hello world!. 이것은 우리에게 실행될 때 출력 할 프로그램을 남긴다 hello world!.

예, 공백이 있어야합니다


나는 배치를 모른다. (그리고 이것은 오래 전이다), 이것은 잘못 보인다. 하지 않을까요 echo부분은 텍스트 콘솔이 아닌 프로그램 출력에 반향?
Jakob

@Jakob는 당연히 아니요, 본질적으로 초기 도전에서 주어진 파이썬 예제와 기능적으로 동일합니다.
Graviton

죄송합니다. 프로그램이 사용자가 입력 한 텍스트를 출력하는지 의심합니다. 아마도 콘솔에 방금 울 렸을 것입니다.
Jakob

인쇄에 해당하는 @Jakob Right. 이 예는 인쇄 기능을 인쇄하는 반면 내 기능은 에코 기능을 에코합니다.
Graviton

예, 그러나 예제는 전체 프로그램을 표준 출력으로 인쇄합니다. 프로그램은 echo 표준 출력으로 만 인쇄됩니다 . 사실, 입력이 파일이나 파이프에서 오는 경우 프롬프트가 표시됩니다. 그런 종류의 출력이 허용 되었습니까?
Jakob

2

V, 2 바이트

ii

Vim에서 i삽입 모드로 변경하고 텍스트를 삽입 할 수 있습니다. 이 경우 i입력 텍스트 앞에를 삽입 하여 두 번째 프로그램을 만듭니다. V는 Vim과 호환되지만 <esc>프로그램 끝에 암시 적 기능 을 추가 하므로 여기서 걱정할 필요가 없습니다.


2

PowerShell, 9 바이트

"'$args'"

powershell의 작은 따옴표 나 큰 따옴표를 사용하여 문자열을 포함 할 수 있지만 큰 따옴표 만 변수 확장을 허용합니다.

이 입력으로 foo출력 'foo'되는 유효한 powershell 프로그램입니다.foo


2

큐빅 으로 87 바이트

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 

온라인으로 사용해보십시오!

내 대답의 포트는 여기에 있습니다 . 입력 및 출력 Cubically 코드를 가져 와서 해당 입력을 생성하는 문제가 이미 있었으며 Cubically so ... profit?


Save a few bytes - remove the arguments from %6s and @6s; they can now be called implicitly. (You can also do that on your answer on the cubifier thread.)
MD XF



1

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.


You can use `"` for ".
NoOneIsHere

@NoOneIsHere yeah, that makes sense.. Used it everywhere else except where it's the most useful .-.
dzaima

1

Perl 6, 19 bytes

say "say "~get.perl

Try it

This should work for any Unicode input in NFC


Can you remove the space?
NoOneIsHere

@NoOneIsHere Removing either space would result in a two terms in a row error. Perl 6 has significant whitespace, but it is only significant in that it either has to be there, or has to not be there. (there are ways of opting out of both though)
Brad Gilbert b2gills

1

8th, 34 37 bytes

Code

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

Example

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

1

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!


1
this won't work quite right if the input string contains <?php, mind you ;)
Andrea

@Andrea Read the question: "It must be able to handle any combination of characters A-Z, a-z, and 0-9." So '<?php' is invalid input…
WebSmithery

1
aw, that's too easy :(
Andrea

1

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.


1

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.


1

Batch, 14 bytes

@echo @echo(%*

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


Perhaps @echo.@echo.%* would be more correct? The input could be potentially empty.
Conor O'Brien

@ConorO'Brien Well I don't need the first . because that's never empty, and I used a ( for the second case because that's more reliable than ., but thanks for the suggestions anyway!
Neil

np! I just like the symmetry between the @echo.s lol
Conor O'Brien

1

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


1

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)
}<>


1

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.


Considering the spec only claims that you need to handle A-Z, a-z, and 0-9, isn't this competing?
jkelm

@jkelm I must have missed that part, then yes this is competing.
TheLethalCoder

Would this work for input 01?
a spaghetto

@quartata I believe so, it’s been a while since I’ve used Carrot though.
TheLethalCoder
당사 사이트를 사용함과 동시에 당사의 쿠키 정책개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.