努力工作,做得更好


26

在此挑战中,您的目标是将歌词输出到Daft Punk的“ 更难,更好,更快,更强”。具体来说,输出以下文本:

Work It
Make It
Do It
Makes Us
Harder
Better
Faster
Stronger
More Than
Hour
Our
Never
Ever
After
Work Is
Over

Work It
Make It
Do It
Makes Us
Harder
Better
Faster
Stronger
More Than
Hour
Our
Never
Ever
After
Work Is
Over

Work It Harder Make It Better
Do It Faster, Makes Us Stronger
More Than Ever Hour After
Our Work Is Never Over

Work It Harder Make It Better
Do It Faster, Makes Us Stronger
More Than Ever Hour After
Our Work Is Never Over

Work It Harder Make It Better
Do It Faster, Makes Us Stronger
More Than Ever Hour After
Our Work Is Never Over

Work It Harder Make It Better
Do It Faster, Makes Us Stronger
More Than Ever Hour After
Our Work Is Never Over

Work It Harder Make It Better
Do It Faster, Makes Us Stronger
More Than Ever Hour After
Our Work Is Never Over

Work It Harder Make It Better
Do It Faster, Makes Us Stronger
More Than Ever Hour After
Our Work Is Never Over

Work It Harder Make It Better
Do It Faster, Makes Us Stronger
More Than Ever Hour After
Our Work Is Never Over

Work It Harder, Make It
Do It Faster, Makes Us
More Than Ever, Hour
Our Work Is Never Over

Work It Harder Make It Better
Do It Faster, Makes Us Stronger
More Than Ever Hour Af-
Our Work Is Never Over

Work It Harder Make It Better
Do It Faster, Makes Us Stronger
More Than Ever Hour Af-
Our Work Is Never Over

Work It Harder Make It Better
Do It Faster, Makes Us Stronger
More Than Ever Hour Af-
Our Work Is Never Over

Work It Harder
Make It Better
Do It Faster Makes Us Stronger
More Than Ever Hour
Our Work Is Never Over

Work It Harder
Do It Faster
More Than Ever
Our Work Is Never Over

Work It Harder
Make It Better
Do It Faster
Makes Us Stronger
More Than Ever
Hour After
Our Work Is Never Over

您的输出可能包含尾随换行符或尾随空格。

不允许使用内置压缩方法。

这是代码高尔夫球,所以最短的代码获胜!


1
@feersum是的,如果您听这首歌,可以看到他开始说“之后”,然后停下来。我添加了连字符以显示中断并激怒人们。不过,如果您愿意,我可以将其删除。
TreFox

9
我很震惊,没有像HQ9+Daft-Punk这样的esolang ...
Fatalize 2015年

3
我认为您至少应该禁止内置压缩方法。
瑕疵的

9
“环游世界”的歌词会更容易。;)
Reto Koradi

3
这首歌是我脑海中的第一首歌,不是 Rickroll的复制品。我将其带到meta meta.codegolf.stackexchange.com/q/6956/15599
Level River St

Answers:


11

红宝石,308 303

puts a='Work It|Make It|Do It|Makes Us|Harder|Better|Faster|Stronger|More Than|Hour|Our|Never|Ever|After|Work Is|Over

