古老的爱尔兰祝福


14

我不知道是谁创造了这些词,而且我不是爱尔兰人,但我给您带来爱尔兰祝福:

May the road rise up to meet you
May the wind be always at your back
May the sun shine warm upon your face
The rains fall soft upon your fields
And until we meet again
May God hold you in the hollow of His hand

我本打算从现在起几周后发布此消息,但我突然意识到昨天是圣帕特里克节。

规则:

  • 准确产生以上文字。
    (为了聪明和娱乐,可以随意违反此规则。)
  • 该程序必须自行生成文本。 cat不是有效的解决方案。
  • 字符最少的解决方案“获胜”。

从互联网获得的祝福的版本中,我看到措辞略有不同,因此我尝试将它们平均化。请使用上面发布的版本。另外,我删除了标点符号以使其更容易一些。

祝爱尔兰人的好运en绕你。

Answers:


2

05AB1E,117字节

'€¿“‡âŽÓ€î€†€€èÊ€‚“„€Ë‡´).ªðý“€¿€€†â£ƒ€¾€„‰Ã€î““€¿€€ïë€ï‡Š€›€ž‚ƒ““€¿€€‡µã»©ÃˆÉ€žŠÑ““€€¥·sŽ§š¼ˆÉ€ž™æ““€ƒ‡æ€¦‰Ã†î“).ªÀ»

在线尝试!

'€¿                 "may"
“‡âŽÓ€î€†€€èÊ€‚“    "god hold you in the hollow of"
„€Ë‡´               "his hand"
)                   push stack into a list
.ª                  sentence-case each
ðý                  and join by spaces
“€¿€€†â£ƒ€¾€„‰Ã€î“  "may the road rise up to meet you"
“€¿€€ïë€ï‡Š€›€ž‚ƒ“  "may the wind be always at your back"
“€¿€€‡µã»©ÃˆÉ€žŠÑ“  "may the sun shine warm upon your face"
“€€¥·sŽ§š¼ˆÉ€ž™æ“   "the rains fall soft upon your fields
“€ƒ‡æ€¦‰Ã†î“        "and until we meet again"
)                   push stack into a list
.ª                  sentence-case each
À                   rotate list left
»                   join by newlines
                    implicitly print

14

Python,143个字符

#coding:u8
print u'慍⁹桴⁥潲摡爠獩⁥灵琠敭瑥礠畯䴊祡琠敨眠湩⁤敢愠睬祡⁳瑡礠畯⁲慢正䴊祡琠敨猠湵猠楨敮眠牡灵湯礠畯⁲慦散吊敨爠楡獮映污潳瑦甠潰潹牵映敩摬ੳ湁⁤湵楴敷洠敥⁴条楡੮慍⁹潇⁤潨摬礠畯椠桴⁥潨汬睯漠⁦楈⁳慨摮'.encode("u16")[2:]

在codepad.org上运行


8

Haskell,179个字符

e="\n "++['='..'z']++e;i r=[e!!div r 64,e!!r]
main=putStr$i.fromEnum=<<"뒦뾁빭몁뷴릩끷뮸몁뺵끹봁벪몹끾봺뀒릾끹뭪끼뮳멁맪끦뱼릾븁릹끾봺뷁맦먰뀒릾끹뭪끸뺳끸뭮볪끼릷벁뺵봳끾봺뷁뫦먪뀙뭪끷릮본끫릱뱁븴뫹끺뵴볁뾴뺷끫뮪뱩븀놳멁뺳빮뱁뼪끲몪빁리릮변뒦뾁댴멁뭴뱩끾봺끮볁빭몁뭴뱱봼끴뫁덮븁뭦볩뀀"

这利用了爱尔兰人和韩国人之间古老的共同纽带。你们都知道,蕾丝和土豆种植是通过韩国来的,泡菜最早是在都柏林制造的,对吗?


  • 编辑:(mod197- > 184)不需要(为什么:-)); 消除了韩文文本的单独声明。
  • 编辑:(184-> 179)使用了更紧凑的代码集。

哈哈哈,真好!这就是为什么我通常会小心地说“ 字符最少的解决方案”(我相应地编辑了我的帖子)。利用Unicode始终是一种选择,但很少有人接受。
乔伊·亚当斯

利用这种方式是否有可能将我们的四个字符变成三个?
2011年

