现在的挑战是创建一个程序,在看起来像另一种语言的同时解决任何一个HQ9+问题。
注:这不是高尔夫挑战。
发布于 2013-11-26 10:04:28
Print 'Hello, World!' -- she said.看上去像英语。
发布于 2013-11-29 17:38:24
这个程序是C的,但看起来像(并以Ruby形式运行)。我也设法在里面加了一些空格。
C打印自己的源(不幸的不是quine )。红宝石打印99瓶啤酒和空格表示你好。
#include <stdio.h>
#define def int
#define beer main(int i){char b[1024];
#define print(v) print(int v){
#define end ;}
#define if(x) fputs(b,stdout); fgets(b,1024,f); if(x){
#define else ;} else{
#define puts
#define print
#define open(fn) FILE *f = fopen(fn,"r");
#define while(x) fgets(b,1024,f); while(!feof(f)){
def beer
# define beer
open("test.c")
i=100;
while ( i >= 0 )
if ( i > 0 )
print "#{i} bottle#{i==1&&''||'s'} of beer on the wall, "
puts "#{i} bottle#{i==1&&''||'s'} of beer."
print "Take one down and pass it around, "
puts "#{i-1} bottle#{i==2&&''||'s'} of beer on the wall."
puts
else
puts "No more bottles of beer on the wall, no more bottles of beer."
puts "Go to the store and buy some more, 99 bottles of beer on the wall."
end
i -= 1
end
return 0
end
beer既然这样对ws 这里有一个链接不太好。
发布于 2013-11-23 05:46:44
9一个高尔夫脚本奎因双倍作为一个HQ9+程序,打印的歌词99瓶啤酒。
我知道这不是一个高尔夫挑战,但我无法抗拒用一个角色来回答这个问题的愿望。
https://codegolf.stackexchange.com/questions/15372
复制相似问题