用你选择的语言编写一个程序,当你读到它时,它就是一首歌的歌词。它必须是一个有效的程序,可以编译和运行,没有错误。虽然你可以从技术上将所有歌词打印到屏幕上,但我们鼓励你尽可能地使用风格和避免字符串文字。
考虑到这本身是很困难的,你可以写一段样板代码,这不包括歌词中的可读性。但是,一旦代码块开始,必须作为歌曲的歌词读取,在歌曲完成之前,您不能中断它。您可以用注释指示歌曲代码的开头和结尾。也请指定歌词本身,因为你会读的代码。你可以用你的解释“自由”,只要你不偏离写的太远,否则它将花费你的分数。
部分歌词是允许的,虽然你得到了双分的话,一整首歌。裁判分为三大类:
对于每一份意见书,我将在下面的评论中给出你的分数。如果你编辑你的答案,只要给我一个评论指标,我会重新评估它相应。然而,为了公平起见,每一次重新评估都会从你的总分中减去2分.
例如,可以如下所示:
public class Song {
public String play() {
// Song begin
try {
if(this instanceof TheRealLife || this instanceof JustFantasy) {
throw new InALandSlide();
}
} catch (InALandSlide e) {
}
return "No \"FromReality\"";
// Song end
}
public static void main(String [] args) {
Song song = new Song();
song.play();
}
}它被读到:
Is this TheRealLife?
Or is this JustFantasy?
Caught InALandSlide.
No escape \"FromReality\"乐器是不允许的,聪明人。;)
发布于 2012-05-17 13:29:50
这里是刘易斯·卡罗尔的“猎杀咆哮者”中的几节。
它根据诗中所建议的算法计算一个数字,并用它来证明朱布朱布的声音。
class taking:
def __init__(self, n): convenient.val = (n)
def __enter__(self): pass
def __exit__(self, type, value, traceback): pass
def a(x,y): x.val = y(x.val); return True
class We:
def __init__(self): self.val=0
def __add(self, y): return y+sum(self.x)
def add(self, *x): self.x = x; return self.__add
def multiply(self,x,by,diminished_by): self.val *= by-diminished_by
def proceed2divide(self,x,by): self.val /= by
def subtract(self,x): self.val -= x; return True
perfectly = lambda x: x and not not x
def must_be(x):
if x:
print "\n".join(["Tis the %s of the Jubjub!"%["voice","note","song"][x%3] for x in range(out.val)])
return out.val
out=convenient=as_you_see=we=then=the=We()
_ = exactly = 15
with\
\
taking(3) as the_subject_to_reason_about:
a(convenient, #2 state
we.add(7,_ & 10)) and then.multiply(out,
by=1000, diminished_by=8)
the_result = we.proceed2divide(as_you_see,
by=992)
then.subtract(17) and the; answer = must_be(
exactly and perfectly(True))原文如下:
“以3作为主语-- --一个方便的数字-- 我们加了7和10,然后把out乘以1,000被Eight.减了”我们的结果是,如你所看到的,除以992:然后减去17,答案必须精确和完美地be true.。
发布于 2012-05-17 21:03:50
有效的Python代码语法上虽然它没有做任何特别有用的事情;-)
from sys import exit as stops ; import os
thing = [] ; me = can = remember = False ; this = open(__file__)
def terrible(v): return v
# ==== start song snippet
me = can = remember = not any(thing)
can = not this.tell(), [True, "dream"]
locals()["deep"] = {"down":{"inside":{"feel_to":"scream"}}}
if `this` + (terrible("silence")): stops(me)
# ===== end song snippet应如何阅读:
我什么都不记得了。说不出这是真的,或者我内心深处的dream.感觉到了scream.,这种可怕的沉默阻止了me. ... (Metallica - One)
发布于 2014-02-28 05:17:42
有点草率,我写了大约15分钟的笑声。在最新版本的G++/MinGW中编译和运行都很好(但实际做的并不多)。你自己就能解决这个问题,我想:
class Rick {
public:
struct us { bool you; bool me; };
bool giveYouUp() { return false; }
bool letYouDown() { return false; }
bool runAround() { return false; }
bool desertYou() { return false; }
bool makeYouCry() { return false; }
bool sayGoodbye() { return false; }
bool tellALie() { return false; }
bool hurtYou() { return false; }
bool thinkingOf(bool whatImThinkingOf) { return whatImThinkingOf; }
bool justWantTo(bool whatIWantToDo) { return whatIWantToDo; }
bool tellYou(bool whatIWantToTellYou) { return whatIWantToTellYou; }
void roll() {
bool gonna = false;
while (gonna) {
giveYouUp();
letYouDown();
gonna = (runAround() && desertYou());
makeYouCry();
sayGoodbye();
gonna = (tellALie() && hurtYou());
}
bool strangersToLove = true;
us we = {!strangersToLove, !strangersToLove};
bool knowTheRules = true;
bool you = knowTheRules, I = knowTheRules;
bool aFullCommitment = true;
we.me = thinkingOf(aFullCommitment);
int me = 0;
Rick* guys[] = {this, nullptr, nullptr, nullptr, nullptr};
bool howImFeeling = true;
we.me = justWantTo(tellYou(howImFeeling));
bool understand = true;
while (we.you != understand) {
we.you = understand;
}
}
};
int main() {
Rick rick;
rick.roll();
return 0;
}https://codegolf.stackexchange.com/questions/5836
复制相似问题