@FUZxxl:您必须小心:并非在0x0〜0x10FFFF范围内的所有值都可用。有些是被完全禁止的(例如0xD800〜0xDFFF,并且任何以FFFE或FFFF结尾的值),其他某些在给定编程语言的词汇定义中可能是合法的,也可能不是合法的。我之所以在这里选择Hangul,是因为它是一大堆没有漏洞的值,并且在任何Unicode字符串定义中都合法。但是,它的大小仅为〜13位。
MtnViewMark 2011年

MtnViewMark:如果您有两个连续的代理,则它确实有效,并且将是BMP之外的单个代码点。这将要求实现使用UTF-16并将您的角色需求减少
Joey

@Joey-仅当代理的每个外观都以正确的顺序配对时才可以使用代理(从0xD800〜0xDBFF到另一个,从0xDC00〜0xDFFF到另一个)。但是,在Haskell的情况下,它是没有意义的:String是一系列Unicode标量值(U + 0000〜U + D7FF和U + E000〜U + 10FFFF),而不是UTF-16代码单元。请注意,fromEnum返回字符的代码点标量值,而不是某些编码值。
MtnViewMark'3

4

INTERCALL,3421字节

一个简单的解决方案。自动生成,如果有人在想...

INTERCALL IS A ANTIGOLFING LANGUAGE
SO THIS HEADER IS HERE TO PREVENT GOLFING IN INTERCALL
THE PROGRAM STARTS HERE:
PUSH LXXVII
PRINT
PUSH XCVII
PRINT
PUSH CXXI
PRINT
PUSH XXXII
PRINT
PUSH CXVI
PRINT
PUSH CIV
PRINT
PUSH CI
PRINT
PUSH XXXII
PRINT
PUSH CXIV
PRINT
PUSH CXI
PRINT
PUSH XCVII
PRINT
PUSH C
PRINT
PUSH XXXII
PRINT
PUSH CXIV
PRINT
PUSH CV
PRINT
PUSH CXV
PRINT
PUSH CI
PRINT
PUSH XXXII
PRINT
PUSH CXVII
PRINT
PUSH CXII
PRINT
PUSH XXXII
PRINT
PUSH CXVI
PRINT
PUSH CXI
PRINT
PUSH XXXII
PRINT
PUSH CIX
PRINT
PUSH CI
PRINT
PUSH CI
PRINT
PUSH CXVI
PRINT
PUSH XXXII
PRINT
PUSH CXXI
PRINT
PUSH CXI
PRINT
PUSH CXVII
PRINT
PUSH X
PRINT
PUSH LXXVII
PRINT
PUSH XCVII
PRINT
PUSH CXXI
PRINT
PUSH XXXII
PRINT
PUSH CXVI
PRINT
PUSH CIV
PRINT
PUSH CI
PRINT
PUSH XXXII
PRINT
PUSH CXIX
PRINT
PUSH CV
PRINT
PUSH CX
PRINT
PUSH C
PRINT
PUSH XXXII
PRINT
PUSH XCVIII
PRINT
PUSH CI
PRINT
PUSH XXXII
PRINT
PUSH XCVII
PRINT
PUSH CVIII
PRINT
PUSH CXIX
PRINT
PUSH XCVII
PRINT
PUSH CXXI
PRINT
PUSH CXV
PRINT
PUSH XXXII
PRINT
PUSH XCVII
PRINT
PUSH CXVI
PRINT
PUSH XXXII
PRINT
PUSH CXXI
PRINT
PUSH CXI
PRINT
PUSH CXVII
PRINT
PUSH CXIV
PRINT
PUSH XXXII
PRINT
PUSH XCVIII
PRINT
PUSH XCVII
PRINT
PUSH XCIX
PRINT
PUSH CVII
PRINT
PUSH X
PRINT
PUSH LXXVII
PRINT
PUSH XCVII
PRINT
PUSH CXXI
PRINT
PUSH XXXII
PRINT
PUSH CXVI
PRINT
PUSH CIV
PRINT
PUSH CI
PRINT
PUSH XXXII
PRINT
PUSH CXV
PRINT
PUSH CXVII
PRINT
PUSH CX
PRINT
PUSH XXXII
PRINT
PUSH CXV
PRINT
PUSH CIV
PRINT
PUSH CV
PRINT
PUSH CX
PRINT
PUSH CI
PRINT
PUSH XXXII
PRINT
PUSH CXIX
PRINT
PUSH XCVII
PRINT
PUSH CXIV
PRINT
PUSH CIX
PRINT
PUSH XXXII
PRINT
PUSH CXVII
PRINT
PUSH CXII
PRINT
PUSH CXI
PRINT
PUSH CX
PRINT
PUSH XXXII
PRINT
PUSH CXXI
PRINT
PUSH CXI
PRINT
PUSH CXVII
PRINT
PUSH CXIV
PRINT
PUSH XXXII
PRINT
PUSH CII
PRINT
PUSH XCVII
PRINT
PUSH XCIX
PRINT
PUSH CI
PRINT
PUSH X
PRINT
PUSH LXXXIV
PRINT
PUSH CIV
PRINT
PUSH CI
PRINT
PUSH XXXII
PRINT
PUSH CXIV
PRINT
PUSH XCVII
PRINT
PUSH CV
PRINT
PUSH CX
PRINT
PUSH CXV
PRINT
PUSH XXXII
PRINT
PUSH CII
PRINT
PUSH XCVII
PRINT
PUSH CVIII
PRINT
PUSH CVIII
PRINT
PUSH XXXII
PRINT
PUSH CXV
PRINT
PUSH CXI
PRINT
PUSH CII
PRINT
PUSH CXVI
PRINT
PUSH XXXII
PRINT
PUSH CXVII
PRINT
PUSH CXII
PRINT
PUSH CXI
PRINT
PUSH CX
PRINT
PUSH XXXII
PRINT
PUSH CXXI
PRINT
PUSH CXI
PRINT
PUSH CXVII
PRINT
PUSH CXIV
PRINT
PUSH XXXII
PRINT
PUSH CII
PRINT
PUSH CV
PRINT
PUSH CI
PRINT
PUSH CVIII
PRINT
PUSH C
PRINT
PUSH CXV
PRINT
PUSH X
PRINT
PUSH LXV
PRINT
PUSH CX
PRINT
PUSH C
PRINT
PUSH XXXII
PRINT
PUSH CXVII
PRINT
PUSH CX
PRINT
PUSH CXVI
PRINT
PUSH CV
PRINT
PUSH CVIII
PRINT
PUSH XXXII
PRINT
PUSH CXIX
PRINT
PUSH CI
PRINT
PUSH XXXII
PRINT
PUSH CIX
PRINT
PUSH CI
PRINT
PUSH CI
PRINT
PUSH CXVI
PRINT
PUSH XXXII
PRINT
PUSH XCVII
PRINT
PUSH CIII
PRINT
PUSH XCVII
PRINT
PUSH CV
PRINT
PUSH CX
PRINT
PUSH X
PRINT
PUSH LXXVII
PRINT
PUSH XCVII
PRINT
PUSH CXXI
PRINT
PUSH XXXII
PRINT
PUSH LXXI
PRINT
PUSH CXI
PRINT
PUSH C
PRINT
PUSH XXXII
PRINT
PUSH CIV
PRINT
PUSH CXI
PRINT
PUSH CVIII
PRINT
PUSH C
PRINT
PUSH XXXII
PRINT
PUSH CXXI
PRINT
PUSH CXI
PRINT
PUSH CXVII
PRINT
PUSH XXXII
PRINT
PUSH CV
PRINT
PUSH CX
PRINT
PUSH XXXII
PRINT
PUSH CXVI
PRINT
PUSH CIV
PRINT
PUSH CI
PRINT
PUSH XXXII
PRINT
PUSH CIV
PRINT
PUSH CXI
PRINT
PUSH CVIII
PRINT
PUSH CVIII
PRINT
PUSH CXI
PRINT
PUSH CXIX
PRINT
PUSH XXXII
PRINT
PUSH CXI
PRINT
PUSH CII
PRINT
PUSH XXXII
PRINT
PUSH LXXII
PRINT
PUSH CV
PRINT
PUSH CXV
PRINT
PUSH XXXII
PRINT
PUSH CIV
PRINT
PUSH XCVII
PRINT
PUSH CX
PRINT
PUSH C
PRINT
END