'.split(?|),a
56.times{|i|puts a[j=i%4/2*4+i%4*2]+' '+a[j+4]+[[' ',', ','
']["l4yq62lhgnizb0kfu".to_i(36)/3**i%3]+a[j+1]+' ',''][i%51/48]+[a[j+5],['','Af-'][i%44/32]][7619655>>i-28&1]}

算法

歌曲简介:提取16个令牌,并打印两次(最后一个带有额外的换行符)

诗句:将标记串在一起,按以下顺序制作诗句,每行4个标记:

 0  4  1  5
 2  6  3  7
 8 12  9 13
10 14 11 15

在某些行中,最后一个标记被省略或交换Af-。这些行在魔术数字0x744447 = 7619655中以1位表示。

在三行中,倒数第二个令牌也被省略,其中 i%51/48==1

行中间的标点可以是之一' ' ', ' '\n'。这些编码为数字02220010000200100010001001110010001000100010001000100010(以3为基)=“ l4yq62lhgnizb0kfu”(以36为基)。

有评论

puts a='Work It|Make It|Do It|Makes Us|Harder|Better|Faster|Stronger|More Than|Hour|Our|Never|Ever|After|Work Is|Over

'.split(?|),a                                                    #Set up array containing all 16 tokens, print it, and print it again (note newlines at end of last token.)

56.times{|i|                                                     #14 verses, 4 lines each

puts a[j=i%4/2*4+i%4*2]+                                         #expression cycles through 0,2,8,10. Print the first token on the line.

' '+a[j+4]+                                                      #print a space, and the second token on the line.

[[' ',', ','
']["l4yq62lhgnizb0kfu".to_i(36)/3**i%3]+a[j+1]+' ',''][i%51/48]+ #if i%51/48==1,print nothing. Otherwise print the 3rd token, followed by a space, and preceded by one of ' ' or ', ' or '\n'

[a[j+5],['','Af-'][i%44/32]][7619655>>i-28&1]                    #if 7619655>>i-28&1==0 print the fourth token. Otherwise print either nothing or Af- depending on the value of i%44/32

}

9

Perl中,316个 309 308 307字节

来源必须编码为Latin-1。

@c=split b,'
Â×
Ô
ÚáÐÙáÒ
ÅOÆÖáEváAftáØ
bÑÏábÝà
bÑÈ-
bÈÇÈÇbHoÆbur
btáÑbÏßËÌÊßÉbHoÜAfbÔ ÒÍbÝà ÐÎber, b Evb× ÙbÓ ÚbBettábOÜØ ÖßbStrongáÛbÕ
ÞàbÝs UsbOvábNevbDoàbÞ IsbFastbHardbMore Thanbur bMakebWorkber b Itber
';$e='ÞàÀÓÀÄÄÄÈÇÏÌÂÎÌÔ
ÛÍÌÅÃÃÃÁËßÊßÅÁÎáÛÍáÁËáÊáÉÇÕ';$f=chr$_+192,$e=~s/$f/$c[$_]/g for 0..34;print$e

说明

我们从原始歌词开始。为简便起见,我们假设它们是

lyrics = "Work Work Harder Harder"

现在,我们发现经常出现的短子字符串(≥3个字符)。在这种情况下,"Work "发生两次。我们将每个匹配项替换为字符0xE1。我们还记得数组中被替换的字符串:

lyrics = "ááHarder Harder"
substs = ["Work "]

下一个子字符串"Harder"替换为0xE0。所述substs阵列生长朝向前方:

lyrics = "ááà à"
substs = ["Harder", "Work "]

这将继续进行总共34次迭代,直到获得字符0xC0。

现在,我们将substs使用字符b(在歌词中不会出现)作为分隔符进行连接。在Perl代码中,将substs数组存储在其中@c(使用裸字b来指示split在何处进行拆分),新的混杂歌词在中$e,并且代码简单地颠倒了34个替换项。


1
有什么解释吗?
feersum

1
@feersum:完成。
Timwi

5

拼写,302字节

:xxnnnnnnnmW12603 27428 3s59qp wb12604280qpb12603 2742803s59qp0wjb:ncvb:mcQb:WcEb:x1203 204203s50607809q0w0y0i0p0j01l0z00:c1263 27428, 3s59:vqp wj:Qqp, w:Eqp wAf-:b0y1liz00:0\n:1Work :2It :3Make:4Do :5 Us :6Harder :7Better\n:8Faster:9Stronger\n:qMore Than :wHour :yOur :iNever :pEver:jAfter :lIs :zOver

我是最近才使用这种语言的,因此我决定通过这一挑战对其进行测试。它输出\ns而不是换行,因为它输出到HTML,但是解释器是用JavaScript编写的。因此,这是一个使用<br>s而不是\ns 的版本:

:xxnnnnnnnmW12603 27428 3s59qp wb12604280qpb12603 2742803s59qp0wjb:ncvb:mcQb:WcEb:x1203 204203s50607809q0w0y0i0p0j01l0z00:c1263 27428, 3s59:vqp wj:Qqp, w:Eqp wAf-:b0y1liz00:0<br>:1Work :2It :3Make:4Do :5 Us :6Harder :7Better<br>:8Faster:9Stronger<br>:qMore Than :wHour :yOur :iNever :pEver:jAfter :lIs :zOver

很有意思。这里有一条规则,要求在挑战之前必须存在语言/口译/编译器。我看不到您的口译员的日期,它何时发布?

@steveverrill我昨天做到了。我想我的答案是无效的。
DanTheMan

3
关于Meta的共识是,它仍然可以发布,但不适用于获胜。您可能应该在回答中添加免责声明,以告知OP
Downgoat

您可以制作er一个令牌吗?
所罗门·乌科

4

GolfScript(275字节)

它包含不可打印的ASCII字符,因此这是一个十六进制转储:

0000000: 3a6b 2757 6f72 6b20 4974 0a4d 616b 6586  :k'Work It.Make.
0000010: 0444 6f8c 0873 2055 730a 4861 7264 6572  .Do..s Us.Harder
0000020: 0a42 6574 7485 0346 6173 8504 5374 726f  .Bett..Fas..Stro
0000030: 6e67 9503 4d6f 7265 2054 6861 6e0a 486f  ng..More Than.Ho
0000040: 7572 0a4f 8203 4e65 76ae 0345 8304 4166  ur.O..Nev..E..Af
0000050: b204 df06 730a 4f96 048c 07ed 7020 d606  ....s.O.....p ..
0000060: 20f4 0720 de07 fb05 20e4 062c 9b05 7320   .. .... ..,..s 
0000070: 5573 20ee 1220 df04 20f3 0420 e406 f903  Us .. .. .. ....
0000080: 20e8 0720 4e65 9b04 eeff eeff eeb6 d206   .. Ne..........
0000090: fe03 e817 df0f 2ce0 05da 5c27 d908 2042  ......,...\'.. B
00000a0: 6574 d303 e017 2053 7472 6f6e 67bd 03e9  et.... Strong...
00000b0: 0ee8 0520 4166 2dec ffec 040a ec1b eb26  ... Af-........&
00000c0: e728 d80c c60f c128 4d61 6b65 d004 4265  .(.....(Make..Be
00000d0: 74c3 04d0 0e9a 0373 2055 7320 5374 726f  t......s Us Stro
00000e0: 6e67 e212 486f e303 4166 fc04 ed16 277b  ng..Ho..Af....'{
00000f0: 6b7b 7b6b 247d 2a30 3a6b 3b7d 7b31 3237  k{{k$}*0:k;}{127
0000100: 2e32 243c 7b2d 3a6b 7d2a 3b7d 6966 7d2f  .2$<{-:k}*;}if}/
0000110: 5d28 2b                                  ](+

这是如何运作的?据我所知,似乎我是唯一使用“轻率而忽略”策略的人,这让我感到惊讶。尽管如此,这意味着我在该答案后面排在第二位。
级圣河

手工编码的Lempel-Ziv。没什么有趣的。这几乎是我试图在meta中提出的要点,但显然不够令人信服。
彼得·泰勒

1
好吧,我确实很失望,很少有人充分利用这首歌的结构。我在Ruby中排在第二位,仅落后您28个字节,这一事实证明了机会在这里。我倾向于认为,将我的答案移植到golfscript中的时间将少于275个字节。你认为不是吗?
级圣河

我在上面尝试了全部的语法生成器,但惊讶于LZ领先于我(尽管贪婪的语法生成器仅落后了一个字节)。但是,如果将这个GolfScript的端口或276字节的贪婪语法方法的端口之一移植到Ruby中而少于303个字节,我就不会感到惊讶。
彼得·泰勒

2

Ruby-643字节

编辑:从899打到830。

编辑2:830-> 755。

编辑3:755-> 684。

编辑4:684-> 670。

编辑5:670-> 643。

我还没有真正使用过红宝石,所以我敢肯定它可以被使用,这只是一个尝试:

l=%w[Work Make Do Harder Better Faster Stronger More Than Hour Our Never Ever After Over Faster,]
i,j,f,u,d=->x{l[x]+' It'},->x,y{l[x]+' It '+l[y]+' '},->a,b,c,d,e{a+' '+b+' '+c+' '+d+' '+e},'s Us ',l[6]
s,q,w,e,r,y,k=f[l[10],l[0],'Is',l[11],l[14]],j[0,3],j[1,4],j[2,15],j[2,5],->d,e{f[l[7],l[8],l[12],d,e]},l[1]+u
t,z,m=e+k,->a{puts q+w,t+d,y[l[9],a],s,''},y['','']
2.times{puts i[0],i[1],i[2],k,l[3],l[4],l[5],d,l[7]+' '+l[8],l[9],l[10],l[11],l[12],l[13],l[0]+' Is',l[14],''}
7.times{z[l[13]]}
puts q+i[1],t,f[l[7],l[8],l[12]+',',l[9],''],s,''
3.times{z['Af-']}
puts q,w,r+k+d,y[l[9],''],s,'',q,r,m,s,'',q,w,r,k+d,m,l[9]+' '+l[13],s

2

JAVA 518/490字节

编辑:不需要7个字节,并添加了带有static {}技巧的Java 6版本Edit2:说明展开

class E{public static void main(String[]_){String l="\n#, #Work#Make#Do#Makes Us#Hard#Bett#Fast#Strong#More#Than#Hour#Our#Nev#Ev#Aft#Af-#Work Is#Ov# #er# It",a="cwadwaewafagvahvaivajvakulamanaovapvaqvasatvaa",z="anusuovutvaa",y="kulupvu",x="cwugv",w="fujva",b=x+"udwuhvuaewuivb"+w,c=b+y+"muqvu"+z,d=x+"bdwaewuivbfakulupvbm"+z,e=b+y+"mur"+z,f=x+"adwuhvaewuivu"+w+y+z+x+"aewuivakulupv"+z+x+"adwuhvaewuiva"+w+"kulupvamuqv"+z,r=a+a+c+c+c+c+c+c+c+d+e+e+e+f;for(char o:r.toCharArray())System.out.print(l.split("#")[o-97]);}}

java6:

class E{static{String l="\n#, #Work#Make#Do#Makes Us#Hard#Bett#Fast#Strong#More#Than#Hour#Our#Nev#Ev#Aft#Af-#Work Is#Ov# #er# It",a="cwadwaewafagvahvaivajvakulamanaovapvaqvasatvaa",z="anusuovutvaa",y="kulupvu",x="cwugv",w="fujva",b=x+"udwuhvuaewuivb"+w,c=b+y+"muqvu"+z,d=x+"bdwaewuivbfakulupvbm"+z,e=b+y+"mur"+z,f=x+"adwuhvaewuivu"+w+y+z+x+"aewuivakulupv"+z+x+"adwuhvaewuiva"+w+"kulupvamuqv"+z,r=a+a+c+c+c+c+c+c+c+d+e+e+e+f;for(char o:r.toCharArray())System.out.print(l.split("#")[o-97]);}}

感谢@Chris Drost的提示,其中包含许多“ ER”。第一个字符串是一个查找表,第二个部分使用小写字母(在ascii中是一个顺序块)作为该表的索引,方法是从该值中减去a的魔术值。

第二部分由多个不同长度的字符串组成(短的字符串是多节经文中共有的部分),这些字符串在循环遍历字符之前被组装成一个长的字符串


好答案!+1我知道已经有1.5年了,但是您可以进行两件事:删除l并使用包含#直接在for-each循环中的所有直接的String ,并将for-each循环更改charintfor(int o:r.toCharArray())System.out.print("\n#, #Work#Make#Do#Makes Us#Hard#Bett#Fast#Strong#More#Than#Hour#Our#Nev#Ev#Aft#Af-#Work Is#Ov# #er# It".split("#")[o-97]);结果为-5字节/ 513字节
凯文·克鲁伊森

2

JavaScript ES6, 440字节 438字节

这是一堆简单的压缩优化。作为单线:

eval("a='w_m_d_u_h_b_f_s_M_H_O_N_E_A_W_VX';b='w hTm b_d f,Tu s_M ETH A_O W N VX';c=bRA/,'Y');o={};'wWork It|mMake It|dDo It|uMakes Us|hHard&bBett&fFast&sStrong&MMore Than|HHour|OOur|NNev&EEv&AAft&WWork Is|VOv&X\\n\\n|YAf-|_\\n|T 'R&/g,'er|').split('|').map(x=>o[x[0]]=x.slice(1));console.log((a+a+b.repeat(7)+bR._/g,'_')R,?T/g,',T')+c+c+c+bRT/,'_')R,/,'')+bR,?T. ._/g,'_')+bR,?T/g,'_'))R\\w/g,x=>o[x]).trim())".replace(/R/g,'.replace(/'))

通过编写为可执行脚本iojs --harmony_arrow_functions file.js。您可以console.log()根据“输出歌词”的含义来减少开销。

说明

执行完external之后.replace(),馈入的代码eval是:

// The first three lines, with each phrase compressed to a single character, newlines
// compressed to _, and block-endings compressed to X. Call this compressed-format.
a = 'w_m_d_u_h_b_f_s_M_H_O_N_E_A_W_VX';

// The compressed-format main block: this is repeated seven times literally but
// every other stanza, besides `a` above, ultimately uses some simple variant
// of this block.
b = 'w hTm b_d f,Tu s_M ETH A_O W N VX';
// The new character T above is a new character we're adding to compressed-format, it is
// a space in the main block but also a hook for some regular expressions later.

// We need one more entry in compressed-format: some blocks, here assigned to
// the variable `c`, shorten "After" to Y = "Af-".
c = b.replace(/A/, 'Y');

// Now we want to build a lookup table for this compressed format above. That is done by
// these lines, which have also been compressed:
o={};
'wWork It|mMake It|dDo It|uMakes Us|hHard&bBett&fFast&sStrong&MMore Than|HHour|OOur|NNev&EEv&AAft&WWork Is|VOv&X\n\n|YAf-|_\n|T '
    .replace(/&/g, 'er|')
    .split('|')
    .map(x => o[x[0]] = x.slice(1));
// The fact that so many fragments end in 'er' allows us to actually shave a couple 
// bytes above, but the compression scheme is fundamentally creating a dict like
//     {a: "Phrase 1", b: "Phrase 2", c: "Phrase 3", d: "Phrase 4"}
// from the string "aPhrase 1|bPhrase 2|cPhrase 3|dPhrase4".

// Now we have the part that actually does the work:
console.log(
    ( // build-string phase
        // first two opening blocks `a`
        a + a + 

        // seven repetitions of `b`
        b.repeat(7) +

        // a version of `b` without final words and with commas before each T.
        b.replace(/._/g, '_').replace(/,?T/g, ',T') + 

        // three repetitions with the 'Af-' suffix.
        c + c + c + 

        // one with the first T converted into a newline and no commas
        b.replace(/T/, '_').replace(/,/, '') + 

        // one with only the first halfs of the three lines
        b.replace(/,?T. ._/g, '_') + 

        // one with no commas and all T's converted to newlines.
        b.replace(/,?T/g, '_')
    ) // end build-string phase
    // Now we convert from compressed-format to actual format
    .replace(/\w/g, x => o[x])
    // We are only told that one trailing newline is allowed; we have two extra:
    .trim() 
)

荣誉

  • @vihan,让我想起了ES6还有一个.repeat针对字符串的闪亮新功能,节省了2个字节。

你也许可以使用b.repeat(7),而不是b+b+b+b+b+b+b
Downgoat

1

PowerShell,659字节

$a=@(" ","`n",",","Stronger","Make It","Do It","Makes Us","Harder","Better","Faster","Work It","More Than","Hour","Our","Never","Ever","After","Work Is","Over","Af-")
$z="1000070"
$y="01130017001400180101"
$x="010500090200060"
$v="00301110015001200"
$b="100104010501060107010801090103011101120113011401150116011701180101"
$c=$z+"0040008$x$v"+"16$y"
$d=$z+"20004$x"+"1110015020012$y"
$e=$z+"0040008$x$v"+"19$y"
$f=$z+"10400080105000900060003011100150012$y"
$g=$z+"105000901110015$y"+"10000701040008010500090106000301110015011200160113001700140018"
$($b,$b,$c,$c,$c,$c,$c,$c,$c,$d,$e,$e,$e,$f,$g|%{for($i=0;$i-lt$_.length;$i+=2){$a[$_.Substring($i,2)]}})-join''

创建一个关键字数组$a,然后使用一系列发送到for循环中的数字字符串对歌词进行编码。该循环采用两位数的子字符串,从$a数组中提取相应的关键字,最后将-join''其全部串联在一起。

我认为这与该方法可以完成的效果一样好,因为每次我尝试进一步打高尔夫球时(例如,用040008新变量替换),结果却要长几个字节,因为子字符串的长度不足以考虑所有需要的额外报价。尽管自从我开始以来发布了一些新的答案,它们的方法略有不同,看起来在PowerShell中可能会更短(例如,使用ASCII字符进行编码,而不是两位数字?),我还是坚持使用这个。

编辑-忘记了我使用的替换编码:

00  <space>
01  `n
02  ,
10  Work It
04  Make It
05  Do It
06  Makes Us
07  Harder
08  Better
09  Faster
03  Stronger
11  More Than
12  Hour
13  Our
14  Never
15  Ever
16  After
17  Work Is
18  Over
19  Af-

如果您有一种方法来获取易于使用的字符的ASCII码,则应该可以减少一堆字节
masterX244 2015年

1

GolfScript,打高尔夫球的 251字节

'Work It
Make It
Do It
Makes Us
Harder
Better
Faster
Stronger
More Than
Hour
Our
Never
Ever
After
Work Is
Over

'2*.n/:a;56,{:@4%.2&+2*:^a=' ':|4^+a='jSRSSS]SSSSSST'81base 3@?/3%[|', 'n]=^)a=+@ 51%48/!*|237118176 2 55@-?/1&@44%32/'Af-'*5^+a=if^9/n*n}/

在线尝试!

相应地消除了不必要[]和简化的代码。改变ij@^为允许去除空白的。将首次分配' '给的变量,|以避免重复相同的三个字符。

GolfScript,第一次工作版本262字节

'Work It
Make It
Do It
Makes Us
Harder
Better
Faster
Stronger
More Than
Hour
Our
Never
Ever
After
Work Is
Over

'2*.n/:a;56,{:i;[i 4%.2&+2*:j a=' '4j+a='jSRSSS]SSSSSST'81base 3i?/3%[' '', 'n]=j)a=+i 51%48/!*' '237118176 2 55i-?/1&i 44%32/'Af-'*5j+a=if j 9/n*n]}/

在线尝试!

这是使用相同的基本算法将我的Ruby答案移植到golfscript中的步骤:输出标记的列表两次,然后将其平滑地转换为经文,然后逐行构建经文,以调整每个经文的特性。

有一些区别。正确的中线标点符号位于基数81中(方便地,这使得每节可打印一个ascii字符);并且修改了编码是否打印最后一个令牌的数字,因为使用了索引(55-i而不是索引)i-28(发现后者会导致负幂生成小数而不是截断为整数的问题)。

已评论

'Work It
Make It
Do It
Makes Us
Harder
Better
Faster
Stronger
More Than
Hour
Our
Never
Ever
After
Work Is
Over

'2*                                               #make a string of all the tokens twice and push on the stack
.n/:a;                                            #duplicate the string, split into tokens at newline to form array. Assign to a
56,{:i;                                           #iterate through i= (0..55) 
  [i 4%.2&+2*:j                                   #calculate j=(i%4+(i%4&2))*2 to cycle through 0 2 8 10.
  a=' '                                           #leave a[j] on stack followed by space (token A)
  4j+a=                                           #leave a[j+4] on stack (token B))
  'jSRSSS]SSSSSST'81base 3i?/3%[' '', 'n]=j)a=+   #leave ' ' ', ' or newline on stack as appropriate followed by a[j+1] (token C)
  i 51%48/!*                                      #multiply the data described in the previous line by  !(i%51/48)  (1 or 0)
  ' '                                             #leave a space on the stack
  237118176 2 55i-?/1&                            #leave 237118176/2**55-i & 1 on stack (true or false indicates token D required)
  i 44%32/'Af-'*5j+a=                             #leave i%44/32= 0 or 1 copies of 'Af-' on the stack. Leave a[j+5] on the stack.  
  if                                              #depending on value of last but one line, select an option from the previous line.
  j 9/n*n]                                        #leave a newline on the stack. if 9/n is 1 or more (last line of verse) leave an additional newline
}/                                                #close the loop
                                                  #printing done by implied stack dump on program exit.

252个字节。使用未使用的符号作为变量名称以避免空格,并" "在变量中存储空格()。同样,在没有习惯地分配变量后也不要弹出。
暴民埃里克(Erik the Outgolfer)'18年

@EriktheOutgolfer感谢您的提示,但我已经发布了包含其中大多数内容的251字节版本。在51我错过之前,您发现了一个空间。我将在以后修复它,并可能会寻找其他缩短它的方法。这是我的第一个golfscript程序,当将符号用作变量时,我很难读懂它们,因此,至少到现在,我还保留了262字节的第一个工作版本。
级圣河

啊,你显然做到了,大声笑。
暴民埃里克(Erik the Outgolfer)'18年

0

Python-1056个字符

a,b,d,s,w,i,t,e,f,h,H,mi,mu,mt,ad,n,o,O="After","Better","Do It ","Stronger","Work ","Is ","It ","Ever ","Faster ","Harder ","Hour ","Make It ","Makes Us ","More Than ","Af-","Never ","Our ","Over"
owinO=o+w+i+n+O
mus=mu+s
df=d+f
dfmu=df[0:-1]+", "+mu
dfmus=df+mus
dfcmus=df[0:-1]+", "+mus
ha=h+a
Ha=H+a
mib=mi+b
mte=mt+e
mteh=mte+H
mtech=mte[0:-1]+", "+H
mtehad=mteh+ad
mteha=mteh+a
wi=w+i
wt=w+t
wth=wt+h
wthmt=wth[0:-1]+", "+mi
wthmib=wth+mi+b
E = ""
l =[wt,mi,d,mu,h,b,f,s,mt,H,o,n,e,a,wi,O,E,wt,mi,d,mu,h,b,f,s,mt,H,o,n,e,a,wi,O,E,wthmib,dfcmus,mteha,owinO,E,wthmib,dfcmus,mteha,owinO,E,wthmib,dfcmus,mteha,owin
O,E,wthmib,dfcmus,mteha,owinO,E,wthmib,dfcmus,mteha,owinO,E,wthmib,dfcmus,mteha,owinO,E,wthmib,dfcmus,mteha,owinO,E,wthmt,dfmu,mtech,owinO,E,wthmib,dfcmus,mteha
d,owinO,E,wthmib,dfcmus,mtehad,owinO,E,wthmib,dfcmus,mtehad,owinO,E,wth,mib,dfmus,mteh,owinO,E,wth,df,mte,owinO,E,wth,mib,df,mus,mte,Ha,owinO]

for ln in l:
    print ln

变量名称仍有改进的空间,但这是一个开始。


2
单独列出所有变量名的列表可能会有所帮助,这样您可以轻松查看尚未使用的单个字母,然后搜索替换您的长变量名?
trichoplax

0

Ruby,486个字节

i=%w(Work\ It Make\ It Do\ It Makes\ Us Harder Better Faster Stronger More\ Than Hour Our Never Ever After Work\ Is Over)
z=i[1]+p+i[5]
y=i[2]+p+i[6]
x=z+n+y
w=i[3]+p+i[7]
v=i[8]+p+i[12]
u=w+n+v
t="Our "+i[14]+" Never Over"
s=i[0]+p+i[4]
r=i[9]+p+i[13]
n="\n"
p=' '
m=', '
a=i.join n
q=n+t
l=s+n
b=s+p+x+m+u+p+r+q
c=s+m+i[1]+n+y+m+i[3]+n+v+m+i[9]+q
d=b.gsub("After","Af-")
e=l+x+p+u+p+i[9]+q
f=l+y+n+v+q
g=l+x+n+u+n+r+q
def o s
s+"

"
end
puts o(a)*2+o(b)*7+o(c)+o(d)*2+o(d)+o(e)+o(f)+g

0

Ruby,483个字节

puts "#{'a buc bud bucs eufuguhuiuj kulumuoupuqua rutuu'*2}#{'a b f c b gud b h, cs e iuj k p l qum a r o tuu'*7}a b f, c bud b h, cs euj k p, lum a r o tuu#{'a b f c b gud b h, cs e iuj k p l num a r o tuu'*3}a b fuc b gud b h cs e iuj k p lum a r o tuua b fud b huj k pum a r o tuua b fuc b gud b hucs e iuj k pul qum a r o tu".gsub /./,Hash[[*?a..?u,' ',','].zip %w{Work It Make Do Us Harder Better Faster Stronger More Than Hour Our Af- Never Ever After Is s Over}+[?\n,' ',',']]

通过将歌曲中使用的每个单词编码为单个字母,乘以一些节,然后用实际的歌词替换编码后的字母,从而工作。逗号,请保留空格。u是换行符。


2
复活节彩蛋:包含短语fuc b gud
dkudriavtsev

0

PHP,434字节

$m="Make It";$b="$m Better";$o="Our Work Is Never Over
";$u="Makes Us";$s="$u Stronger";$d="Do It";$f="$d Faster";$e="More Than Ever";$h="Hour";$w="Work It Harder";echo strtr("001111111$w, $m
$f, $u
$e, $h
$o
222$w
$b
$f $s
$e $h
$o
$w
$f
$e
$o
$w
$b
$f
$s
$e
$h After
$o",["Work It
$m
$d
$u
Harder
Better
Faster
Stronger
More Than
$h
Our
Never
Ever
After
Work Is
Over

","$w $b
$f, $s
$e $h After
$o
","$w $b
$f, $s
$e $h Af-
$o
"]);

在线尝试!

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.