(2493)/ 15500 = 996.0
-C\|l"\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !#$%&\'()*+,./0123456789:;<=>?@ABDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijkmnopqrstuvwxyz{}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0¡¢£¤¥¦§¨©ª«¬\xad®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ
所有转义字符都是单个字节-为了简化复制和粘贴,我以这种形式介绍了该程序。该链接指向没有转义字符的完整程序;可以看出,有很多占位符表示使用的不可打印字符。
尽管我在浏览其他条目之前就写下了答案,但所使用的方法与lirtosiast的TI-BASIC答案类似。电源线的工作方式如下:
-C\|l"...
\| "|"
C Character code of the above, i.e. 124
- Subtract from the above...
l"... ... the length of the trailing string - the closing quote is inferred
该字符串由除0(NULL),127(backspace)和样板字符(-C\|l"
)以外的每个单字节字符组成。这样,可以一次删除一个字符串的每个字符,以生成长度为248的字符串,该字符串的长度减小到0。这些程序产生的结果范围为[-124-124],绝对值的总和为15500。
该代码是使用以下程序生成的:
+J"-C\\|l\""sCM-U256+CMJ,Z127
J"-C\\|l\"" Assign the boilerplate code to J
CMJ Get the character code of each character in J
+ ,Z127 Append 0 and 127
-U256 Get values in range [0-256) which are not in the above
CM Get each character with code points in the above
s Concatenate into string
+J Prepend boilerplate
并从每个被截断的程序生成的数字的总和与此程序一起找到:
sm.a.vd>._+J"-C\\|l\""sCM-U256+CMJ,Z127 5
+J"-C\\|l\""sCM-U256+CMJ,Z127 The full program string, as above
._ Get the prefixes of the above
> 5 Discard the first 5 (those prefixes which don't include all the boilerplate code)
m Map each of the above to:
.vd Evaluate as Pyth code
.a Take the absolute value of the above
s Take the sum