3

GolfScript(204个字符)

包含非打印字符,因此复制粘贴可能不起作用:

:k'May the road rise up to meet you
wind be always ar back¢ sun shin¬armÈon€face
Tåainsll soft¡ields
Aäuntil we meet ag²áGod holdø inñlow of His hand'{k{{k$}*0:k;}{127.2$<{-:k}*;}if}/](+

Base64编码:

OmsnTWF5IHRoZSByb2FkIHJpc2UgdXAgdG8gbWVldCB5b3UKnwh3aW5kIGJlIGFsd2F5cyBhnAVy
IGJhY2uiCXN1biBzaGlurANhcm3IA29upAZmYWNlClTlBGFpbnONA2xsIHNvZnShDGllbGRzCkHk
A3VudGlsIHdlIG1lZXQgYWeyA+EFR29kIGhvbGT4BCBpbvEFjgNsb3cgb2YgSGlzIGhhbmQne2t7
e2skfSowOms7fXsxMjcuMiQ8ey06a30qO31pZn0vXSgr

实际上,冗余比您在字符串中所期望的要少。我认为gzip的节省是Lempel-Ziv的2/3和Huffman编码的1/3;我正在使用的基本上是LZ,但我的开销比gzip格式大。

请注意,这是第一个占用少于输出字节的解决方案。


