T-SQL,341338字节
DECLARE @ CHAR(2000)=REPLACE(REPLACE(REPLACE(
'PRINT SPACE(14*6&$6*15&$4*5$4*10&$2*4$7*7$1*4&$1*3$8*4$1*3$3*3&*3$9*4$1*3$4
*3&*3$8*4$2*3$4*3&*3$8*4$2*3$4*3&*3$7*4$3*3$4*3&*3$7*4$3*3$4*3&*3$6*11$4*3&
*3$6*11$4*3&*3$5*4$5*3$4*3&*3$5*3$6*3$4*3&$1*4$2*4$11*4&$2*8$9*6&$6*17&$6*3)'
,'*',')+REPLICATE(''#'','),'$',')+SPACE('),'&',')+(''
''')EXEC(@)
前四个换行符仅供参考,最后一个换行符是字符串文字的一部分。
与我向Adam West致敬类似,我手动编码了一个长字符串,并进行了以下替换:
*7
被替换 +REPLICATE('#',7)
$4
被替换 +SPACE(4)
&
被引号内的换行符代替
这将导致大量的 SQL命令字符串:
PRINT SPACE(14)+REPLICATE('#',6)+('
')+SPACE(6)+REPLICATE('#',15)+('
')+SPACE(4)+REPLICATE('#',5)+SPACE(4)+REPLICATE('#',10)+('
')+SPACE(2)+REPLICATE('#',4)+SPACE(7)+REPLICATE('#',7)+SPACE(1)+REPLICATE('#',4)+('
')+SPACE(1)+REPLICATE('#',3)+SPACE(8)+REPLICATE('#',4)+SPACE(1)+REPLICATE('#',3)+SPACE(3)+REPLICATE('#',3)+('
')+REPLICATE('#',3)+SPACE(9)+REPLICATE('#',4)+SPACE(1)+REPLICATE('#',3)+SPACE(4)+REPLICATE('#',3)+('
')+REPLICATE('#',3)+SPACE(8)+REPLICATE('#',4)+SPACE(2)+REPLICATE('#',3)+SPACE(4)+REPLICATE('#',3)+('
')+REPLICATE('#',3)+SPACE(8)+REPLICATE('#',4)+SPACE(2)+REPLICATE('#',3)+SPACE(4)+REPLICATE('#',3)+('
')+REPLICATE('#',3)+SPACE(7)+REPLICATE('#',4)+SPACE(3)+REPLICATE('#',3)+SPACE(4)+REPLICATE('#',3)+('
')+REPLICATE('#',3)+SPACE(7)+REPLICATE('#',4)+SPACE(3)+REPLICATE('#',3)+SPACE(4)+REPLICATE('#',3)+('
')+REPLICATE('#',3)+SPACE(6)+REPLICATE('#',11)+SPACE(4)+REPLICATE('#',3)+('
')+REPLICATE('#',3)+SPACE(6)+REPLICATE('#',11)+SPACE(4)+REPLICATE('#',3)+('
')+REPLICATE('#',3)+SPACE(5)+REPLICATE('#',4)+SPACE(5)+REPLICATE('#',3)+SPACE(4)+REPLICATE('#',3)+('
')+REPLICATE('#',3)+SPACE(5)+REPLICATE('#',3)+SPACE(6)+REPLICATE('#',3)+SPACE(4)+REPLICATE('#',3)+('
')+SPACE(1)+REPLICATE('#',4)+SPACE(2)+REPLICATE('#',4)+SPACE(11)+REPLICATE('#',4)+('
')+SPACE(2)+REPLICATE('#',8)+SPACE(9)+REPLICATE('#',6)+('
')+SPACE(6)+REPLICATE('#',17)+('
')+SPACE(6)+REPLICATE('#',3)
运行时会产生必要的输出。
很长,但是仍然比我最好的基于集合的解决方案(463个字节)更好:
SELECT SPACE(a)+REPLICATE('#',b)+SPACE(c)+REPLICATE('#',d)
+SPACE(e)+REPLICATE('#',f)+SPACE(g)+REPLICATE('#',h)
FROM(VALUES(7,0,7,6,0,0,0,0),(6,8,0,7,0,0,0,0),(4,5,4,5,0,5,0,0),(2,4,7,7,1,4,0,0),
(1,3,8,4,1,3,3,3),(0,3,9,4,1,3,4,3),(0,3,8,4,2,3,4,3),(0,3,8,4,2,3,4,3),
(0,3,7,4,3,3,4,3),(0,3,7,4,3,3,4,3),(0,3,6,6,0,5,4,3),(0,3,6,6,0,5,4,3),
(0,3,5,4,5,3,4,3),(0,3,5,3,6,3,4,3),(1,4,2,4,5,0,6,4),(2,8,9,6,0,0,0,0),
(6,9,0,8,0,0,0,0),(6,3,0,0,0,0,0,0))t(a,b,c,d,e,f,g,h)