Belirli bir girdiyi basan bir komut dosyasını çıkaran komut dosyası


29

Girdi olarak bir dize alan bir kod parçası yazın ve aynı dilde çalıştırıldığında ilk giriş dizesini çıkaracak bir kod parçası çıkar.

AZ, az ve 0-9 karakterlerinin herhangi bir birleşimini işleyebilmelidir.

Python'daki örnek:

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

Girişi göz önüne alındığında, testing123geri dönecektir print('testing123').

Bu olduğu için, bayt cinsinden en kısa cevap kazanacaktır.


Bir fonksiyon olabilir mi?
tamamen insan

@ manatwork (S) o şimdi düzenledi.
NoOneIsHere

Giriş bir dize olmalı mı? Yoksa bir tamsayı olabilir mi?
Shaggy

Hem tamsayı hem de dize girişlerini işleyebilmelidir.
Quartzic

2
Metadaki varsayılanlara göre bir işlev çıkartabilir miyiz?
JAD,

Yanıtlar:


28

pl , 0 bayt

Kod:

Çevrimiçi deneyin!

Açıklama:

Pl'deki boş bir program, girdi ile aynı çıktının alındığı basit bir kedi programıdır.

Pl'de, tüm ASCII karakterleri temelde değişkenlerdir, ancak değişken olmadığında (henüz), pl bir dizenin parçası olduğunu varsayar.