2

Bash / Sed,206个字符

我没有击败彼得·泰勒,但像他的解决方案一样,它的字节数少于原始字节。但是我没有使用无法打印的字符。
sed在类似的“对代码高尔夫无陌生”挑战中很有用。但是我在那里使用了两次,以压缩替换列表。在此,此技巧的文字太短了。

sed 's/Z/May the /;s/W/ uponYr f/;s/Y/ you/'<<X
Zroad rise up to meetY
Zwind be always atYr back
Zsun shine warmWace
The rains fall softWields
And until we meet again
May God holdY in the hollow of His hand

2

PHP,431425字节

<?php $s="May therodisupm\nwnblckfTAgGH";$p=array('01234563','3cd8h328c73m','jj','3e6643');$b=str_split('s781937ab63cd348v28cfsgah93i631jg12b314328c73i1klfsbch3b5ah63g17et1k6fn56371ahb3m1u3b8m4ta6j9bfoh93ch4aj3g6v1p1ahf0123q89358j9328c3ah3456358u8g38m3rab351h9');foreach($b as $x){$x=b($x);if($x>27){$c=str_split($p[$x-28]);foreach($c as $y){echo $s[b($y)];}}else{echo $s[$x];}}function b($a){return base_convert($a,36,10);}

一种映射和基础转换以存储信息的方法。但是,我无法保持程序很小。


1

哈斯克尔-284

s n=words"And God His May The again always at back be face fall fields hand hold hollow in meet of rains rise road shine soft sun the to until up upon warm we wind you your"!!(fromEnum n-48)
main=mapM_(putStrLn.unwords.map s)$words"3IEDLJAQ 3IP967R8 3IHFNMR: 4C;GMR< 0KOA5 31>Q@I?B2="

可悲的是,这比输出或逐字放置字符串要长得多。甚至字符串文字本身(不带引号)总计比输入长两个字符。这个怎么可能?


1

Quetzalcoatl,218字节

"May the road rise up to meet you\nMay the wind be always at your back\nMay the sun shine warm upon your face\nThe rains fall soft upon your fields\nAnd until we meet again\nMay God hold you in the hollow of His hand"

字符串是隐式打印的。

或pyth,217个字节

"May the road rise up to meet you\nMay the wind be always at your back\nMay the sun shine warm upon your face\nThe rains fall soft upon your fields\nAnd until we meet again\nMay God hold you in the hollow of His hand

1

小桶 175个字符

‘3p‘®m‘00‘®t¶©m  ©t  2½;4•;up to 2m;you\n©m  ©t  2⬩;be 0Ȧ;at 0B;0∞;\n©m  ©t  sun kƝ;4Ȧ;0M;0B;0Ƚ;\nThe A④;2÷;4l;0M;0B;8R;\nAnd 0🄄;we 2m;0¡;\n©m  God 1④;you in ©t  dɅ;of His 0║;

谢天谢地,所有长词都在凯格的字典中。仅使用字符串压缩来减少长度。

TIO当前不起作用,因为它需要更新。

在线尝试!


0

ren,248字节

采用这种方法。

System.print("Zroad rise up to meetY\nZwind be always atYr back\nZsun shine warmWace\nThe rains fall softWields\nAnd until we meet again\nMay God holdY in the hollow of His hand".replace("Z","May the ").replace("W"," uponYr f").replace("Y"," you"))

在线尝试!

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.