果酱,0.000884
{_,6/[{64md}6*](124+\+'�f++`"1$~"}""1$~
在此, 表示代码点为128的不可打印字符。请在线尝试。
理念
此方法将代码点在U + 4000000和U + 7FFFFFFF之间的所有UCS字符(原始规范)附加到代码块后的最初为空的字符串中。
我们选择UTF-8,它使用6个字节的字符串对每个字符进行编码,如下所示:
1111110u₂ 10vvvvvv₂ 10wwwwww₂ 10xxxxxx₂ 10yyyyyy₂ 10zzzzzz₂
252 + u 128 + vvvvvv 128 + wwwwww 128 + xxxxxx 128 + yyyyyy 128 + zzzzzz
因此,我们可以通过计算底数为64的6个最低有效数字,然后将252加到最高有效位并将128加到剩余的有效位数,来对第n个字符进行编码。
计分
2 ** 31 = 2,147,483,648
UTF-8字符为6个字节,原始代码的长度为39,所以得分为39 / floor(2 ** 15.5) = 39 / 46340 = 0.0008416055243849806
。
怎么运行的
{ }"" e# Push the code block and an empty string.
1$~ e# Execute a copy of the code block.
_, e# Push the length of the string.
6/ e# Divide by 6 to get the number of chars.
{64md}6* e# Perform modular division six times.
[ ] e# Collect the results in an array.
(124+\+ e# Add 124 to the first element.
'�f+ e# Add 128 to all and cast each to Char.
+ e# Concatenate the strings.
` e# Push a string representation.
"1$~" e# Push '1$~' to complete the quine.