3
Böyle bir dil olduğunu biliyordum, ancak bulamadım :(
Stephen

2
Aynı damarda Python gibi yorumlanmış bir dil olan Cat'e bakınız. Çoğu modern Linux, cattercümanla gönderilir. ;)
Quuxplusone

1
Bu çözüm, girdiyi program kaynak koduna eklenmesini düşünüyorsanız (/// girdi için bir mekanizmaya sahip olmadığından) /// için de çalışır. /// programın başındaki alfanümerik karakterlerin basitçe çıktılandığı birçok dilden biridir (bence).
Tanner Swett

6
Ununged versiyonunu gönderebilir misin? ;)
saat

17

brainfuck , 56 55 33 bayt

Gravitron sayesinde 1 byte, Jo King!

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

Çevrimiçi deneyin!

Çıktı, hafızanın altına akan ve EOI = 0 olan bir tercüman gerektirir. TIO'nun böyle bir tercümanı var.

açıklama

--[>+<++++++]Kaseti bir tek ile başlatır +.

Giriş döngüsü:

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

Diğer çözümler

Her satır kendi çözümdür.

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

1
+1. Brainfuck'ı tanımıyorum ama bununla böyle bir problemi çözmeyi hayal edemiyorum.
Jakob

Sen değiştirerek 1 byte kaydedebilirsiniz +++++++++++++++ile +++[>+++++<-]>(Dan brainfuck sabitleri )
Gravition

@Graviton Oh, harika, teşekkürler
Conor O'Brien,

açıklamadaki yerini
Yıkılabilir Limon

4
Brainfuck'ı tanımıyor musun? Size bir yorumda öğreteceğim! 0'Nın bir kasetiyle, bir değere bir işaretçi ile başlıyoruz . +değeri artırır, değeri -azaltır, >işaretçiyi sağa <taşır, işaretçiyi sola taşır, işaretçiyi ,ASCII karakteri olarak girdi olarak okur, işaretçinin .değerini ASCII karakteri olarak verir, [bir döngü başlatır ]ve karşılık gelen değere atlar [. işaretçinin değeri değil 0. Açıklamakta kötüyüm ama Brainfuck bu kadar kolay. Ve güzel golf Conor!
Zacharý

13

Mornington Crescent , 27640 bayt

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

Çevrimiçi deneyin!

açıklama

İlk olarak, Mornington Crescent'te hızlı bir tazeleme:

  • Her istasyon bir isteğe bağlı uzunlukta bir dizi veya bir bigint tutabilir
  • Ayrıca bir dize veya bigint tutan bir akümülatör var
  • tüm istasyonlar kendi değerleri ile kendi değerleri ile başlar
  • Başlangıçta, akü programınızın girişini içerir.
  • bir istasyona her gittiğinizde, istasyonun değeri ve akümülatör değiştirilir
  • bazı istasyonlar özeldir ve bu davranışı geçersiz kılar
  • İstasyona ulaşmak için kullandığınız hat önemli değil
  • Mornington Crescent'den başlıyorsunuz
  • Programı sonlandırmak için, Mornington Crescent'e de gidersiniz.
  • sonunda, akünün değeri yazdırılır

Dizeleri yazdırmak zor olduğu için (bkz. Martin Ender'in Mornington Crescent "Merhaba, Dünya!" Programı ), genel dizeleri çıkarmak için kullanılabilecek basit bir şablona ihtiyacımız olacak. Oluşturulan programların uzunluğu önemli olmadığından, bu konuya odaklandım:

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

Her bir karakteri ayrı ayrı oluşturmamız ve birleştirmemiz gerekecek, çünkü Martin tarafından kullanılan alt tabaka yaklaşımının genel durumda uygulanması çok daha zor. Paddington, dizgiyi birleştirmeyi gerçekleştiren istasyondur. Paddington'a vardığınızda, aşağıdakiler gerçekleşir:

accumulator, paddington = paddington + accumulator, accumulator

Bu davranış, Paddington'u giriş olduğu varsayılan boş dizeye başlatmak için kullanılır.

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

Akümülatörü 7'ye ayarlayan Yedi Kızkardeş'e gidin ve Bankada saklayın. Banka, değerleri kopyalamanın tek yoludur - Hammersmith, Banka'nın değerinin salt okunur bir kopyasıdır.

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

Desteklememiz gereken tüm ASCII değerlerinin bölenini 1 olarak almak için 7'yi 7'ye bölün.

Take District Line to Hammersmith
Take District Line to Upminster

Her karakter için, 1 - Upminster kopyalayarak başlayın.

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

Gerektiği kadar çok ekleyin.

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

Yeni değeri tekrar depolamak yerine aküde tutmak için Upminster'e giderek bir kere bitirin. ASCII değerini bir karaktere dönüştürmek ve karakter dizisine eklemek için Charing Cross'a götürün. Son iki satır var çünkü teknik özellikleri yanlış anladım, bu yüzden burada duracağım ve önce programımı aşağıya indireceğim.


(feragatname: Bu dili yeni öğrendim) Aklıma gelen aynı yaklaşım hakkında (7/7 = 1). Peki neden programın başında sadece bir kere upminister kurmuyorsun?
user202729

@ user202729 Bu nasıl çalışır? / Eğlenceli gerçek: tekrarlanan Take District Line to Upminsterçizgiler fibonacci dizisini hesaplar
NieDzejkob

Benim gibi görünüyor yanlış spec . Ama tam olarak orada söylediği şey ... birisinin vikiyi düzenlemesi gerek.
user202729


7

Kömür 1 bayt

θ

Varsayılan olarak, bir ASCII karakterleri dizisi .. ~basitçe kendisini basar, bu nedenle girdiyi yazdırmak için kalır.


Ben de aynı cevabı ekleyecektim. :-)
Charlie

@CarlosAlejo Eh, farklı bir cevap vardı sanki değil ...
Neil

2
Eh var : P
ASCII-sadece

@ ASCII-sadece Touché!
Neil,

6

C (gcc) , 89 87 58 56 bayt

Jakob sayesinde iki bayt kurtarıldı!

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

Çevrimiçi deneyin!


"AZ, az ve 0-9 karakterlerinin herhangi bir birleşimini işleyebilmelidir." Sonuçta kaçış stratejisiyle gitmek isteyebilirsiniz.
Jakob

@Jakob evet Sadece şunu okudum: /, thanks
Conor O'Brien,

Ayrıca okuduğumda Java çözümü için escaper regex yazmayı yeni bitirdim. Aylak.
Jakob

@ Jakob Evet, benim için aynı, ancak bikli. RIP
Conor O'Brien,

putsYazdırılan programda 2 bayt kaydetmek için kullanabilirsiniz , değil mi? Yoksa yeni bir satır eklemesi bir sorun mu?
Jakob

5

Japt , 2 bayt

iQ

Çevrimiçi deneyin!

ibelirtilen bir dizinde belirtilen bir dizgeyi girişe ekleyen bir işlevdir. QBu, bir tırnak işareti varsayılan değerine sahip bir değişkendir "ve verilen dizin olmadığından, bu varsayılan değerdir 0. Sonuçta, Japt'in çalışırken otomatik olarak bitirdiği dizenin başına yerleştirilen bir tırnak işareti bulunur.

Bu dışında hiçbir şey ihtiva dizeleri üzerinde çalışmalar ", {ya \elbette dize bu önemli değil bu yüzden alfanümerik karakter oluşur garantilidir bile.



4

MATLAB / Octave , 15 bayt

@(t)['disp ',t]

Çevrimiçi deneyin!

Tamamen program sadece önemlisi gelmez alfanümerik karakterler işlemek gerekir; aksi gerçeğini gözardı değil uzay karakterleri işlemek gerekir. Bu, önemli ölçüde daha az bayt kullanan 'komut' sözdizimini kullanabileceğimiz anlamına gelir.

MATLAB, 27 bayt

Bütünlüğü için, burada keyfi girdi işleyebilecek bir sürümü:

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

Dizeyi alarak adsız bir işlev tanımlar tve onu programa dönüştürür. İlginç bir şekilde, bu ne mat2stryapılması gerektiği konusunda farklı fikirlere sahip gibi görünen Octave'da çalışmaz.


Bunu test edemiyorum ama bence: @(t)['disp ',mat2str(t)]çalışmalı mı ...?
Stewie Griffin,

@StewieGriffin Bu işe yaramaz çünkü mat2strkomut sözdiziminde gerekli olmayan tırnak işaretleri ekler. mat2strGirdideki boşlukları işlemek için fonksiyon sözdizimi ile bir araya gelmiştim , ancak zorluğu yeniden okuduktan sonra, bayt sayısını neredeyse yarı yarıya kesmek aslında gerekli değil. Teşekkürler!
Sanchises,

Girişte boşluklar varsa tırnak işaretlerinin gerekli olduğunu düşündüm ama yanılıyor olabilirim. Girdilerin de sadece alfasayısal olduğunu fark etmedim ...
Stewie Griffin


@StewieGriffin Haklısın, komut sözdiziminin çalışma şeklini yanlış değerlendirdim. Ancak, komut sözdizimi sürprizlerle dolu görünüyor: Çevrimiçi deneyin!
Sanchises,

3

Befunge-98 (FBBI) , 21 16 12 bayt

NieDzejkob sayesinde -5 bayt Jo King
sayesinde -4 bayt

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

Çevrimiçi deneyin!

't,'e,'s,'t,@Bir giriş için çıkışlartest

Nasıl?

İşaretçi başlangıçta Doğu'ya hareket eder:

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

Başka giriş ~kalmadıysa, işaretçinin yönünü tersine çevirir:

 ,           print @
#            skip nothing
           @ terminate

3

Emojicode , 88 bayt

🐖😍➡️🔡🍇🍎🍪🔤🏁🍇😀❌🔤🔤🐕🔤❌🔤🍉🔤🍪🍉

Çevrimiçi deneyin!

Giriş:

anyString

Çıktı:

🏁🍇😀🔤anyString🔤🍉

Script Çıkışı:

anyString

2

QBIC , 7 bayt

?@?@`+;

açıklama

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

Örnek çalışma

Command line: lala
?@lala

Çıktı, daha önce bir PRINTkomutla gelen girişi içeren bir dize değişkenidir .


2

Toplu 11 bayt

Eminim küçülecek bir yer vardır, ama bu oldukça küçük.

set/p=echo 

Arıza:

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

İngilizcede:

Kullanıcıdan, öncü bir cümle ile giriş istenir echo. Daha sonra kullanıcı ne olursa olsun yazabilir ve program sonlandırılır (örneğin; echo hello world!). Bu bizi koştuğunda çıktı verecek bir programla bırakır hello world!.

Evet, boşluk olması gerekiyordu


Toplu işlemi bilmiyorum (ve bu uzun zaman önceydi), ama bu yanlış görünüyor. Bölüm echokonsola metin eklenir ve program çıktısı olmaz mıydı?
Jakob

@ Jakob suprosingly hayır, aslında ilk meydan okumada verilen python örneğine işlevsel olarak eşdeğerdir.
Graviton

Hata, demek istediğim, programın kullanıcının yazdığı metni çıkarmasından şüpheliyim. Muhtemelen konsola yankılandı, değil mi?
Jakob

@ Jakob Yazdırma için eşdeğer olan Sağ. Örnek, bir eko işlevini benimken yankı yaparken bir yazdırma işlevi yazdırır.
Graviton

Tamam, ancak örnek tüm programı standart olarak yazdırıyor. Programınız yalnızca echo standart çıktı olarak yazdırılıyor . Aslında, (sanırım) giriş bir dosyadan veya borudan geliyorsa, tek göreceğiniz komut istemidir. Bu tür bir çıktıya izin verildi mi?
Jakob

2

V, 2 bayt

ii

Vim'de, iekleme moduna geçer ve metin eklemeye izin verir. Bu durumda, sadece igiriş metninin önüne eklenir (ikinci programı oluşturmak için). V, Vim uyumludur, ancak <esc>programın sonuna bir katma değer ekler , bu yüzden burada endişelenmenize gerek yok.


2

PowerShell, 9 Bayt

"'$args'"

powershell içindeki tek veya çift tırnak, dizeleri içermek için kullanılabilir, ancak yalnızca çift tırnak değişken genişlemeye izin verir.

Bunun bir girişi ile foo, çıktı 'foo'veren geçerli bir powershell programı olan çıktı çıkacaktır.foo


2

Kübik olarak , 87 bayt

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 

Çevrimiçi deneyin!

Cevabımın bir limanı burada . Girdi ve çıktı almak için zaten bir zorluk vardı, bu girdiyi üreten Cubically kodunu yazdım ve Cubically so ... karında bir cevabım oldu.


Birkaç bayt kaydet - argümanları %6s ve @6s'den kaldırın ; şimdi dolaylı olarak adlandırılabilirler. (Bunu, küpleştirici iş parçacığına yazdığınız cevaben de yapabilirsiniz.)
MD XF



1

SOGL V0.12 , 2 bayt

$+

Burada dene! (Yığına girdi bekler, bu nedenle ,kullanım kolaylığı için eklenir)

$iter , +yığındaki girdiden sonra buna katılır.


Için "" `kullanabilirsiniz ".
NoOneIsHere

@HayırHayır, evet, bu mantıklı .. En kullanışlı olduğu yer dışında, her yerde kullandı.
dzaima


1

8 , 34 37 bayt

kod

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

Örnek

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

1

PHP , 12 bayt

<?=$argv[1];

Çevrimiçi deneyin!

Bu, parametre argümanı olarak girişli komut satırından çalıştırılmalıdır. Ve evet, sadece girdi dizgesini çıktılar - fakat bu geçerli PHP:<?php ?> sınırlayıcıların işlenmemiş çıktı.

Test olarak 'test123' girdisi tarafından üretilen senaryo şudur: Çevrimiçi deneyin!


1
giriş dizgisi içeriyorsa <?php, bu tam olarak işe yaramazsa , dikkat edin;)
Andrea

@Andrea Şu soruyu okuyun: "AZ, az ve 0-9 karakterlerinin herhangi bir birleşimini işleyebilmesi gerekir." Yani '<? Php' geçersiz girdi…
WebSmithery

1
aw, bu çok kolay :(
Andrea

1

MATL , 2 bayt

&D

Çevrimiçi deneyin!

Dize , özgün matris (veya bu durumda, dize) verecek bir şey yapmak için özel olarak yapılan bir fonksiyon &Dolan MATL'in MATL'ye eşdeğer olan bir ip kullanarak basitçe dizeyi sarar .mat2streval

Sonuçta ortaya çıkan 'program' sadece tırnaklara sarılı giriş dizisidir, bu nedenle yığına itilir ve örtülü olarak gösterilir.



1

Toplu, 14 bayt

@echo @echo(%*

Özel karakterler "yerine s kullanıldıklarında alıntı yaparlarsa işe yarar ^.


Belki @echo.@echo.%*daha doğru olurdu? Giriş potansiyel olarak boş olabilir.
Conor O'Brien,

@ ConorO'Brien Eh, birincisine ihtiyacım yok .çünkü bu asla boş değil ve (ikinci vaka için kullandım çünkü daha güvenilir ., ancak yine de önerileriniz için teşekkürler!
Neil

np! Ben sadece @echo.s lol arasındaki simetriyi seviyorum
Conor O'Brien

1

Ly , 14 bayt

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

Çevrimiçi deneyin!

açıklama

"\""&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 bayt

Buğday Sihirbazı sayesinde -22 bayt

İçin +2 içerir -cr

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

Çevrimiçi deneyin!

# 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

Havuç 1 bayt

#

Nasıl çalışır

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

Alternatif olarak, 1 byte'ta:

$

Bu, yukarıdakiyle aynı şekilde çalışır, ancak yalnızca girişin ilk satırını alır. Girdi olarak görmek sadece [A-Za-z0-9]bu kadar iyi olacak.


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
Sitemizi kullandığınızda şunları okuyup anladığınızı kabul etmiş olursunuz: Çerez Politikası ve Gizlilik Politikası.
Licensed under cc by-sa 3.0 with attribution required.