高尔夫球你的语言的身份


58

标识是表示字符串的哈希值的几何图案的小图像。Stack Exchange 使用Gravatar中的标识作为每个用户的默认头像图像。

在此挑战中,我们还将使用Gravatar identicons生成一些文本以供打高尔夫球。

挑战

这个堆栈片段(此JSFiddle的简化版本)使您可以输入字符串,并返回该字符串的identicon的100×100像素黑白版本,以及1用于黑色和0白色的文本版本:

<!-- Click "Run code snippet" --> <div style='text-align:center;'> <input id='str' type='text' size='32' value='Python'> <button type='button' onclick='go()'>Go</button><br><br><input id='type1' name='type' type='radio' value='identicon' checked> <label for='type1'>Identicon</label> <input id='type2' name='type' type='radio' value='monsterid'> <label for='type2'>Monster</label> <input id='type3' name='type' type='radio' value='wavatar'> <label for='type3'>Wavatar</label> <input id='type4' name='type' type='radio' value='retro'> <label for='type4'>Retro</label> <br><br><a id='origLink'>original</a><br><canvas id='original' style='border:1px solid gray;'> Your browser does not support the canvas tag. </canvas> <br><br>binary<br><canvas id='binary' style='border:1px solid gray;'> </canvas> <br><br>text</br> <textarea id='text' style='background-color:#eee' readonly></textarea> <br><br>your text</br> <textarea id='userText'></textarea><br><button type='button' onclick='markDiffs()'>Mark Differences With X</button><br><br><span id='diffCount'></span> <br><br><small>(this snippet has only been tested in Chrome and Firefox)</small></div><script src='https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js'></script><script>function rgbDist(t,n){return Math.sqrt((Math.pow((t[0]-n[0])/255,2)+Math.pow((t[1]-n[1])/255,2)+Math.pow((t[2]-n[2])/255,2))/3)}function toBinImg(t,n){for(var r=0;r<t.data.length;r+=4){var e=rgbDist([t.data[r],t.data[r+1],t.data[r+2]],[255,255,255])<n;t.data[r]=t.data[r+1]=t.data[r+2]=e?255:0}}function getText(t){for(var n="",r=0,e=0;SIZE>e;e++){for(var o=0;SIZE>o;o++)n+=t.data[r]?"0":"1",r+=4;e!=SIZE-1&&(n+="\n")}return n}function markDiffs(){var t=0,n=$("#text").val().split("\n"),r=$("#userText").val(),e=new RegExp("(?:[01]{"+SIZE+"}\n){"+(SIZE-1)+"}(?:[01]{"+SIZE+"})\n?");if(!r.match(e))return void $("#diffCount").text("bad input");r=r.split("\n");for(var o="",a=0;SIZE>a;a++){for(var i=0;SIZE>i;i++)r[a][i]!==n[a][i]?(o+="X",t++):o+=r[a][i];o+="\n"}r[r.length-1].length&&(o=o.substring(0,o.length-1)),$("#diffCount").text(t+" differences found"),$("#userText").val(o)}function go(){var t=new Image;t.crossOrigin="anonymous",t.src="https://www.gravatar.com/avatar/"+md5($("#str").val())+"?&s="+SIZE+"&d="+$("input:radio[name=type]:checked").val(),$("#origLink").attr("href",t.src),t.onload=function(){ctxOrig.drawImage(t,0,0);var n=ctxOrig.getImageData(0,0,SIZE,SIZE);toBinImg(n,.05),$("#text").val(getText(n)),ctxBin.putImageData(n,0,0)}}var SIZE=100;$("#str").keyup(function(t){13==t.keyCode&&go()}),$("input[name=type]:radio").change(go),$(function(){var t=$("#original"),n=$("#binary");t.prop({width:SIZE,height:SIZE}),n.prop({width:SIZE,height:SIZE}),$("#text").prop({rows:SIZE+5,cols:SIZE+5}),$("#userText").prop({rows:SIZE+5,cols:SIZE+5}),ctxOrig=t[0].getContext("2d"),ctxBin=n[0].getContext("2d"),go()}),!function(t){"use strict";function n(t,n){var r=(65535&t)+(65535&n),e=(t>>16)+(n>>16)+(r>>16);return e<<16|65535&r}function r(t,n){return t<<n|t>>>32-n}function e(t,e,o,a,i,u){return n(r(n(n(e,t),n(a,u)),i),o)}function o(t,n,r,o,a,i,u){return e(n&r|~n&o,t,n,a,i,u)}function a(t,n,r,o,a,i,u){return e(n&o|r&~o,t,n,a,i,u)}function i(t,n,r,o,a,i,u){return e(n^r^o,t,n,a,i,u)}function u(t,n,r,o,a,i,u){return e(r^(n|~o),t,n,a,i,u)}function c(t,r){t[r>>5]|=128<<r%32,t[(r+64>>>9<<4)+14]=r;var e,c,f,g,d,h=1732584193,s=-271733879,v=-1732584194,I=271733878;for(e=0;e<t.length;e+=16)c=h,f=s,g=v,d=I,h=o(h,s,v,I,t[e],7,-680876936),I=o(I,h,s,v,t[e+1],12,-389564586),v=o(v,I,h,s,t[e+2],17,606105819),s=o(s,v,I,h,t[e+3],22,-1044525330),h=o(h,s,v,I,t[e+4],7,-176418897),I=o(I,h,s,v,t[e+5],12,1200080426),v=o(v,I,h,s,t[e+6],17,-1473231341),s=o(s,v,I,h,t[e+7],22,-45705983),h=o(h,s,v,I,t[e+8],7,1770035416),I=o(I,h,s,v,t[e+9],12,-1958414417),v=o(v,I,h,s,t[e+10],17,-42063),s=o(s,v,I,h,t[e+11],22,-1990404162),h=o(h,s,v,I,t[e+12],7,1804603682),I=o(I,h,s,v,t[e+13],12,-40341101),v=o(v,I,h,s,t[e+14],17,-1502002290),s=o(s,v,I,h,t[e+15],22,1236535329),h=a(h,s,v,I,t[e+1],5,-165796510),I=a(I,h,s,v,t[e+6],9,-1069501632),v=a(v,I,h,s,t[e+11],14,643717713),s=a(s,v,I,h,t[e],20,-373897302),h=a(h,s,v,I,t[e+5],5,-701558691),I=a(I,h,s,v,t[e+10],9,38016083),v=a(v,I,h,s,t[e+15],14,-660478335),s=a(s,v,I,h,t[e+4],20,-405537848),h=a(h,s,v,I,t[e+9],5,568446438),I=a(I,h,s,v,t[e+14],9,-1019803690),v=a(v,I,h,s,t[e+3],14,-187363961),s=a(s,v,I,h,t[e+8],20,1163531501),h=a(h,s,v,I,t[e+13],5,-1444681467),I=a(I,h,s,v,t[e+2],9,-51403784),v=a(v,I,h,s,t[e+7],14,1735328473),s=a(s,v,I,h,t[e+12],20,-1926607734),h=i(h,s,v,I,t[e+5],4,-378558),I=i(I,h,s,v,t[e+8],11,-2022574463),v=i(v,I,h,s,t[e+11],16,1839030562),s=i(s,v,I,h,t[e+14],23,-35309556),h=i(h,s,v,I,t[e+1],4,-1530992060),I=i(I,h,s,v,t[e+4],11,1272893353),v=i(v,I,h,s,t[e+7],16,-155497632),s=i(s,v,I,h,t[e+10],23,-1094730640),h=i(h,s,v,I,t[e+13],4,681279174),I=i(I,h,s,v,t[e],11,-358537222),v=i(v,I,h,s,t[e+3],16,-722521979),s=i(s,v,I,h,t[e+6],23,76029189),h=i(h,s,v,I,t[e+9],4,-640364487),I=i(I,h,s,v,t[e+12],11,-421815835),v=i(v,I,h,s,t[e+15],16,530742520),s=i(s,v,I,h,t[e+2],23,-995338651),h=u(h,s,v,I,t[e],6,-198630844),I=u(I,h,s,v,t[e+7],10,1126891415),v=u(v,I,h,s,t[e+14],15,-1416354905),s=u(s,v,I,h,t[e+5],21,-57434055),h=u(h,s,v,I,t[e+12],6,1700485571),I=u(I,h,s,v,t[e+3],10,-1894986606),v=u(v,I,h,s,t[e+10],15,-1051523),s=u(s,v,I,h,t[e+1],21,-2054922799),h=u(h,s,v,I,t[e+8],6,1873313359),I=u(I,h,s,v,t[e+15],10,-30611744),v=u(v,I,h,s,t[e+6],15,-1560198380),s=u(s,v,I,h,t[e+13],21,1309151649),h=u(h,s,v,I,t[e+4],6,-145523070),I=u(I,h,s,v,t[e+11],10,-1120210379),v=u(v,I,h,s,t[e+2],15,718787259),s=u(s,v,I,h,t[e+9],21,-343485551),h=n(h,c),s=n(s,f),v=n(v,g),I=n(I,d);return[h,s,v,I]}function f(t){var n,r="";for(n=0;n<32*t.length;n+=8)r+=String.fromCharCode(t[n>>5]>>>n%32&255);return r}function g(t){var n,r=[];for(r[(t.length>>2)-1]=void 0,n=0;n<r.length;n+=1)r[n]=0;for(n=0;n<8*t.length;n+=8)r[n>>5]|=(255&t.charCodeAt(n/8))<<n%32;return r}function d(t){return f(c(g(t),8*t.length))}function h(t,n){var r,e,o=g(t),a=[],i=[];for(a[15]=i[15]=void 0,o.length>16&&(o=c(o,8*t.length)),r=0;16>r;r+=1)a[r]=909522486^o[r],i[r]=1549556828^o[r];return e=c(a.concat(g(n)),512+8*n.length),f(c(i.concat(e),640))}function s(t){var n,r,e="0123456789abcdef",o="";for(r=0;r<t.length;r+=1)n=t.charCodeAt(r),o+=e.charAt(n>>>4&15)+e.charAt(15&n);return o}function v(t){return unescape(encodeURIComponent(t))}function I(t){return d(v(t))}function l(t){return s(I(t))}function p(t,n){return h(v(t),v(n))}function E(t,n){return s(p(t,n))}function S(t,n,r){return n?r?p(n,t):E(n,t):r?I(t):l(t)}"function"==typeof define&&define.amd?define(function(){return S}):t.md5=S}(this);//thanks https://github.com/blueimp/JavaScript-MD5/blob/master/js/md5.min.js</script>

(它还允许您加载Monster,Wavatar和Retro Gravatar样式,但是这些只是为了娱乐而已,并不意味着可以用于此挑战。不幸的是,由于XSS限制,缺少了Unicornicons。:/

您的任务是编写一个程序,该程序输出在将您的编程语言的名称放入代码段输入框中时生成的100×100个字符0的s和1的文本块。

例如,如果您的提交是用Python编写的,则可以输入Python堆栈片段并查看

Python identicon

是Python的identicon,并且

二进制Python identicon

是黑白(二进制)版本,并且

0000000000000000000000011111111111111111111111111100000000000000000000000010000000000000000000000000
0000000000000000000001111011111111111111111111111100000000000000000000011110000000000000000000000000
0000000000000000000111111011111111111111111111111100000000000000000001111110000000000000000000000000
0000000000000000011111111011111111111111111111111100000000000000000111111110000000000000000000000000
0000000000000001111111111001111111111111111111111100000000000000001111111110000000000000000000000000
0000000000000111111111111001111111111111111111111100000000000000111111111110000000000000000000000000
0000000000001111111111111000111111111111111111111100000000000111111111111110000000000000000000000000
0000000000000011111111111000111111111111111111111100000000011111111111111110000000000000000000000000
0000000000000000111111111000011111111111111111111100000001111111111111111110000000000000000000000000
0000000000000000001111111000001111111111111111111100000011111111111111111110000000000000000000000000
0000000000000000000011111000001111111111111111111100001111111111111111111110000000000000000000000000
0000000000000000000000111000000111111111111111111101111111111111111111111110000000000000000000000000
0000000000000000000000001000000111111111111111111111111111111111111111111110000001000000000001000000
0000000000000000000000111000000111111111111111111111111111111111111111111110000011000000000001100000
0000000000000000000011111000000011111111111111111111111111111111111111111110000011100000000011100000
0000000000000000001111111000000011111111111111111111111111111111111111111110000111100000000011110000
0000000000000000111111111000000001111111111111111111111111111111111111111110000111110000000111110000
0000000000000011111111111000000001111111111111111111111111111111111111111110001111110000000111111000
0000000000001111111111111000000000111111111111111111111111111111111111111110001111111000001111111000
0000000000000111111111111000000000011111111111111111111111111111111111111110011111111000001111111100
0000000000000001111111111000000000011111111111111111111111111111111111111110011111111100011111111100
0000000000000000011111111000000000001111111111111111111111111111111111111110111111111100011111111110
0000000000000000000111111000000000001111111111111111111111111111111111111110111111111110111111111110
0000000000000000000001111000000000001111111111111111111111111111111111111111111111111110111111111111
0000000000000000000000011000000000000111111111111111111111111111111111111111111111111111111111111111
1111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000001
0111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000001111
0111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000111111
0111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000011111111
0011111111111111111111111000000000000000000000000000000000000000000000000000000000000000000111111111
0011111111111111111111111000000000000000000000000000000000000000000000000000000000000000011111111111
0001111111111111111111111000000000000000000000000000000000000000000000000000000000000011111111111111
0001111111111111111111111000000000000000000000000000000000000000000000000000000000001111111111111111
0000111111111111111111111000000000000000000000000000000000000000000000000000000000111111111111111111
0000011111111111111111111000000000000000000000000000000000000000000000000000000001111111111111111111
0000011111111111111111111000000000000000000000000000000000000000000000000000000111111111111111111111
0000001111111111111111111000000000000000000000000000000000000000000000000000111111111111111111111111
0000001111111111111111111000000000000000000000000000000000000000000000000001111111111111111111111111
0000001111111111111111111000000000000000000000000000000000000000000000000001111111111111111111111111
0000000111111111111111111000000000000000000000000000000000000000000000000001111111111111111111111111
0000000111111111111111111000000000000000000000000000000000000000000000000001111111111111111111111111
0000000011111111111111111000000000000000000000000000000000000000000000000001111111111111111111111111
0000000011111111111111111000000000000000000000000000000000000000000000000001111111111111111111111111
0000000001111111111111111000000000000000000000000000000000000000000000000001111111111111111111111111
0000000000111111111111111000000000000000000000000000000000000000000000000001111111111111111111111111
0000000000111111111111111000000000000000000000000000000000000000000000000001111111111111111111111111
0000000000011111111111111000000000000000000000000000000000000000000000000001111111111111111111111111
0000000000011111111111111000000000000000000000000000000000000000000000000001111111111111111111111111
0000000000011111111111111000000000000000000000000000000000000000000000000001111111111111111111111111
0000000000001111111111111000000000000000000000000000000000000000000000000001111111111111111111111111
1111111111111111111111111000000000000000000000000000000000000000000000000001111111111111000000000000
1111111111111111111111111000000000000000000000000000000000000000000000000001111111111111100000000000
1111111111111111111111111000000000000000000000000000000000000000000000000001111111111111100000000000
1111111111111111111111111000000000000000000000000000000000000000000000000001111111111111110000000000
1111111111111111111111111000000000000000000000000000000000000000000000000001111111111111110000000000
1111111111111111111111111000000000000000000000000000000000000000000000000001111111111111111000000000
1111111111111111111111111000000000000000000000000000000000000000000000000001111111111111111000000000
1111111111111111111111111000000000000000000000000000000000000000000000000001111111111111111100000000
1111111111111111111111111000000000000000000000000000000000000000000000000001111111111111111100000000
1111111111111111111111111000000000000000000000000000000000000000000000000001111111111111111110000000
1111111111111111111111111000000000000000000000000000000000000000000000000001111111111111111110000000
1111111111111111111111111000000000000000000000000000000000000000000000000001111111111111111111000000
1111111111111111111111111000000000000000000000000000000000000000000000000001111111111111111111000000
1111111111111111111111110000000000000000000000000000000000000000000000000001111111111111111111100000
1111111111111111111111000000000000000000000000000000000000000000000000000001111111111111111111100000
1111111111111111111100000000000000000000000000000000000000000000000000000001111111111111111111110000
1111111111111111110000000000000000000000000000000000000000000000000000000001111111111111111111110000
1111111111111111000000000000000000000000000000000000000000000000000000000001111111111111111111111000
1111111111111100000000000000000000000000000000000000000000000000000000000001111111111111111111111000
1111111111110000000000000000000000000000000000000000000000000000000000000001111111111111111111111100
1111111111000000000000000000000000000000000000000000000000000000000000000001111111111111111111111100
1111111100000000000000000000000000000000000000000000000000000000000000000001111111111111111111111110
1111110000000000000000000000000000000000000000000000000000000000000000000001111111111111111111111110
1111000000000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111
1100000000000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111
1111111111111111111111111111111111111111111111111111111111111110000000000001100000000000000000000000
1111111111111111111111111111111111111111111111111111111111111111000000000001111000000000000000000000
0111111111110111111111111111111111111111111111111111111111111111000000000001111110000000000000000000
0111111111110011111111110111111111111111111111111111111111111111100000000001111111100000000000000000
0011111111100011111111110111111111111111111111111111111111111111100000000001111111111000000000000000
0011111111000001111111100111111111111111111111111111111111111111110000000001111111111110000000000000
0001111111000001111111100111111111111111111111111111111111111111110000000001111111111111000000000000
0001111111000000111111000111111111111111111111111111111111111111111000000001111111111100000000000000
0000111110000000111111000111111111111111111111111111111111111111111000000001111111110000000000000000
0000111110000000011110000111111111111111111111111111111111111111111100000001111111000000000000000000
0000011100000000011100000111111111111111111111111111111111111111111100000001111100000000000000000000
0000011100000000001100000111111111111111111111111111111111111111111110000001110000000000000000000000
0000001000000000001100000111111111111111111111111111111111111111111110000001000000000000000000000000
0000000000000000000000000111111111111111111111111011111111111111111111000001110000000000000000000000
0000000000000000000000000111111111111111111111100011111111111111111111000001111100000000000000000000
0000000000000000000000000111111111111111111110000011111111111111111111100001111111000000000000000000
0000000000000000000000000111111111111111111000000011111111111111111111100001111111110000000000000000
0000000000000000000000000111111111111111100000000011111111111111111111110001111111111100000000000000
0000000000000000000000000111111111111110000000000011111111111111111111110001111111111111000000000000
0000000000000000000000000111111111111000000000000011111111111111111111111001111111111110000000000000
0000000000000000000000000111111111100000000000000011111111111111111111111001111111111000000000000000
0000000000000000000000000111111110000000000000000011111111111111111111111101111111100000000000000000
0000000000000000000000000111111000000000000000000011111111111111111111111101111110000000000000000000
0000000000000000000000000111100000000000000000000011111111111111111111111111111000000000000000000000
0000000000000000000000000110000000000000000000000011111111111111111111111111100000000000000000000000

是您的Python程序必须产生的相应文本输出。

但是,由于identicon可能有很多笨拙的角度,并且由于其黑白图像的光栅化可能会留下锯齿,因此您的输出最多可以有300个01多个与它们应有的相反。(这是10000 01的总数的3%。)

在摘要的底部附近,您可以粘贴程序的输出,并检查多少个01多个与应有的不同。任何等于或小于300的差异均有效。

计分

字节最少的提交将获胜。(方便的字节计数器。
Tiebreaker将提交的错误数0和错误数减至最少1
如果仍然有平局,则较早的提交将获胜。

细节

  • 如果您的语言没有stdout,输出将输出到stdout或类似的替代项。
  • 输出可以选择包含尾随换行符。
  • 请在您的帖子中包括颜色identicon图片以及生成它的确切字符串。无需浪费空间并发布整个文本输出。
  • 您的程序应在没有Internet连接的情况下运行。您需要在代码中生成文本,而不是从Gravatar网站查询文本。
  • “命名”语言时,请使用常识。使用您通常在此站点上使用的语言名称。不要烦人,不要制造一个容易使identicon易于打高尔夫球的名称。例如Python 2,对于Python来说很好,但是python 2.7.2正在扩展它,python 2.7.2 by Guido van Rossum这很荒谬。
  • 我意识到某些语言在本质上比其他语言容易,因为它们的identicon形状更简单。那就是它的样子,不要对此感到太不满或竞争。;)

是否有某种生成标识的公式?编写脚本来生成它们会不会长?
扎克·盖茨2015年

@ZachGates好吧,您只需要生成一个,即为您的语言生成的一个即可。他们有很多对称所以应该不会糟糕。
加尔文的业余爱好

7
我敢于有人做“ GNU E ”。
Sp3000

2
我认为没有错误应该有一个好处。基本上是因为我的答案都没有!
CJ丹尼斯2015年

2
@CJDennis但是,这会增加对拥有好的identicon的偏见,因为某些identicon由于问题中提到的锯齿并不完全对称。
Sp3000

Answers:


31

CJam,92 81 79 71字节,120个错误

身份图标

25:M{'0*MXe[}%2/z:~M,_ff{_)2$)d/2mLz1>@@+38<^}:A.+AM'1*f++_W%z.+N*N1$W%

可能还有一些打高尔夫球的空间。

在这里测试。

说明

我没有使用任何压缩,而是实际上计算了单个瓦片并将这些瓦片拼凑在一起。左上图块是有意近似的。由于二值化图像不完全旋转对称而导致其他一些错误。让我们看一下代码。

理论上,第一个图块应如下所示:

1111111111111111111111111
1111111111111111111111100
1111111111111111111110000
1111111111111111111000000
1111111111111111100000000
1111111111111110000000000
1111111111111000000000000
1111111111100000000000000
1111111110000000000000000
1111111000000000000000000
1111100000000000000000000
1110000000000000000000000
1111111111111111111111111
1111111111111111111111110
1111111111111111111111000
1111111111111111111100000
1111111111111111110000000
1111111111111111000000000
1111111111111100000000000
1111111111110000000000000
1111111111000000000000000
1111111100000000000000000
1111110000000000000000000
1111000000000000000000000
1100000000000000000000000

那是12条线,然后1s和0s 之间的点的13条线一次减少2。请注意,第一个块的0s为偶数,第二个块的为奇数。如果我们牺牲中间行的精度并将其变为124 0s,则可以使模式更加规则。然后,实际上对于从0到24的每个零数字,都有一行,在顶部和底部之间交替。因此,我们可以按顺序生成它们(作为单个三角形),然后拉出每隔一行:

25:M{'0*MXe[}%2/z:~
25:M                e# Push 25 and store it in M for future use.
    {       }%      e# Map this block onto the range [0 ... 24].
     '0*            e# Create a string of i zeroes.
        MXe[        e# Pad to width 25 with 1s from the left.
              2/    e# Group the lines into pairs.
                z   e# Zip the pairs, thereby grouping even and odd lines.
                 :~ e# Flatten the two groups so we've got a plain 2D grid again.

接下来是该图块右侧的奇特三角形:

1100000000000000000000000
1111000000000000000000000
0111110000000000000000000
0111111100000000000000000
0011111111000000000000000
0011111111110000000000000
0001111111111100000000000
0001111111111111000000000
0000111111111111110000000
0000111111111111111100000
0000011111111111111111000
0000011111111111111111110
0000001111111111111111111
0000001111111111111111111
0000000111111111111111110
0000000111111111111111100
0000000011111111111111000
0000000011111111111110000
0000000001111111111100000
0000000001111111111000000
0000000000111111110000000
0000000000111111100000000
0000000000011111000000000
0000000000011110000000000
0000000000001100000000000

如果我们考虑一个坐标系原点在右上角和x在朝好的方向发展,并y持续下去,那么的区域1S满足3个不等式:x/y ≥ 1/2x/y ≥ 2x + y < 38。我们可以单独计算它们并得出逻辑结论。如果我们合并前两个不等式,它不会保存任何字符,但会稍微清理代码:

    1/2 ≤ x/y ≤ 2
=>  -1 ≤ log2(x/y) ≤ 1
=>  |log2(x/y)| ≤ 1

最终,我们将通过检查相反的地方并使用xor而不是and将结果与其他不等式相结合来保存另一个字节:

M,_ff{_)2$)d/2mLz1>@@+38<^}
M,_                         e# Create a range [0 .. 24] and duplicate it.
   ff{                    } e# This creates a 25x25 array, where each element is 
                            e# determined by executing the block on the pair of its
                            e# x and y coordinates.
      _)                    e# Copy x and increment.
        2$)                 e# Copy y and increment.
           d/               e# Convert to double and divide.
             2mL            e# Get base-2 logarithm.
                z1>         e# Take modulus and check if it's greater than 1.
                   @@       e# Get the other two copies of x and y.
                     +38<   e# Add them and check that they are less than 38.
                         ^  e# Take the XOR with the other condition.

现在,我们已准备好所有内容-剩下的图块只是这些图块的副本和旋转,以及中心的实心(无聊)图块。因此,让我们将所有内容放在一起:

:A.+AM'1*f++_W%z.+N*N1$W%
:A                         e# Store the fancy triangle in A.
  .+                       e# Join the two existing tiles horizontally.
    A                      e# Push the triangle again.
     M'1*                  e# Create a string of 25 ones.
         f+                e# Add it to each line of the triangle.
           +               e# Add these two tiles to the first two tiles, completing
                           e# the upper left quadrant.
            _W%z           e# Duplicate the quadrant, reverse the rows, transpose.
                           e# These two operations together perform a 90 degree
                           e# clockwise rotation.
                .+         e# Join the two quadrants horizontally.
                  N*       e# Join the lines together with newline characters.
                    N1$    e# Push a newline to separate the two halves and copy the
                           e# first half.
                       W%  e# Reverse the entire string. Since this reverse the string
                           e# both vertically and horizontally, this rotates the
                           e# half by 180 degrees.

在程序结束时,CJam只需连续打印堆栈内容,即可获得所需的结果。


40

八度166164字节,0个错误

Octave在处理/构建矩阵方面具有出色的实力。对于“钻石”,我制作了一个xy坐标系,并使用了曼哈顿范数来确定条目是1还是0。由于钻石不是完全对称的,所以我不得不在“距离”和中心点之间进行调整。中心点(13.1,13.1)适用于两种“钻石”形状。

之后,我可以将其中的四分之一设置为零以获得这些C形。正方形和矩阵连接很容易。

新版本-2字符(与旧版本的字符相同,但是我设法更多地使用了Octave语法:

C=ones(25);M=(R=(R=meshgrid(abs(-12.1:12)))+R')>12|R<6.5;S=T=U=V=13.1>R&R>5.8;C(k=8:19,k)=S(f,s)=T(f,f)=U(s,f=1:12)=V(s=14:25,s)=0;[C,U,T,C;U,M,M,T;V,M,M,S;C,V,S,C]

旧版本:

C=ones(25);                               %corner squares
C(k=8:19,k)=0;                            %set the inner squares to 0
X=meshgrid(abs(-12.1:12));                %build coordinate system
R=X+X';                                   %R already has the distances to the chosen centerpoint (13.1, 13.1)
M=R>12|R<6.5;                             %diamond (for the center)
S=T=U=V=13.1>R&R>5.8;                     %diamond (for the edges)
S(f,s)=T(f,f)=U(s,f=1:12)=V(s=14:25,s)=0; %set each one quarter to 0 for the C-shape
[C,U,T,C;U,M,M,T;V,M,M,S;C,V,S,C]         %concatenate and display the big matrix

输出量

在此处输入图片说明

1111111111111111111111111000000000000110000000000000000000000011000000000001111111111111111111111111
1111111111111111111111111000000000001111000000000000000000000011100000000001111111111111111111111111
1111111111111111111111111000000000011111100000000000000000000011110000000001111111111111111111111111
1111111111111111111111111000000000111111110000000000000000000011111000000001111111111111111111111111
1111111111111111111111111000000001111111111000000000000000000011111100000001111111111111111111111111
1111111111111111111111111000000011111111111100000000000000000011111110000001111111111111111111111111
1111111111111111111111111000000111111111111110000000000000000011111111000001111111111111111111111111
1111111000000000000111111000001111111011111111000000000000000001111111100001111111000000000000111111
1111111000000000000111111000011111110001111111100000000000000000111111110001111111000000000000111111
1111111000000000000111111000111111100000111111110000000000000000011111111001111111000000000000111111
1111111000000000000111111001111111000000011111111000000000000000001111111101111111000000000000111111
1111111000000000000111111011111110000000001111111100000000000000000111111111111111000000000000111111
1111111000000000000111111111111100000000000111111111111110000000000011111111111111000000000000111111
1111111000000000000111111000000000000000001111111111111111000000000111111111111111000000000000111111
1111111000000000000111111000000000000000011111111001111111100000001111111101111111000000000000111111
1111111000000000000111111000000000000000111111110000111111110000011111111001111111000000000000111111
1111111000000000000111111000000000000001111111100000011111111000111111110001111111000000000000111111
1111111000000000000111111000000000000011111111000000001111111101111111100001111111000000000000111111
1111111000000000000111111000000000000111111110000000000111111111111111000001111111000000000000111111
1111111111111111111111111000000000000111111100000000000011111111111110000001111111111111111111111111
1111111111111111111111111000000000000111111000000000000001111111111100000001111111111111111111111111
1111111111111111111111111000000000000111110000000000000000111111111000000001111111111111111111111111
1111111111111111111111111000000000000111100000000000000000011111110000000001111111111111111111111111
1111111111111111111111111000000000000111000000000000000000001111100000000001111111111111111111111111
1111111111111111111111111000000000000110000000000000000000000111000000000001111111111111111111111111
0000000000001100000000000111111111111111111111111111111111111111111111111110000000000001100000000000
0000000000011110000000000111111111111001111111111111111111111100111111111110000000000001110000000000
0000000000111111000000000111111111110000111111111111111111111000011111111110000000000001111000000000
0000000001111111100000000111111111100000011111111111111111110000001111111110000000000001111100000000
0000000011111111110000000111111111000000001111111111111111100000000111111110000000000001111110000000
0000000111111111111000000111111110000000000111111111111111000000000011111110000000000001111111000000
0000001111111111111100000111111100000100000011111111111110000010000001111110000000000001111111100000
0000011111110111111110000111111000001110000001111111111100000111000000111110000000000000111111110000
0000111111100011111111000111110000011111000000111111111000001111100000011110000000000000011111111000
0001111111000001111111100111100000111111100000011111110000011111110000001110000000000000001111111100
0011111110000000111111110111000001111111110000001111100000111111111000000110000000000000000111111110
0111111100000000011111111110000011111111111000000111000001111111111100000010000000000000000011111111
1111111000000000001111111100000111111111111100000010000011111111111110000001111111000000000001111111
0000000000000000011111111100000011111111111000000110000001111111111100000011111111100000000011111111
0000000000000000111111110110000001111111110000001111000000111111111000000110111111110000000111111110
0000000000000001111111100111000000111111100000011111100000011111110000001110011111111000001111111100
0000000000000011111111000111100000011111000000111111110000001111100000011110001111111100011111111000
0000000000000111111110000111110000001110000001111111111000000111000000111110000111111110111111110000
0000000000001111111100000111111000000100000011111111111100000010000001111110000011111111111111100000
0000000000001111111000000111111100000000000111111111111110000000000011111110000001111111111111000000
0000000000001111110000000111111110000000001111111111111111000000000111111110000000111111111110000000
0000000000001111100000000111111111000000011111111111111111100000001111111110000000011111111100000000
0000000000001111000000000111111111100000111111111111111111110000011111111110000000001111111000000000
0000000000001110000000000111111111110001111111111111111111111000111111111110000000000111110000000000
0000000000001100000000000111111111111011111111111111111111111101111111111110000000000011100000000000
0000000000001100000000000111111111111111111111111111111111111111111111111110000000000001000000000000
0000000000011110000000000111111111111001111111111111111111111100111111111110000000000011000000000000
0000000000111111000000000111111111110000111111111111111111111000011111111110000000000111000000000000
0000000001111111100000000111111111100000011111111111111111110000001111111110000000001111000000000000
0000000011111111110000000111111111000000001111111111111111100000000111111110000000011111000000000000
0000000111111111111000000111111110000000000111111111111111000000000011111110000000111111000000000000
0000001111111111111100000111111100000100000011111111111110000010000001111110000001111111000000000000
0000011111110111111110000111111000001110000001111111111100000111000000111110000011111110000000000000
0000111111100011111111000111110000011111000000111111111000001111100000011110000111111100000000000000
0001111111000001111111100111100000111111100000011111110000011111110000001110001111111000000000000000
0011111110000000111111110111000001111111110000001111100000111111111000000110011111110000000000000000
0111111100000000011111111110000011111111111000000111000001111111111100000010111111100000000000000000
1111111000000000001111111100000111111111111100000010000011111111111110000001111111000000000001111111
1111111100000000000000000100000011111111111000000110000001111111111100000011111111100000000011111111
0111111110000000000000000110000001111111110000001111000000111111111000000110111111110000000111111110
0011111111000000000000000111000000111111100000011111100000011111110000001110011111111000001111111100
0001111111100000000000000111100000011111000000111111110000001111100000011110001111111100011111111000
0000111111110000000000000111110000001110000001111111111000000111000000111110000111111110111111110000
0000011111111000000000000111111000000100000011111111111100000010000001111110000011111111111111100000
0000001111111000000000000111111100000000000111111111111110000000000011111110000001111111111111000000
0000000111111000000000000111111110000000001111111111111111000000000111111110000000111111111110000000
0000000011111000000000000111111111000000011111111111111111100000001111111110000000011111111100000000
0000000001111000000000000111111111100000111111111111111111110000011111111110000000001111111000000000
0000000000111000000000000111111111110001111111111111111111111000111111111110000000000111110000000000
0000000000011000000000000111111111111011111111111111111111111101111111111110000000000011100000000000
1111111111111111111111111000000000000110000000000000000000000010000000000001111111111111111111111111
1111111111111111111111111000000000001111000000000000000000000110000000000001111111111111111111111111
1111111111111111111111111000000000011111100000000000000000001110000000000001111111111111111111111111
1111111111111111111111111000000000111111110000000000000000011110000000000001111111111111111111111111
1111111111111111111111111000000001111111111000000000000000111110000000000001111111111111111111111111
1111111111111111111111111000000011111111111100000000000001111110000000000001111111111111111111111111
1111111111111111111111111000000111111111111110000000000011111110000000000001111111111111111111111111
1111111000000000000111111000001111111011111111000000000111111100000000000001111111000000000000111111
1111111000000000000111111000011111110001111111100000001111111000000000000001111111000000000000111111
1111111000000000000111111000111111100000111111110000011111110000000000000001111111000000000000111111
1111111000000000000111111001111111000000011111111000111111100000000000000001111111000000000000111111
1111111000000000000111111011111110000000001111111101111111000000000000000001111111000000000000111111
1111111000000000000111111111111100000000000111111111111110000000000011111111111111000000000000111111
1111111000000000000111111111111110000000000000000011111111000000000111111111111111000000000000111111
1111111000000000000111111011111111000000000000000001111111100000001111111101111111000000000000111111
1111111000000000000111111001111111100000000000000000111111110000011111111001111111000000000000111111
1111111000000000000111111000111111110000000000000000011111111000111111110001111111000000000000111111
1111111000000000000111111000011111111000000000000000001111111101111111100001111111000000000000111111
1111111000000000000111111000001111111100000000000000000111111111111111000001111111000000000000111111
1111111111111111111111111000000111111100000000000000000011111111111110000001111111111111111111111111
1111111111111111111111111000000011111100000000000000000001111111111100000001111111111111111111111111
1111111111111111111111111000000001111100000000000000000000111111111000000001111111111111111111111111
1111111111111111111111111000000000111100000000000000000000011111110000000001111111111111111111111111
1111111111111111111111111000000000011100000000000000000000001111100000000001111111111111111111111111
1111111111111111111111111000000000001100000000000000000000000111000000000001111111111111111111111111

它是如此的漂亮,实际上使我了解了Octave的含义。
马克·丁格纳

谢谢,很高兴听到=)(顺便欢迎您在codegolf.SE上!)如果您对矩阵计算感兴趣,那么绝对值得研究!
flawr

23

Brainfuck 9418 2237字节,88个错误

编辑:正如mbomb007所指出的那样,“正式”名称似乎不大写,这在Wikipedia上并未提及,但在esolangs上。这让我很烦,但还不足以重做这个;)。

我的第一个Brainfuck程序!

现在实际上使用数学和逻辑之类的东西!(对于每个像素,它会根据一些条件决定0或1)。这样做很有趣;话虽这么说,但我认为我不会在很长一段时间内再次使用Brainfuck进行编码。

>>>++[<+>+++++]<-->>++[<+>+++++]<--[->+++++[>+++++<-]<[->+>-[>+>>]>[+[-<+>]>+>>]<<<<<<]>[-<+>]<+<[->>>>>>>+<<<<<<<]>>>>>>>->+++++[>+++++<-]<[->+>-[>+>>]>[+[-<+>]>+>>]<<<<<<]>[-<<<<<<<<+>>>>>>>>]<<<<<<<<+>>>>>>+>>>>>>+<<<<<<[>>+++<<<[>>>-<+<<-]>>[<<+>>-]>[<<->>[-]]<<<[->>+<<]>+>[<->[-<<+>>]]>>>>>]<<<<<<[-<<<<<<+>>>>>>]<<<<<+<[-[->-<>>>>[->>>+>>>>>>>++>>>>>>>>>>>>>>>>>+>>>>>>>++<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<]<[->>>>>>>>>>>>>>>>+>>>>>>>++>>>>>>>>>>>>>>>>>+>>>>>>>++<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<]<<<<<[->>>>>>>>>>++>>>>>+>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>++>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<]<[->>>>>>>>>>>>>>>>>>>>>>>++>>>>>+>>>>>>>++>>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<]>>>>>>>>>>>+>>>+>>>+>>>+>>>>>>+>>+>>>>+>>++>>>>+>>>++>>>+>>>++>>>+>>++>>>>+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<[<<<[>+>+<<-]>>[<<+>>-]<<<[>>>+<<<-]>>>[>-]>[<<<<+>>[-]>>->]<+<<[>-[>-]>[<<<<+>>[-]+>>->]<+<<-]>>[-]<[-]<<[-]>>>>>>>>>]<<<<<<<<<<[<<<<<<[<<<<<<[<<<<<<[<+>-]>>>>>>-]>>>>>>-]>>>>>>-]<<<<<<[-]<<<<<<[-]<<<<<<[-]<<<<<<[<<<<<<[<<<<<<[<<<<<<[<+>-]>>>>>>-]>>>>>>-]>>>>>>-]<<<<<<[-]<<<<<<[-]<<<<<<[-]>>>>>>>>>>>>>>>>>>>>>>>[-<<<<<<<<<<<<<<<<<<<<<<<<+>>>>>>>>>>>>>>>>>>>>>>>>]<<<<<<<<<<<<<<<<<<<<<<<<[<<<<<<<<<<<<<+>>>>>>>>>>>>>[-]]<[-]<<<<<<[-]>]>[-<<[[->+<]>-<]>[<<[-]<[->+<]>->>[-]]>>>>>[[->+<]>-<]>[<<[-]<[->+<]->->>[-]]>>>+>>>>++[<++>+++++++]>>+<<<<<<<<<<+<[->+<<<<<++>>>>>>>>>>>+<<<<<<<]<[-]+<<<<+<[->+>>>>>>>++>>>>>+<<<<<<<<<<<<<]>>>>>[<<<[>+>+<<-]>>[<<+>>-]<<<[>>>+<<<-]>>>[>-]>[<<<<+>>[-]>>->]<+<<[>-[>-]>[<<<<+>>[-]+>>->]<+<<-]>>[-]<[-]<<[-]>>>>>>>>>]<<<<<<<<<<[-<<<<<<+>>>>>>]<<<<<<[-<<<<<<+>>>>>>]<<<<<<<+++>[-<->]<[<<<<<+>>>>>[-]]<[-]>>>]<]>[-<<<[->>>>>+>+<<<<<<]>>>>>[->>>>>>>>>>>>>>>+>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<]>[->>+>>>>>>>+<<<<<<<<<]>>>>++++[<++++>-]<+>>>+>+++++[>++++++<-]>>>>>+>>>>+++[<++++++>-]<+>>>+>+++++[>++++++<-]>+>>>>+[<<<[>+>+<<-]>>[<<+>>-]<<<[>>>+<<<-]>>>[>-]>[<<<<+>>[-]>>->]<+<<[>-[>-]>[<<<<+>>[-]+>>->]<+<<-]>>[-]<[-]<<[-]<<<]>>>>>>>>>>>>>>>>>>>>[-<<<<<<+>>>>>>]<<<<<<[-<<<<<<+>>>>>>]<<<<<<[-<<<<<<+>>>>>>]<<<<<<[-<<<<<<<<<<<<<+>>>>>>>>>>>>>[-]]<[-]<<<<<<[-]<<[-]>>>]<<<<<<<<<+[>+<+++++]>---.[-]>-[->>+<<]>>>+<[>-<[-<<+>>]]>[<<->++[<<+>>+++++]<<-->>>[-]++++++++++.[-]]<<]

产生图像的位图:

在此处输入图片说明

有一些注释的版本(可能不是很有用,因为它们主要出于我自己的利益):

>>
>++[<+>+++++]<--
>
>++[<+>+++++]<--            100 100     x y range from 1 to 100 (min is not 0) 

[                                           while y
    -                                           x       * y_1
    >+++++[>+++++<-]<
    [->+>-[>+>>]>[+[-<+>]>+>>]<<<<<<]           x       * 0     y_1     25_(y_1)%25     (y_1)%25    y//25
    >[-<+>]<+                                   x       * y     0       25_(y_1)%25     (y_1)%25    y//25
    <[->>>>>>>+<<<<<<<]>>>>>>>-                 0       y       0       25_(y_1)%25     (y_1)%25    y//25       0           * x_1
    >+++++[>+++++<-]<
    [->+>-[>+>>]>[+[-<+>]>+>>]<<<<<<]           0       y       0       25_(y_1)%25     (y_1)%25    y//25       0           * 0     x_1     25_(x_1)%25     (x_1)%25    x//25
    >[-<<<<<<<<+>>>>>>>>]<<<<<<<<+              * x     y       0       25_(y_1)%25     (y_1)%25    y//25       0           0       0       25_(x_1)%25     (x_1)%25    x//25

    >>>>>>+>>>>>>+<<<<<<
    [
        >>+++<<
        <[>>>-<+<<-]
        >>[<<+>>-]
        >[<<->>[-]]                             x       y       0       25_(y_1)%25     (y_1)%25    y//25       y//25=3     0       * 0     25_(x_1)%25     (x_1)%25    x//25

        <<<[->>+<<]
        >+>
        [<->[-<<+>>]]                           x       y       0       25_(y_1)%25     (y_1)%25    y//25       y//25=0|3   *0      0       25_(x_1)%25     (x_1)%25    x//25

        >>>>>
    ]
    <<<<<<                                      x       y       0       25_(y_1)%25     (y_1)%25    y//25       y//25=0|3   0       0       25_(x_1)%25     (x_1)%25    x//25       * x//25=0|3
    [-<<<<<<+>>>>>>]                            x       y       0       25_(y_1)%25     (y_1)%25    y//25       p           0       0       25_(x_1)%25     (x_1)%25    x//25       * 0
    <<<<<

    +<
    [
        -
        [   
            ->-<

            ### p == 2 ###                      x       y       0       v1              v0          y//25       0           * 0     0       u1              u0          x//25       0

            >>>>
            [->>>+ >>>>>>>++ >>>>>>>>>>>>>>>>>+ >>>>>>>++<<<<<<< <<<<<<<<<<<<<<<<< <<<<<<< <<<]
            <
            [->>>>>>>>>>>>>>>>+ >>>>>>>++ >>>>>>>>>>>>>>>>>+ >>>>>>>++ <<<<<<< <<<<<<<<<<<<<<<<< <<<<<<< <<<<<<<<<<<<<<<<]
            <<<<<
            [->>>>>>>>>>++ >>>>>+ >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>++ >>>>>+ <<<<< <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< <<<<< <<<<<<<<<<]
            <
            [->>>>>>>>>>>>>>>>>>>>>>>++ >>>>>+ >>>>>>>++ >>>>>+ <<<<< <<<<<<< <<<<< <<<<<<<<<<<<<<<<<<<<<<<]

            >>>>>>>>
            >>>+
            >>>+>>>+
            >>>+>>>
            >>>+>>+>
            >>>+>>++>
            >>>+>>>++
            >>>+>>>++
            >>>+>>++>
            >>>+<<<
            <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                                                x       y       0       0               0           y//25       0           0       0       0               0           x//25       * 0
            [
                <
                <<[>+>+<<-]
                >>[<<+>>-]
                <<<[>>>+<<<-]
                >>>[>-]> [< <<<+ >>[-] > >->]<+<
                <[>- [>-]> [< <<<+ >>[-]+ > >->]<+< <-]
                >>[-]<[-]<<[-]>>>>>>>>>
            ]

            <<<<<<<<<<
            [<<<<<<[<<<<<<[<<<<<<[<+>-]>>>>>>-]>>>>>>-]>>>>>>-]
            <<<<<<[-]<<<<<<[-]<<<<<<[-]
            <<<<<<
            [<<<<<<[<<<<<<[<<<<<<[<+>-]>>>>>>-]>>>>>>-]>>>>>>-]
            <<<<<<[-]<<<<<<[-]<<<<<<[-]
            >>>>>> >>>>>> >>>>>> >>>>>
            [-<<<<<< <<<<<< <<<<<< <<<<<< + >>>>>> >>>>>> >>>>>> >>>>>>]
            <<<<<< <<<<<< <<<<<< <<<<<<
            [<<<<<<<<<<<<<+>>>>>>>>>>>>>[-]]
            <[-]<<<<<<[-]>
        ]
        >
        [
            -
            ### p == 1 ###                      x       y       0       v1              v0          y//25       0           * 0     0       u1              u0          x//25       0
            <<
            [
                [->+<]
                >-<
            ]
            >
            [
                <<[-]<[->+<]
                >->>[-]
            ]                                   x       y       0       ~               v           0           * 0         0       0       u1              u0          x//25       0
            >>>>>
            [
                [->+<]
                >-<
            ]
            >
            [
                <<[-]<[->+<]-
                >->>[-]
            ]                                   x       y       0       ~               v           0           0           0       0       ~               u           0           * 0
            >>>+>>>
            >++[<++>+++++++]
            >>+<<<
            <<<<<<<+<
            [->+<<<<<++>>>> >>>>>>>+<<<<<<<]
            <[-]+<<<<+<
            [->+>>>>>>>++>>>>>+<<<<<<<<<<<<<]   x       y       0       ~               * 0         v           2u_1        0       0       ~               0           u           2v_1
            >>>>>

            [
                <
                <<[>+>+<<-]
                >>[<<+>>-]
                <<<[>>>+<<<-]
                >>>[>-]> [< <<<+ >>[-] > >->]<+<
                <[>- [>-]> [< <<<+ >>[-]+ > >->]<+< <-]
                >>[-]<[-]<<[-]>>>>>>>>>
            ]                                   
            <<<<<<<<<<                          x       y       0       ~               0           v~2u_1      0           0       0       0               0           u~2v_1      0
            [-<<<<<<+>>>>>>]<<<<<<
            [-<<<<<<+>>>>>>]<<<<<<
            <+++>
            [-<->]
            <[<<<<<+>>>>>[-]]
            <[-]>>>
        ]
        <
    ]
    >
    [
        -
        ### p = 0 ###
                                                x       y       0       v1              v0          y//25       p           * 0     0       u1              u0          x//25

        <<<[->>>>>+>+<<<<<<]                    x       y       0       v1              * 0         y//25       p           0       0       v0|u1           v0|u0       x//25
        >>>>>
        [->>>>>>>>>>>>>>>+>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<]               x       y       0       v1              0           y//25       p           0       0       * 0             v0|u0       x//25       x y t0 t1 _ _  x y t0 t1 _ _  x y t0 t1 _ _ x y t0 t1 _ _
        >[->>+>>>>>>>+<<<<<<<<<]                                        x       y       0       v1              0           y//25       p           0       0       0               *0          x//25       x y t0 t1 _ _  x y t0 t1 _ _  x y t0 t1 _ _ x y t0 t1 _ _
        >>>>++++[<++++>-]<+
        >>>+
        >+++++[>++++++<-]>
        >>>>+
        >>>>+++[<++++++>-]<+
        >>>+
        >+++++[>++++++<-]>+
        >>>>+
        [
            <
            <<[>+>+<<-]
            >>[<<+>>-]
            <<<[>>>+<<<-]
            >>>[>-]> [< <<<+ >>[-] > >->]<+<
            <[>- [>-]> [< <<<+ >>[-]+ > >->]<+< <-]
            >>[-]<[-]<<[-]<<<
        ]
        >>
        >>>>>>
        >>>>>>
        >>>>>>
        [-<<<<<<+>>>>>>]<<<<<<
        [-<<<<<<+>>>>>>]<<<<<<
        [-<<<<<<+>>>>>>]<<<<<<
        [-<<<<<<<<<<<<<+>>>>>>>>>>>>>[-]]                               x       y       0       v1              0           y//25       p           0       0       0               0           x//25       *0

        <[-]<<<<<<[-]<<[-]
        >>>
    ]

    <
    <<<<<
    <<<
    +[>+<+++++]>---.[-]

    >
    -                                           decrement x
    [->>+<<]>>>+<
    [
        >-<
        [-<<+>>]
    ]
    >
    [                                           if x is 0
        <<-                                     decrement y
        >++[<<+>>+++++]<<--                     set x to 100
        >>>[-]
        ++++++++++.                             output '/n'
        [-]
    ]
    <<
]

1
我认为这实际上是不正确的,因为该语言的名称不是用大写字母(尽管人们经常这样做),所以identicon会有所不同。
mbomb007 '16

19

Python中,294 273 239 188 179 170 159 154字节

这是158字节的版本:

I=100*[100*"0"]
for j in range(7500):i=j%25;j/=100;I=map(list,zip(*I[::-1]));I[i][j]=`+[abs(i%12-6)+5<j/2,j>i/2+24,2*i>72-j][j/25]`
for r in I:print"".join(r)

这是仅Python 2的程序,但我正在使用identicon表示“ Python”(即OP中的那个)。差异应为78位。

通过提供准确性,这是154字节的版本:

I=100*[100*"0"]
for j in range(7425):i=j%25;j/=99;I=map(list,zip(*I[::-1]));I[i][j]=`+[~i%12<j/2>i%12,j>i/2+24,2*i>72-j][j/25]`
for r in I:print"".join(r)

而是具有224位的差异。

(-4个字节,感谢Stefan Pochmann)

说明

这是另一个扩展版本:

I=100*[100*"0"]

for _ in range(4):
 I=map(list,zip(*I[::-1]))

 for i in range(25):
  for j in range(75):
   I[i][j]=`+[abs(i%12-6)+5<j/2,j>i/2+24,2*i>72-j][j/25]`

for r in I:print"".join(r)

对于此版本,我们将identicon视为4x4模式的网格。我们从一个0x的100x100网格开始,并执行以下四次操作:

  • 使用不等式填写模式行1的前三个模式
  • 顺时针旋转整个东西

在此处输入图片说明

原始版本与此类似,但是每次修改单个单元格时我们都旋转,而不是完成三个模式之后旋转。这会使程序花费几秒钟,但是输出是相同的。


您可以使用分号将J和的定义r合并为一行。
扎克·盖茨

@ZachGates我不认为实际保存任何东西,因为你用分号只是更换一个换行符
SP3000

好点子。我没想到。
扎克·盖茨2015年

1
@ Sp3000打开您在Windows上的位置,其中换行符是2个字节。xD
Kroltan

1
~i%12<j/2>i%12比3短3点,abs(i%12-6)+5<j/2但导致224个差异。
Stefan Pochmann

19

C,255个 245 237 234字节

C的identicon 确实是对称的。

身份识别

打高尔夫球:(为“可读性”添加了换行符)

d[100],j,y,i,o[100];
main(c){
for(;i<100;++i){j=i>12?25-i:i,y=j<7?-1u>>63-j:127,d[i]=y<<12-j|y<<(j<7?12:j+6),
o[i]=i<25?(-1<<12|-1u>>76-i|-(i<13))<<25|d[i]:d[i-25]<<25;
for(c=50;c--+50;putchar(o[i<50?i:99-i]>>(c<0?~c:c)&1|48));puts("");}}

这会将每行的一半存储在顶半部分中,成为一个64位整数,然后以二进制方式两次打印相应整数的低50位两次,第二次打印则相反。

64位整数都需要它来运行(如果你的系统不使用64位整数,然后您可以添加longlong long之前d[50](long)(long long)之后o[i-1]=i<26?)。

取消评论并评论:

int diamond[25], j, y, i, out[50];
main(c){
    // generate diamond pattern
    for(i = 0; i < 25; ++i){
        j = i > 12 ? 25 - i : i;
        y = j < 7 ? -1u >> 63 - j : 127;
        diamond[i] = y << 12 - j | y << (j < 7 ? 12 : j + 6);
    }

    // generate top half outputs in reverse order
    for(i = 0; i < 50; ++i){
        if(i < 25)
            // i < 50: out[i] = [diamond] [0 ... x25]
            out[i] = diamond[i] << 25;
        else
            // i < 25: out[i] = [1...x25] [diamond]
            out[i] = (int)(-1 << 12 | -1u >> 27 + i | -(i > 36)) << 25 | diamond[i - 25];
        // i >= 50: use out[100 - i]
    }
    // print rows
    for(i = 50; i-- + 50; putchar('\n')){
        // print last 50 bits of the correct 64-bit integer, then print it reversed
        for(c = 50; c-- + 50; putchar(out[i < 0 ? -i - 1 : i] >> (c < 0 ? -c - 1 : c) & 1 | '0'));
    }
}

输出有291个错误。

感谢ace的使用技巧 puts("")


7
只有291?我想我们已经准备好发货了!
2015年

1
替换putchar(10)puts("")以保存3个字节。
ace_HongKong独立

19

C,224 206 200 176个字节,243级的错误

char b[101],i,j,k=1,s,a;main(){for(;i+1;i+=k=i-50?puts(b),k:-1)for(j=0;j<50;j++)s=i-j,a=i+j-49|1,b[j]=b[99-j]=(i/25+j/25?14/a&&s/12&&38/s&&a/6|19/s+s/31:i<13||j<13^i+j>36)+48;}

复制:

C标识

上面的代码输出与此图像相关的二进制,有243个错误:

243错误

据我所知,我使用了与es1024解决方案完全不同的方法。这种方法可能可以进一步研究,所以我将稍作解释,但这是它的辉煌所在:

char b[101],i,j,k=1,s,a;
main(){
    for(;i+1;i+=k=i-50?puts(b),k:-1)
        for(j=0;j<50;j++)
            s=i-j,
            a=i+j-49|1,
            b[j]=b[99-j]=(i/25+j/25?14/a&&s/12&&38/s&&a/6|19/s+s/31:i<13||j<13^i+j>36)+48;
}

它实质上使用一组不等式来定义多边形,并且严重依赖于对称性。

现在是午夜,我读取自己的代码的能力正在迅速恶化。您可能可以摆弄一些常量来降低错误,但是我只能始终如一地破坏一切。

有趣的是,这不仅是我提出的最短的版本,而且gcc不会发出警告


进行外for循环for(;i+1;i+=k=i-50?puts(b),k:-1),以减少一个分号和两个大括号,节省3个字节。
ace_HongKong独立

@ace谢谢,真是太好了!最多200个字节。
BrainSteel 2015年

您可以移动k=1main(k)保存3个字节。
es1024 2015年

16

gs2:72个字节,200个错误

还没有真正打过高尔夫球,不确定我是否愿意。助记符:

# Square
abs both1 biggest 6 <= b5
# Left triangle
{ over abs both1 + 13 <= swap 1 < and }
# Diagonal triangle
{ >= @0 double 10 + @4 <= or }
              # ^ 12 gives way more accuracy here but pushing 10 saves a byte.

# Plot each of these
3 make-array
{ pop-a -12 13 crange dup cartesian-product
  dump swap push-a eval show m5
  25 / } map

# Make corner
dump
reverse zip @1 rot zip +
unlines lines

dup reverse transpose zip
dup reverse show reverse m2
+ unlines

程序本身:

23 f8 39 16 75 e4 08 45 23 f8 30 01 0d 75 42 11
70 35 09 08 73 a0 2a 1a 30 a4 75 36 09 13 0e 08
cc 02 f4 ff 01 0d 4f 40 83 0e 42 d0 20 52 ec 01
19 33 09 34 0e 20 b0 a1 43 b0 30 2b 2a 40 20 9a
b0 40 20 52 20 e9 30 2b

9

Z80,194个字节,0个错误

Z80 identicon

Z80,178个字节,80个错误

Z80 identicon错误

错误以绿色突出显示。

由于这是一个老式的CPU,因此我使用了老式的约定。我已将&8000用作十六进制值,而不是更熟悉的0x8000,并且我选择了用“ \ r”而不是“ \ n”结束模式的每一行。

源代码十六进制编码

         0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F
        -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
&8000   69 31 18 00 DB 42 81 E7 21 00 40 11 04 80 0E 04
&8010   06 19 D5 1A F5 C5 E6 03 5F 1A 32 20 80 06 19 18
&8020   00 36 31 23 10 F9 C1 F1 E6 FC 0F 0F 20 E6 36 0D
&8030   23 D1 10 DE 13 0D 20 D8 C9 3E 1A 90 58 C1 C5 D5
&8040   58 47 7B 87 FE 1A 38 02 D6 19 5F 80 FE 1B 28 34
&8050   18 0E 78 C1 C5 5F D5 87 FE 1A 38 02 D6 19 5F 80
&8060   FE 1A 28 20 30 06 90 90 30 1A 18 14 90 90 38 14
&8070   FE 01 38 10 20 0A 7B D6 05 30 FC C6 05 0F 38 04
&8080   36 30 18 02 36 31 D1 43 18 99 58 C1 C5 78 83 FE
&8090   0D 38 26 FE 27 30 22 93 93 30 04 FE F3 30 04 FE
&80A0   0E 30 16 83 83 FE 15 38 14 FE 20 30 10 93 93 30
&80B0   04 FE FB 30 04 FE 06 30 04 36 30 18 02 36 31 43
&80C0   18 C6

源代码说明

由于Z80是CPU,因此它没有任何标准输出。这样,我只是将每个字符从&4000开始直接写入内存,然后MEMDUMP读取10,100字节以验证正确的模式。

Z80的寄存器如下:

+-------+
| B / C |  8-bit general purpose B & C or 16-bit general purpose BC
+-------+
| D / E |  8-bit general purpose D & E or 16-bit general purpose DE
+-------+
| H / L |  8-bit general purpose H & L or 16-bit specialised HL
+-------+
| A | F |  8-bit accumulator A (main working register) & Flag register F
+-------+

特殊标志寄存器包含以下标志:SZ-H-VNC小号 IGN,Ž ERO,ħ ALF-进位,O- v erflow(也用作P元数),Ñ egative和Ç ARRY。标记的-位置未使用。的ħ ALF-进位和Ñ egative标志仅由CPU内部使用。小号 IGN和O v erflow / P参数数量采取额外的字节来使用,所以我只能用ž ERO和Ç其中获得设置或每次计算后复位,但不能走动值时,ARRY。

还有其他寄存器,但它们与高尔夫挑战无关,因为它们需要额外的字节才能使用。

  • LD OA d秒的值到寄存器或地址,例如LD C, 4C = 4。该值可以是直接的(对于8位或16位值,分别为一个或两个额外的字节),或者可以从另一个寄存器复制。(HL)表示从指向的地址或从指向的地址复制的均值HL
  • PUSH然后POP 推入(保存至)并弹出(从中还原)堆栈,该堆栈只能存储16位值。这样,AF即使没有其他指令使用它,它也被视为单个16位寄存器。
  • AND是按位。Z80没有布尔逻辑指令,但是具有布尔标志。
  • JR Ĵ UMP [R使用一个字节elative符号偏移。它使用绝对比少一个字节Ĵp JP,但具有可用于测试较少的条件。
  • INCDEC INC种类调和和种类调和8和16位寄存器。
  • DJNZ ð ecrement和Ĵ UMP如果Ñ导通ž ERO。这与DEC B; JR NZ, ##;少一个字节完全相同,但仅适用于B寄存器。
  • RET 退后骨灰to到呼叫位置。它可以选择具有条件。
  • ADDSUB 添加到与从任一8位道A寄存器或16位HL寄存器。
  • CP Ç OM p是从减去值A寄存器,设置标志为适当的,但丢弃结果留下A不变。
  • RRCA ř otate ř飞行Ç ircular 一个 ccumulator。将所有位向右旋转A一次,将位0复制到位7。还将位0复制到进位(C)标志,不要与C寄存器混淆。

每个Identicon模式都可以按如下方式分解:

0451
4885
6887
2673

其中0-3是拐角,适当旋转,4-7是边缘瓦片,适当旋转,而8是中心瓦片(据我所知)始终旋转对称。

幸运的是,Z80 Identicon可以简化为:

3123
1002
2001
3213

我将“ 0”放在中间,以便有效地检查结束条件。实际上,为了编写代码,几乎倒退所有事情都是有意义的!

:Offsets是四个字节值的块,我将其用作每个块的模式偏移量。该程序计算出要运行的块,然后更改自身以跳转到正确的代码。奇怪的是,这似乎比直接检查使用更少的字节!

:DATA(在注释中也称为魔术数据!)是需要渲染块的编码顺序。有16个值,通常需要16个字节,但是由于每个值只有2位长,因此我能够将4放入一个字节,从而节省了12个字节!存储,还原和解码这些值的代码为6个字节。另外,通过避免在最高的2位中使用数字0,我能够将其加倍作为计数器,从而节省了至少3个字节(2个用于初始化,1个用于减量)!保存的总字节数:12-6 + 3 = 9。

偏移数据必须存储在以十六进制00结尾的位置才能正常工作。我选择了&8000,因为它似乎是一个不错的选择。这意味着程序从&8008开始。巧合的是,英特尔生产了一种称为8008的早期CPU,可以将其视为Z80的祖父!英特尔还生产了8080,Zilog的Z80就是8080完全兼容的。Z80具有一系列8080没有的扩展指令。我避免使用这些扩展指令,因为每个指令都有一个一字节的前缀,这意味着该程序也将在8080上产生相同的结果!

由于第3块的模式全为“ 1”,因此我将其嵌入到主循环中,这就是为什么它的偏移量为00。这样就不必从第3块返回就节省了2个字节!幸运的是,我能够将所有四个块的起始位置调整为少于128个字节。这是好的,因为从读取偏移字节后计算出的当前位置的相对跳转范围是-128至127。即一条JR指令读取两个字节,然后执行计算。JR 00什么也没做。JR 01跳过一个字节。 JR FF返回一个字节,导致下一条指令成为JR刚执行的偏移量,这真的很糟糕,因为该指令FF不适合胆小者! JR FE 返回两个字节导致无限循环,等等。但是,从Block-0跳回的距离太远(小于-128),所以我只是跳回到上一个块,然后又跳了!

#### DATA ####
:Offsets (&8000)                        # It is important that this address is of the form &XX00
69 (#Block-0, &808A)
31 (#Block-1, &8052)
18 (#Block-2, &8039)
00 (#Block-3, &8021)
:DATA (&8004)
DB 42 81 E7                             # Magic data

#### CODE ####
:MAIN (&8008)
21 00 40 ..   LD    HL, &4000           # Start address of pattern output
11 04 80 ..   LD    DE, #DATA (&8004)   # Load DE with data address
0E 04 .. ..   LD    C, 4                # Load C with 4 (outer loop)
:OUTY (&8010)
06 19 .. ..     LD    B, 25               # Load B with 25 (outer loop)
:INRY (&8012)
D5 .. .. ..     ! PUSH  DE                  # DE -> Stack, Stack = "DE" (save block pattern address)
1A .. .. ..     ! LD    A, (DE)             # Get block mask (ppoonnmm)
:OUTX (&8014)
F5 .. .. ..         PUSH  AF                  # AF -> Stack, Stack = "DE, AF" (save block mask)
C5 .. .. ..         PUSH  BC                  # BC -> Stack, Stack = "DE, AF, BC" (save outer loop variables)
E6 03 .. ..         AND   &03                 # Get block number (0, 1, 2 or 3). A = 000000XX where each X can be 0 or 1
5F .. .. ..         LD    E, A                # Copy A to E. DE now contains &800X where X is one of (0, 1, 2 or 3)
1A .. .. ..         LD    A, (DE)             # Copy the byte at address pointed to by DE to A
32 20 80 ..         LD    (&8020!), A         # Alter JR instruction in innermost loop with offset of current pattern block
06 19 .. ..         LD    B, 25               # Load B with 25 (inner loop)
:INRX (&801F)
18 00 .. ..           JR    00                  # (Relative) Jump to overridden pattern block location (Mock CALL). The second byte of this instruction is at address &8020 (see instruction two above)
:Block-3 (&8021 + &00 = &8021)
36 31 .. ..           LD    (HL), 49            # Write ASCII "1" to address in HL
:RESUME (&8023)
23 .. .. ..           INC   HL                  # Move pointer to next (8 bit) memory location
10 F9 .. ..           DJNZ  #INRX (&801F)       # Repeat B times (end of inner B loop)
&8026
C1 .. .. ..         POP   BC                  # Stack -> BC, Stack = "DE, AF"
F1 .. .. ..         POP   AF                  # Stack -> AF, Stack = "DE"
E6 FC .. ..         AND   &FC                 # Zero out current block number: A = XXXXXX00 where each X can be 0 or 1
0F .. .. ..         RRCA                      # Rotate Right A. (rotate bits to the right by one place. Bit 0 is copied into bit 7)
0F .. .. ..         RRCA                      # Rotate Right A again. The next pattern block is now in bits 1 & 0.
20 E6 .. ..         JR    NZ, #OUTX (&8014)   # If A is Non-Zero (Relative) Jump (Repeat until pattern is empty)
&802E
36 0D .. ..       LD (HL), 0D               # Write "\r"
23 .. .. ..       INC HL                    # Move pointer
D1 .. .. ..       POP DE                    # Stack -> DE, Stack = ""
10 DE .. ..       DJNZ  #INRY (&8012)       # Repeat B times (end of outer B loop)
&8034
13 .. .. ..     INC   DE                  # Move DE to next pattern of blocks
0D .. .. ..     DEC   C                   # Decrement C (end of outer C loop)
20 D8 .. ..     JR    NZ, #OUTY (&8010)   # If C is Non-Zero (Relative) Jump (Repeat C times)
&8038
C9 .. .. ..   RET                       # Return

:Block-2 (&8039)
3E 1A .. ..   LD    A, 26               # A = 26
90 .. .. ..   SUB   A, B                # A = 26 - x
58 .. .. ..   LD    E, B                # Copy B to E, E = x
C1 .. .. ..   POP   BC                  # Restore B (& C), B = y
C5 .. .. ..   PUSH  BC                  # Save B (& C) again
D5 .. .. ..   PUSH  DE                  # Save (D &) E
58 .. .. ..   LD    E, B                # E = y
47 .. .. ..   LD    B, A                # B = 26 - x
7B .. .. ..   LD    A, E                # A = y
87 .. .. ..   ADD   A, A                # A = 2 * y
FE 1A .. ..   CP    26                  # A - 26 (compare)
38 02 .. ..   JR    C, 2                # if Carry, skip next instruction
D6 19 .. ..     SUB   A, 25               # A = 2 * y % 25
5F .. .. ..   LD    E, A                # Copy A to E, E = 2 * y % 25, B = 26 - x
80 .. .. ..   ADD   A, B                # A = 2 * y % 25 + 26 - x
:Extra-1s
FE 1B .. ..   CP    27                  # A - 27 (compare)
28 34 .. ..   JR    Z, #Bl1-1           # if Zero, (Relative) Jump to Block-1 "1"
:End-Extra-1s
18 0E .. ..   JR    #BL1a               # (Relative) Jump to Block-1a

:Block-1 (&8052)
78 .. .. ..   LD    A, B                # A = x
C1 .. .. ..   POP   BC                  # Restore B (& C), B = y
C5 .. .. ..   PUSH  BC                  # Save B (& C) again
5F .. .. ..   LD    E, A                # Save A (copy of B) in E, E = x
D5 .. .. ..   PUSH  DE                  # Save (D &) E
87 .. .. ..   ADD   A, A                # A = 2 * x
FE 1A .. ..   CP    26                  # A - 26 (compare)
38 02 .. ..   JR    C, 2                # if Carry, skip next instruction
D6 19 .. ..     SUB   A, 25             # A = 2 * x % 25
5F .. .. ..   LD    E, A                # Copy A to E, E = 2 * x % 25, B = y
80 .. .. ..   ADD   A, B                # A = 2 * x % 25 + y
:BL1a                                   # From this point on until character written to memory, swap x and y in comments if from Block-2
FE 1A .. ..   CP    26                  # A - 26 (compare)
28 20 .. ..   JR    Z, #Bl1-1           # if Zero, (Relative) Jump to Block-1 "1"
30 06 .. ..   JR    NC, #BL1b           # if Non-Carry, (Relative) Jump to Block-1b
90 .. .. ..   SUB   A, B                # A = 2 * x % 25
90 .. .. ..   SUB   A, B                # A = 2 * x % 25 - y
30 1A .. ..   JR    NC, #Bl1-1          # if Non-Carry, (Relative) Jump to Block-1 "1"
18 14 .. ..   JR    #Bl1-0              # (Relative) Jump to Block-1 "0"
:BL1b
90 .. .. ..   SUB   A, B                # A = 2 * x % 25
90 .. .. ..   SUB   A, B                # A = 2 * x % 25 - y
38 14 .. ..   JR    C, #Bl1-1           # if Carry, (Relative) Jump to Block-1 "1"
FE 01 .. ..   CP    1                   # A - 1 (compare)
38 10 .. ..   JR    C, #Bl1-1           # if Carry, (Relative) Jump to Block-1 "1"
:Jaggies
20 0A .. ..   JR    NZ, #Bl1-0          # if Non-Zero, (Relative) Jump to Block-1 "0"
7B .. .. ..   LD    A, E                # A = 2 * x % 25
:MOD5
D6 05 .. ..   SUB   A, 5                # A = A - 5
30 FC .. ..   JR    NC, MOD5            # if Non-Carry (A >= 0), (Relative) Jump to #MOD5
C6 05 .. ..   ADD   5                   # A = 2 * x % 5. A was [-5,-1], needed to add 5 for positive mod 5
0F .. .. ..   RRCA                      # Rotate Right A. Bit 0 is copied into Carry flag
38 04 .. ..   JR    C, #Bl1-1           # if Carry, (Relative) Jump to Block-1 "1"
:End-Jaggies
36 30 .. ..   LD    (HL), 0             # Write "0"
18 02 .. ..   JR    #B1-end             # Skip next instruction
36 31 .. ..   LD    (HL), 1             # Write "1"
:B1-end
D1 .. .. ..   POP   DE                  # Restore (D &) E, E = x
43 .. .. ..   LD    B, E                # Restore B from E
18 99 .. ..   JR    #RESUME (&8023)     # (Relative) Jump back into inner loop

:Block-0 (&808A)
58 .. .. ..   LD    E, B                # Copy B to E, E = x
C1 .. .. ..   POP   BC                  # Restore B (& C), B = y
C5 .. .. ..   PUSH  BC                  # Save B (& C) again
78 .. .. ..   LD    A, B                # A = y
83 .. .. ..   ADD   A, E                # A = y + x
FE 0D .. ..   CP    13                  # A - 13 (compare)
38 26 .. ..   JR    C, #Bl0-0           # if Carry, (Relative) Jump to Block-0 "0"
FE 27 .. ..   CP    39                  # A - 39 (compare)
30 22 .. ..   JR    NC, #Bl0-0          # if Non-Carry, (Relative) Jump to Block-0 "0"
93 .. .. ..   SUB   A, E                # A = y
93 .. .. ..   SUB   A, E                # A = y - x
30 04 .. ..   JR    NC, 4               # if Non-Carry (A >= 0), skip next two instructions
FE F3 .. ..   CP    -13                 # A - -13 (compare)
30 04 .. ..   JR    NC, 4               # if Non-Carry, skip next two instructions
FE 0E .. ..   CP    14                  # A - 14 (compare)
30 16 .. ..   JR    NC, #Bl0-0          # if Non-Carry, (Relative) Jump to Block-0 "0"
83 .. .. ..   ADD   A, E                # A = y
83 .. .. ..   ADD   A, E                # A = y + x
FE 15 .. ..   CP    21                  # A - 21 (compare)
38 14 .. ..   JR    C, #Bl0-1           # if Carry, (Relative) Jump to Block-0 "1"
FE 20 .. ..   CP    32                  # A - 32 (compare)
30 10 .. ..   JR    NC, #Bl0-1          # if Non-Carry, (Relative) Jump to Block-0 "1"
93 .. .. ..   SUB   A, E                # A = y
93 .. .. ..   SUB   A, E                # A = y - x
30 04 .. ..   JR    NC, 4               # if Non-Carry, skip next two instructions
FE FB .. ..   CP    -5                  # A - -5 (compare)
30 04 .. ..   JR    NC, #Bl0-0          # if Non-Carry, (Relative) Jump to Block-0 "0"
FE 06 .. ..   CP    6                   # A - 6
30 04 .. ..   JR    NC, #Bl0-1          # if Non-Carry, (Relative) Jump to Block-0 "1"
:Bl0-0 (&80B9)
36 30 .. ..   LD    (HL), 30            # Write "0"
18 02 .. ..   JR    2                   # Skip next instruction
:Bl0-1 (&80BD)
36 31 .. ..   LD    (HL), 31            # Write "1"
43 .. .. ..   LD    B, E                # Restore B from E
18 C6 .. ..   JR    -39!=&8041          # (Relative) Jump back into inner loop
&80C2

当然,这里还有打高尔夫球的空间。我的第一个完全正常工作的版本是239个字节。删除“ Extra-1s”部分可以节省4个字节,但要减少48个错误,而删除“ Jaggies”部分可以节省12个字节,但要减少32个错误。


8

Haskell中,201个 190字节,44个错误

main=mapM_ putStrLn$h++map v(v h)
h=[[b$p i j|p<-q,j<-x]|q<-[[a,r,d,a],[r,w,w,d]],i<-x]
a i j=abs i+abs j>13
d i j=i>0&&abs j+i<12
r=flip d
w _ _=1<3
v=reverse
x=[-12..12]
b x|x='0'|1<3='1'

哈斯克尔

对每个不同的形状使用功能矩阵:(a菱形);udlr(三角形彼此面对方向)和w(白色),并且每个适用于具有坐标的25×25网格[-12..12]。菱形和三角形的形状是使用Manhattan范数计算的,类似于瑕疵的Octave解决方案

其实只产生上半部分,它只需要awd,和r。通过镜像(map reverse . reverse)产生下半部分。


2
我喜欢flip在这里实际执行几何旋转的方式。
ballesta25

您可以_放入mapM_。另外,如果您删除的定义l并将矩阵替换为:[[a,r,d,a],[r,w,w,d],[u,w,w,flip u],[a,u,u,a]],则可以节省几个字节并添加几个错误。
林恩

同样,abs j+i+1<13只是abs j+i<12
Lynn

8

C#-423字节,237个错误

C#标识

只是堆积不平等。大多数错误是由于我将t(= 25)替换为应该使用24的地方。

using System;class A{static void Main(string[]a){for(int t=25,k,l,i,j=0;j<100;j++){for(i=0;i<100;i++){Console.Write((((i>12&&i<87&&j>12&&j<87)||Math.Abs(i-49.5)+Math.Abs(j-49.5)<63)&&!((i>36&&i<63)||(j>36&&j<63)||(i>11&&i<88&&j>t&&j<75)||(j>11&&j<88&&i>t&&i<75)))||(i>t&&i<75&&j>t&&j<75&&(((k=i%t)*2<(l=j%t)&&k*-2+t>l)||(l*2<k&&l*-2+t>k)||((k=t-k)*2<(l=t-l)&&k*-2+t>l)||(l*2<k&&l*-2+t>k)))?"0":"1");}Console.WriteLine();}}}

这是一种可视化其工作方式的尝试:

过程可视化

更具可读性的代码:

using System;
class A
{
    static void Main(string[]a)
    {
        for(int t=25,k,l,i,j=0;j<100;j++){for(i=0;i<100;i++){
        Console.Write(
        (((i>12&&i<87&&j>12&&j<87) //big square
        ||Math.Abs(i-49.5)+Math.Abs(j-49.5)<63) //big diamond
        &&!((i>36&&i<63)||(j>36&&j<63)||(i>11&&i<88&&j>t&&j<75)||(j>11&&j<88&&i>t&&i<75))) //subtract four central rects
        ||(i>t&&i<75&&j>t&&j<75 //add the central square
        &&(((k=i%t)*2<(l=j%t)&&k*-2+t>l) //stars: subtract left sides
        ||(l*2<k&&l*-2+t>k) //stars: subtract top sides
        ||((k=t-k)*2<(l=t-l)&&k*-2+t>l) //stars: subtract right sides
        ||(l*2<k&&l*-2+t>k)) //stars: subtract bottom sides
        )
        ?"0":"1");
        }Console.WriteLine();}
    }
}

大概可以让paren和逻辑运算符参与其中,但是我遇到了Lisp闪回。


该identicon看起来很有挑战性!辛苦了
DLosc 2015年

热爱进度可视化
杰里米·维里奇

8

Perl的186 184 181 151 147个字节,0个错误

Perl identicon

for$y(@i=0..99){$l=24-($k=$_%25-$y%25)-$y%25*2,$c=!($_/25%3)+!($y/25%3),print$c-2?abs$k>5|abs$l>5&&$c:$k<0^$l>0^$_>49^$y>49|!$k|!$l,'
'x/99/ for@i}

代码几乎和图像一样简单!我可以通过使模式以换行符开头而不是以换行符结尾来减少两个字节,但是从技术上讲,它不会无误地进行验证。到达难以理解的地步!


试用了您的解决方案,并得到了151个字节:ideone.com/HPgN11或141 + 1标志:ideone.com/sJcjNq在您的版本中,EOL打印条件也可能很简单x/99$/
nutki

@nutki由于标志版本保存10个字节,但是标志本身占用10个字节,因此我为您提供了其他解决方案!
CJ丹尼斯2015年

7

JavaScript(ES6),239个字节,99个不同

f=(c,n=50)=>Array(n).fill().map(c)
a=f((e,y)=>f((_,x)=>+((x+y>48&(x+y<68|x+y>80|x<y-6|x>y+6))|x>y-13&x<13&y>11)))
f((e,i)=>f((g,j)=>a[i].push(a[49-j][i])))
f((e,i)=>a.push(f((g,j)=>a[49-i][99-j],100)))
alert(a.map(e=>e.join('')).join(`
`))

这使用不等式为一个象限生成形状,其余代码将其旋转以填充其他象限。

文字只是JavaScript。这是一个非常简单的identicon:

JavaScript identicon

使用下面的代码片段进行验证,因为它使用了更多受支持的JavaScript并以等宽字体输出。您可能必须单击“整页”才能看到所有内容。


6

Python 3中,975个 963字节

python identicon

Z,L,J=zip,list,''.join;y=[134217727,520093695,2130706431,8573157375,34334572543,137413787647,274848546815,68690116607,17148411903,4262461439,1041235967,235405311,34078719,235405311,1040449535,4261675007,17146445823,68686053375,274844418047,137405431807,34326216703,8556396543,2113945599,503332863,100671487,1125899873288192,562949919866880,562949919866880,562949919866880,281474943156224,281474943156224,140737454800896,140737454800896,70368710623232,35184338534400,35184338534400,17592152489984,17592152489984,17592152489984,8796059467776,8796059467776,4398012956672,4398012956672,2198989701120,1099478073344,1099478073344,549722259456,549722259456,549722259456,274844352512];C=[L(n) for n in map(lambda j:'0'*(50-len(j[2:]))+j[2:],[bin(i) for i in y])];U=L(Z(*C[::-1]));Q=L(Z(*U[::-1]));Y=L(Z(*Q[::-1]));Y=[J(i) for i in Y];Q=[J(i) for i in Q];U=[J(i) for i in U];C=[J(i) for i in C];H=[i+j for i,j in Z(C,U)];R=[i+j for i,j in Z(Y,Q)];r='\n'.join(H+R);print(r)

打印的字符串为"Python"975字节,有30个错误。

对于"Python 3"我所用

Z,L,J=zip,list,''.join;y=[206183596032,515427532800,1082364788736,2190466744320,4393785065472,8793979084800,17591145854976,35046429810176,69887472902016,139672235548640,279293098729464,558560492658686,1117108092018687,1121510446079998,560768075440120,280409723903968,140256217079680,70230801899008,35183331899392,17590072107008,8791831576576,4389489999872,2181876416512,1065183346688,481061502976,844424930131968,1055531162664960,1108307720798208,1121501860331520,1124800395214848,1125625028935680,1125831187369984,1125607849080832,1123971466558464,1117377618050560,1090990144356096,985437229547392,563224798298048,985437229547456,1090990144356224,1117377618050816,1123971466558976,1125607849081856,1125831187372032,1125625028935680,1124800395214848,1121501860331520,1108307720798208,1055531162664960,844424930131968];C=[L(n) for n in map(lambda j:'0'*(50-len(j[2:]))+j[2:],[bin(i) for i in y])];U=L(Z(*C[::-1]));Q=L(Z(*U[::-1]));Y=L(Z(*Q[::-1]));Y=[J(i) for i in Y];Q=[J(i) for i in Q];U=[J(i) for i in U];C=[J(i) for i in C];H=[i+j for i,j in Z(C,U)];R=[i+j for i,j in Z(Y,Q)];r='\n'.join(H+R);print(r)

使它最多达到1104个字节,出现124个错误,但是"Python"除非OP要求,否则我会坚持使用。


由于函数(包括成员函数)是Python中的一流对象,因此您可以J=''.join在lambda上执行并保存12个字符。
DLosc 2015年

太好了,谢谢!@DLosc
扎克·盖茨

其他节省:1)用map; 重写几个列表理解;2)通过定义节省一些字节R=lambda x:L(Z(*x[::-1]));3)右括号后不需要空格。
DLosc

5

HTML - 223 210 193 191个字节,0个错误

HTML识别码

<!DOCTYPE html><title>A</title><script>D=document;M=Math.abs;for(y=0;b=y%75/25&3,y<100;D.write('<br>'),++y)for(x=0;a=x%75/25&3,x<100;++x)D.write(+!(a+b?a*b:M(x%25-12)+M(y%25-12)>13))</script>

100%有效的HTML。HTML和JavaScript都非常冗长,因此尽管identicon很简单,但代码仍然很长。


您可以通过替换您节省1个字节document.write()document.write(c?2-c/2:+(Math.abs(i)+Math.abs(j)<14)),++x);。另外,如果您使用单击图标<>,则可以构建一个堆栈片段来展示您的代码。
伊斯梅尔·米格尔

这是一个210字节长的解决方案:<!DOCTYPE html><title>A</title><script>for(W=document.write,y=0,A=25;b=y/A&3,j=y%A-12,y<100;W('<br>'),++y)for(x=0;a=x/A&3,c=a*(3-a)+b*(3-b),i=x%A-12,x<100;W(c?2-c/2:+(Math.abs(i)+Math.abs(j)<14)),++x);</script>
伊斯梅尔·米格尔

@IsmaelMiguel我不能运行它。Firebug说:“在未实现接口HTMLDocument的对象上调用了TypeError:'write'。” 但是,根据您的想法,我仍然设法将其缩减为210个字节!
CJ丹尼斯

它在Notepad ++(插件预览HTML)上与我合作。也许这是一个怪癖或一个错误,并且刷新没有按预期进行。我希望再次投票!
伊斯梅尔·米格尔

1
<p style=font-size:25px>◆■■◆<br>■  ■<br>■  ■<br>◆■■◆</p>
亚当

5

PowerShell 2.0中,448个 399 392 374 349字节,49个错误

在此处输入图片说明

一次只打印一行,还有一些漂亮的元替换/高尔夫表达

filter a{switch($_){1{"1"*13;"0"*12}2{"0"*12;"1"*13}3{"1"*25}4{"0"*25}6{"1"*$b;"0"*(25-2*$b);"1"*$b}7{$b--;"0"*$b;"1"*(25-2*$b);"0"*$b}}}$a='1164132c6417dd3317c26317116313164441d847717d3771163441162443d827737d27741624441132362c7236dd7233c27246113246';$x='$($a[$d++])';0..17|%{iex "`"0x$x..0x$x|%{```$b=```$_;```$($x|a;$x|a;$x|a;$x|a)-join''}`""}|iex

松散:

filter a
{
    switch($_)
    {
        1 { "1"*13; "0"*12 }
        2 { "0"*12; "1"*13 }
        3 { "1"*25 }
        4 { "0"*25 }
        6 {       "1"*$b; "0"*(25-2*$b); "1"*$b }
        7 { $b--; "0"*$b; "1"*(25-2*$b); "0"*$b }
    }
}
$a='1164132c6417dd3317c26317116313164441d847717d3771163441162443d827737d27741624441132362c7236dd7233c27246113246';
$x='$($a[$d++])';
0..17|%{iex "`"0x$x..0x$x|%{```$b=```$_;```$($x|a;$x|a;$x|a;$x|a)-join''}`""}|iex

这是最终通过管道传递给的内容iex

0x1..0x1|%{$b=$_;$(6|a;4|a;1|a;3|a)-join''}
0x2..0xc|%{$b=$_;$(6|a;4|a;1|a;7|a)-join''}
0xd..0xd|%{$b=$_;$(3|a;3|a;1|a;7|a)-join''}
0xc..0x2|%{$b=$_;$(6|a;3|a;1|a;7|a)-join''}
0x1..0x1|%{$b=$_;$(6|a;3|a;1|a;3|a)-join''}
0x1..0x6|%{$b=$_;$(4|a;4|a;4|a;1|a)-join''}
0xd..0x8|%{$b=$_;$(4|a;7|a;7|a;1|a)-join''}
0x7..0xd|%{$b=$_;$(3|a;7|a;7|a;1|a)-join''}
0x1..0x6|%{$b=$_;$(3|a;4|a;4|a;1|a)-join''}
0x1..0x6|%{$b=$_;$(2|a;4|a;4|a;3|a)-join''}
0xd..0x8|%{$b=$_;$(2|a;7|a;7|a;3|a)-join''}
0x7..0xd|%{$b=$_;$(2|a;7|a;7|a;4|a)-join''}
0x1..0x6|%{$b=$_;$(2|a;4|a;4|a;4|a)-join''}
0x1..0x1|%{$b=$_;$(3|a;2|a;3|a;6|a)-join''}
0x2..0xc|%{$b=$_;$(7|a;2|a;3|a;6|a)-join''}
0xd..0xd|%{$b=$_;$(7|a;2|a;3|a;3|a)-join''}
0xc..0x2|%{$b=$_;$(7|a;2|a;4|a;6|a)-join''}
0x1..0x1|%{$b=$_;$(3|a;2|a;4|a;6|a)-join''}

而这是471个字节,104个错误,它使用旋转逻辑

filter x($x,$y){1..$_|%{$t=49-$x;$x=$y;$y=$t};$x;$y}0..9999|%{$i=$_;$x=$i%100;$y=[math]::floor($i/100);if($x-ge50){$x-=50;if($y-ge50){$y-=50;$x,$y=2|x $x $y}else{$x,$y=1|x $x $y}}else{if($y-ge50){$y-=50;$x,$y=3|x $x $y}}if($x-ge25){$x-=25;if($y-ge25){$y-=25;[int]([math]::abs(13-$x)+[math]::abs(12-$y)-lt7)}else{[int]($y-gt11)}}else{if($y-ge25){$y-=25;[int]($y-gt11)}else{[int](($y-le$x-or$y-le24-$x)-and($y-ge$x-or$y-ge24-$x))}}}|%{if($i%100){$s+=$_}else{$s;$s="$_"}};$s

(相对)不符合要求:

function rotate($x, $y, $n)
{
    1..$n|%{
        $t = 49-$x
        $x = $y
        $y = $t
    }
    $x
    $y
}

$s=''
0..9999|%{
    $i=$_
    $x = $i%100
    $y = [math]::floor($i/100)
    if ($x -ge 50)
    {
        $x-=50
        if ($y -ge 50)
        {
            # bottom right
            $y -= 50
            $x,$y = rotate $x $y 2
        }
        else
        {
            # top right
            $x,$y = rotate $x $y 1
        }
    }
    else {if ($y -ge 50)
    {
        # bottom left
        $y -= 50
        $x,$y = rotate $x $y 3
    }}

    if ($x -ge 25)
    {
        $x-=25
        if ($y -ge 25)
        {
            $y-=25
            # bottom right
            [int]([math]::abs(13-$x)+[math]::abs(12-$y) -lt 7)
        }
        else
        {
            # top right
            [int]($y -gt 11)
        }
    }
    else
    {
        if ($y -ge 25)
        {
            $y-=25
            # bottom left
            [int]($y -gt 11)
        }
        else
        {
            # top left
            [int](($y -le $x -or $y -le 24-$x) -and ($y -ge $x -or $y -ge 24-$x))
        }
    }
}|%{if ($i%100){$s+=$_}else{$s;$s="$_"}};$s

4

Python 2中,712个 711字节

该程序通过使用游程长度编码并将游程存储为字符来为“ Python”生成位数组。

a=":>;$ 8'$;8' 6)$;6) 4+$;4+ 2-%:3, 0/%:1. /0&9.1 1.&9,3 3,'8*5 5*(7)6 7((7'8 9&)6$; ;$)O)$.$ 9&)O(%.% 7(*N(&,& 5**N'',' 3,+M'(*( 1.+M&)*) /0,L&*(* 0/-K%+(+ 2--K%,&, 4+.J$-&- 6).J$.$. 8'.V$ :%/ #<m $;j $;h $;f %:e %:c &9` &9^ '8\ (7[ (7Y )6V )6U )6U *5U *5U +4U +4U ,3U -2U -2U .1U .1U .1U /0U #<U0 #<U1 #<U1 #<U2 #<U2 #<U3 #<U3 #<U4 #<U4 #<U5 #<U5 #<U6 #<U6 #;V7 #9X7 #7Z8 #5\8 #3^9 #1`9 #/b: #-d: #+f; #)h; #'j #%l #b/% #c.' $.$V.) $.%-$K-+ %,&-$K-- %+(+%L,/ &*(+%L,0 &*))&M+. '(*)&M+, '(+''N** (&,&(N*( (&-%(O)& )$.%(O)$ <;$7(& <9&7(( <7(8'* <5*8', <3,9&. <1.9&0 </0:%/ <-2:%- <+4;$+ <)6;$) <'8@ <%:>".split()
for b in[[ord(c)-35for c in L]for L in a]:print''.join(c*n for c,n in zip('01'*8,b+[100-sum(b)]))

在自动高尔夫球手之前,它看起来(非常相似!)像:

ctext = ":>;$ 8'$;8' 6)$;6) 4+$;4+ 2-%:3, 0/%:1. /0&9.1 1.&9,3 3,'8*5 5*(7)6 7((7'8 9&)6$; ;$)O)$.$ 9&)O(%.% 7(*N(&,& 5**N'',' 3,+M'(*( 1.+M&)*) /0,L&*(* 0/-K%+(+ 2--K%,&, 4+.J$-&- 6).J$.$. 8'.V$ :%/ #<m $;j $;h $;f %:e %:c &9` &9^ '8\ (7[ (7Y )6V )6U )6U *5U *5U +4U +4U ,3U -2U -2U .1U .1U .1U /0U #<U0 #<U1 #<U1 #<U2 #<U2 #<U3 #<U3 #<U4 #<U4 #<U5 #<U5 #<U6 #<U6 #;V7 #9X7 #7Z8 #5\8 #3^9 #1`9 #/b: #-d: #+f; #)h; #'j #%l #b/% #c.' $.$V.) $.%-$K-+ %,&-$K-- %+(+%L,/ &*(+%L,0 &*))&M+. '(*)&M+, '(+''N** (&,&(N*( (&-%(O)& )$.%(O)$ <;$7(& <9&7(( <7(8'* <5*8', <3,9&. <1.9&0 </0:%/ <-2:%- <+4;$+ <)6;$) <'8@ <%:>".split()

for seq in [[ord(c)-35 for c in L] for L in ctext] :
    print ''.join(c*n for c,n in zip('01'*8, seq + [100 - sum(seq)]))

此RLE方法应导致零错误。

'python'的identicon数组看起来容易得多,但我认为如果使用它,那将是骗人的。


所做的更改可能是因为我稍微修改了黑白转换,以使某些行的锯齿少一些。
加尔文的业余爱好

谢谢。我已经基于零错误的新位数组更新了答案。
逻辑骑士

您的高尔夫球手如何选择开始换行,而不是在in和之间添加空格,这非常有趣zip。似乎错过了35和之间的空间for
Sp3000

@ Sp3000,插入的新行可能是我在复制/粘贴操作中的错误。我添加了一条新规则来优化35 for类型序列(如果以下标识符以e!开头,请小心保留空格)。谢谢你的建议。
逻辑骑士

我认为Python的最新版本已修复了以开头的标识符的问题e。也许尝试更新和测试?(供参考,我在2.7.9上尝试过)
Sp3000 2015年

4

IDL,472个字节,290个错误

啊。如果我可以将函数存储为变量,或者一次执行多个字符串替换等操作,则时间会短得多。

v=execute(repstr(repstr(repstr("n=25&a=12&b=24&r='IDLanROI'&x=rebin([0:b],n,n,/s)&y=#x,4)&w=.5*(x-1)&h=(y ge w@y lt b-.5*x)@~(y ge a-w@y lt a+w@x lt a)&i=reform((obj_new(r,[0,a,13,b,b,18,a,6,a,a,11,0],[a,0,0,11,a,a,6,a,18,b,b,a^,n,n)&j=reform(~((obj_new(r,[a,7,a,13,17,17,a],[7,a,17,17,13,a,7^),n,n)&print,string([[h,i,#i,1),#h,1)],[i,j,j,#i,1)],[#i,3),j,j,#i,2)],[#h,3),#i,3),#i,2),#h,2)]],'(100I1)')",'@',' and '),'#','rotate('),'^','])).containspoints(x,y)<1'))

在此处输入图片说明

1100000000000000000000000000000000000110000000000000000000000010000000000000111111111111111111111111
1111000000000000000000000000000000001111000000000000000000000111000000000000111111111111111111111111
1111110000000000000000000000000000011111100000000000000000001111100000000000011111111110111111111110
1111111100000000000000000000000000111111110000000000000000011111110000000000011111111110011111111110
1111111111000000000000000000000001111111111000000000000000111111111000000000001111111100011111111100
1111111111110000000000000000000011111111111100000000000001111111111100000000001111111100001111111100
1111111111111100000000000000000111111111111110000000000011111111111110000000000111111000001111111000
1111111111101111000000000000001111111011111111000000000111111101111111000000000111111000000111111000
1111111110001111110000000000011111110001111111100000001111111000111111100000000011110000000111110000
1111111000001111111100000000111111100000111111110000011111110000011111110000000011110000000011110000
1111100000001111111111000001111111000000011111111000111111100000001111111000000001100000000011100000
1110000000001111111111110011111110000000001111111111111111000000000111111100000001100000000001100000
1100000000001111111111110111111100000000000111111111111110000000000011111110000000111111111111000000
1111000000001111111111000011111110000000000000000000000000000000000111111110000000111111111111000000
1111110000001111111100000001111111000000000000000000000000000000001111111100000000011111111110000000
1111111100001111110000000000111111100000000000000000000000000000011111111000000000011111111110000000
1111111111001111000000000000011111110000000000000000000000000000111111110000000000001111111100000000
1111111111111100000000000000001111111000000000000000000000000001111111100000000000001111111100000000
1111111111110000000000000000000111111100000000000000000000000011111111000000000000000111111000000000
1111111111000000000000000000000011111100000000000000000000000011111110000000000000000111111000000000
1111111100000000000000000000000001111100000000000000000000000011111100000000000000000011110000000000
1111110000000000000000000000000000111100000000000000000000000011111000000000000000000011110000000000
1111000000000000000000000000000000011100000000000000000000000011110000000000000000000001100000000000
1100000000000000000000000000000000001100000000000000000000000011100000000000000000000001100000000000
0000000000000000000000000000000000001100000000000000000000000011000000000000000000000000000000000000
0000000000001100000000000111111111111111111111111111111111111111111111111110000000000001000000000000
0000000000011110000000000111111111111111111111111111111111111111111111111110000000000011100000000000
0000000000111111000000000111111111111111111111111111111111111111111111111110000000000111110000000000
0000000001111111100000000111111111111111111111111111111111111111111111111110000000001111111000000000
0000000011111111110000000111111111111111111111111111111111111111111111111110000000011111111100000000
0000000111111111111000000111111111111111111111111111111111111111111111111110000000111111111110000000
0000001111111111111100000111111111111111111111111111111111111111111111111110000001111111111111000000
0000011111110111111110000111111111111011111111111111111111111101111111111110000011111110111111100000
0000111111100011111111000111111111110001111111111111111111111000111111111110000111111100011111110000
0001111111000001111111100111111111100000111111111111111111110000011111111110001111111000001111111000
0011111110000000111111110111111111000000011111111111111111100000001111111110011111110000000111111100
0111111100000000011111111111111110000000001111111111111111000000000111111111111111100000000011111110
1111111000000000001111111111111100000000000111111111111110000000000011111111111111000000000001111111
0111111100000000000000000111111110000000000111111111111111000000000011111110000000000000000011111111
0011111110000000000000000111111111000000001111111111111111100000000111111110000000000000000111111110
0001111111000000000000000111111111100000011111111111111111110000001111111110000000000000001111111100
0000111111100000000000000111111111110000111111111111111111111000011111111110000000000000011111111000
0000011111110000000000000111111111111001111111111111111111111100111111111110000000000000111111110000
0000001111111000000000000111111111111111111111111111111111111111111111111110000000000001111111100000
0000000111111000000000000111111111111111111111111111111111111111111111111110000000000001111111000000
0000000011111000000000000111111111111111111111111111111111111111111111111110000000000001111110000000
0000000001111000000000000111111111111111111111111111111111111111111111111110000000000001111100000000
0000000000111000000000000111111111111111111111111111111111111111111111111110000000000001111000000000
0000000000011000000000000111111111111111111111111111111111111111111111111110000000000001110000000000
0000000000011000000000000111111111111111111111111111111111111111111111111110000000000001100000000000
0000000000011000000000000111111111111111111111111111111111111111111111111110000000000001100000000000
0000000000111000000000000111111111111111111111111111111111111111111111111110000000000001100000000000
0000000001111000000000000111111111111111111111111111111111111111111111111110000000000001110000000000
0000000011111000000000000111111111111111111111111111111111111111111111111110000000000001111000000000
0000000111111000000000000111111111111111111111111111111111111111111111111110000000000001111100000000
0000001111111000000000000111111111111111111111111111111111111111111111111110000000000001111110000000
0000011111111000000000000111111111111111111111111111111111111111111111111110000000000001111111000000
0000111111110000000000000111111111111011111111111111111111111101111111111110000000000000111111100000
0001111111100000000000000111111111110001111111111111111111111000111111111110000000000000011111110000
0011111111000000000000000111111111100000111111111111111111110000011111111110000000000000001111111000
0111111110000000000000000111111111000000011111111111111111100000001111111110000000000000000111111100
1111111100000000000000000111111110000000001111111111111111000000000111111110000000000000000011111110
1111111000000000001111111111111100000000000111111111111110000000000011111111111111000000000001111111
0111111100000000011111111111111110000000000111111111111111000000000011111111111111100000000011111110
0011111110000000111111100111111111000000001111111111111111100000000111111110111111110000000111111100
0001111111000001111111000111111111100000011111111111111111110000001111111110011111111000001111111000
0000111111100011111110000111111111110000111111111111111111111000011111111110001111111100011111110000
0000011111110111111100000111111111111001111111111111111111111100111111111110000111111110111111100000
0000001111111111111000000111111111111111111111111111111111111111111111111110000011111111111111000000
0000000111111111110000000111111111111111111111111111111111111111111111111110000001111111111110000000
0000000011111111100000000111111111111111111111111111111111111111111111111110000000111111111100000000
0000000001111111000000000111111111111111111111111111111111111111111111111110000000011111111000000000
0000000000111110000000000111111111111111111111111111111111111111111111111110000000001111110000000000
0000000000011100000000000111111111111111111111111111111111111111111111111110000000000111100000000000
0000000000001000000000000111111111111111111111111111111111111111111111111110000000000011000000000000
0000000000000000000000000000000000001100000000000000000000000110000000000000000000000000000000000000
0000000000011000000000000000000000011100000000000000000000001110000000000000000000000000000000000011
0000000000011000000000000000000000111100000000000000000000011110000000000000000000000000000000001111
0000000000111100000000000000000001111100000000000000000000111110000000000000000000000000000000111111
0000000000111100000000000000000011111100000000000000000001111110000000000000000000000000000011111111
0000000001111110000000000000000111111100000000000000000011111110000000000000000000000000001111111111
0000000001111110000000000000001111111100000000000000000111111110000000000000000000000000111111111111
0000000011111111000000000000011111111000000000000000001111111100000000000000000000000011111111111111
0000000011111111000000000000111111110000000000000000011111111000000000000000000000001111001111111111
0000000111111111100000000001111111100000000000000000111111110000000000000000000000111111000011111111
0000000111111111100000000011111111000000000000000001111111100000000000000000000011111111000000111111
0000001111111111110000000111111110000000000000000011111111000000000000000000001111111111000000001111
0000001111111111110000000111111100000000000111111111111110000000000011111110111111111111000000000011
0000011000000000011000000011111110000000001111111101111111000000000111111110111111111111000000000111
0000011100000000011000000001111111000000011111110000111111100000001111111000001111111111000000011111
0000111100000000111100000000111111100000111111100000011111110000011111110000000011111111000001111111
0000111110000000111100000000011111110001111111000000001111111000111111100000000000111111000111111111
0001111110000001111110000000001111111011111110000000000111111101111111000000000000001111011111111111
0001111111000001111110000000000111111111111100000000000011111111111110000000000000000011111111111111
0011111111000011111111000000000011111111111000000000000001111111111100000000000000000000111111111111
0011111111100011111111000000000001111111110000000000000000111111111000000000000000000000001111111111
0111111111100111111111100000000000111111100000000000000000011111110000000000000000000000000011111111
0111111111110111111111100000000000011111000000000000000000001111100000000000000000000000000000111111
1111111111111111111111110000000000001110000000000000000000000111000000000000000000000000000000001111
1111111111111111111111110000000000000100000000000000000000000010000000000000000000000000000000000011

4

PHP - 417 414 413 410个字节,0个错误,(2 0警告!)

PHP identicon

<?eval(preg_replace(['/[&|]/','/[a-z]/'],['$0$0','$$0'],"FOR(y=0,r=49+s=1+t=99;y<s;++y,PRINT'
')FOR(x=0;u=2*x-y,v=2*x+y,w=x-2*y,z=x+2*y,x<s;++x)ECHO-(w<-150&z<198|u>0&v<49|w>51&z>t|u<t&v>249|x<50&(w>26&z>49|z>74&(w>1|x<25&(w>-49|z>t&w>-74)))|y<50&(v>224&u<r|u<124&(v>199|y<25&(v>r|v>124&u<t)))|y>49&(v<74&u>-50|u>-25&(v<t|y>74&(v<r|v<174&u>0)))|x>49&(z<248&w<-125|z<223&(w<-s|x>74&(w<-50|w<-25&z<198))))+1;"));

需要PHP> = 5.4。

PHP允许其关键字为任意大小写,因此在高尔夫球代码中,我对关键字使用大写字母,对变量使用小写字母。preg_replace仅用于解开代码并eval运行它。我$从所有变量中删除并使用正则表达式重新插入它们。我也改变了每个实例的&&,并||&|,并用正则表达式一倍他们。我不能做同样的把戏,++因为我+也不想让我加倍。我试图扭转逻辑来摆脱-刚过echo,但它改变了太多99s转换100秒。但是,我确实设法避免使用单个空格!

我也可以将Ismael Miguel的建议也应用于循环的另一组{}括号for,但是,我不得不使用print代替echoprintecho都是语言构造(不需要括号的“魔术”关键字()),因此在for声明中不允许使用。但是,由于print像函数一样具有返回值,因此可以在中使用它for。通过将变量分配从第三部分移动到第二部分,我也可以消除警告!


我从您的答案中减少了3个字节。这是一个pastebin:pastebin.com/12JRtgGW(只需忽略警告)
Ismael Miguel

谢谢@IsmaelMiguel!我还通过重新排列逻辑将错误的数量减少到仅2个。
CJ丹尼斯

2
可以包含颜色标识图标图像吗?除非确实需要,否则可能会删除笨重的输出文本。:)
卡尔文的爱好2015年

1
@IsmaelMiguel我说错了,我的意思是警告,而不是错误!我的文件最初有\r\n行尾,但是我将其更改为仅\n保存一个字节,如您所建议。
CJ丹尼斯

1
诸如此类的可以改善和超越语言限制的答案,应该有一个双重投票按钮。
伊斯梅尔·米格尔

3

,116字节(96错误)

点标识

换行符仅用于格式化目的,对代码没有影响:

l:24-_*2
b:1X25RL25
t:0Xl.1X25-lM,13
tAL:t@>1
g:(b@<13AL(1X12-_RL2J0X2*_+1M,12)).tALt.b
Fi,50Fj,50g@i.:(g50-j-1i)
PgJ:n
RVg

略带注释:

l: 24-_*2                               Lambda function for use in calculating t
b: (1 X 25) RL 25                       25x25 block of 1s
t: (0 X l).(1 X (25-l)) M ,13           One of the skinny white triangles
t AL: t@>1                              Append t[1:] to t, so as to have two triangles
w: (1 X 12-_) RL 2 J (0 X 2*_+1) M ,12  The white wedge shape
g: (b@<13 AL w).t AL t.b                Build top left quadrant
Fi ,50
 Fj ,50
  g@i .: g@(50-j-1)@i                   Copy, rotating, and add as top right quadrant
P(g J: n)                               Join on newline and print as top half
RV g                                    Reverse top half for bottom half (auto-printed)

该代码将identicon构建为字符串列表。一旦您知道这X是字符串乘法,RL重复列表,AL附加列表和J联接,就相当容易理解(IMHO)。变量btw(在非高尔夫版本中)对应于identicon的以下部分:

第1部分 第2部分 第三部分

左上象限如下所示:

Wt
tb

其中W代表b放置在上方的13行w。然后,我们旋转并反转以获得该图的其余部分。

这些错误是由于我们如何生成白色三角形(上面的第二个)而产生的。它们的大小并不完全相同-一个具有奇数个白色像素,另一个具有偶数-但将它们视为相同(没有底部的顶行,总共25行)可以节省一些个字节。这是一个122字节的版本,可以正确执行偶数阶跃(0个错误):

f:25
l:23-_*2+f*(_>12)
b:1XfRLf
t:(0Xl.1Xf-l)@<fM,f
g:(b@<13AL(1X12-_RL2J0X2*_+1M,12)).tALt.b
Fi,50Fj,50g@i.:(g50-j-1i)
PgJ:nRVg

并且,只是出于娱乐目的,原始版本(非高尔夫球版)的Python翻译:

l = lambda a: 24 - a * 2
b = ["1" * 25] * 25
t = list(map(lambda a: "0"*l(a) + "1"*(25-l(a)), range(13)))
t += t[1:]
w = list(map(lambda a: ("0"*(2*a+1)).join(["1"*(12-a)]*2), range(12)))
g = list(map(str.__add__, b[:13] + w, t)) + list(map(str.__add__, t, b))
for i in range(50):
    for j in range(50):
        g[i] += g[50-j-1][i]
g = "\n".join(g)
print(g)
print(g[::-1])

3

Ruby,324个字节,216个错误

Ruby的identicon

Identicon使用字符串Ruby,我有点喜欢。纯几何+对称。三角形的边线方程,对矩形旋转45゜以使其轴线对齐。牺牲了大约100个错误,少了几个字节。

A=[]
5.times{|b|0.upto(49){|j|b<2&&A<<[0]*50&&next
0.upto(49){|i|A[99-j][i]=A[j][99-i]=A[i][j]=A[99-i][99-j]=A[i][j]
i<25&&j>24?0:next
A[i][j]=2*j-i<50?0:j>37&&i>13&&j-i+2<26?0:1
b<3&&A[j-13][24-i]=A[i][j]
A[i+=25][j-25]=A[i-25][j]
x=i-j
y=i+j
A[i][j]=x>-7&&x<7&&y>67&&y<81||x<-12||x>12||y<63||y>86?1:0}}}
puts A.map(&:join)

3

///,1319字节,0个错误

在此处输入图片说明

/=/gD//_/QPG//-/NAN//)/N0M//(/M0F//*/LCL//&/GTQ//%/GRG//$/GIG//#/DPK//@/BcQ//!/BH//z/BAQ//y/CI//x/AP//w/ALOK//v/ALIL//u/NRM//t/CR//s/SRS//r/NPN//q/MIM//p/GcG//o/DAAD//n/CP//m/C0//l/1AFK//k/CT//j/CE//i/FAF//h/CH//g/CO//f/AO//e/FMHFM//d/FD//c/AH//b/FF//a/QH1HQ//Z/LHBHL//Y/KHGHK//X/DHMHD//W/1HSH1//V/BHKHB//U/JA//T/EE//S/F1//R/E0//Q/B1//P/IE//O/I0//N/G1//M/GD//L/DD//K/D1//J/CA//I/AE//H/A0//G/BD//F/BB//E/00//D/11//C/AAA//B/11111//A/00000/bBAIFKUbB
sfdUs
ifdUi
qxSUq
rxSUr
pCFUp
aCFUa
VmMUV
ZmMUZ
YjNUY
XjNUX
WtGUW
lnGUlH
WkQgKHSH1
XkQhQHMHD
YJBkMHGHK
ZJBjdH!L
VhLCFV
ahLfFNH1HQ
pyKcFScG
ryKPbLPN
q=IbGIM
i=Abi
sn1RbFKRS
d0dn10bFQ0d
AIFL=g1U
fd0DkK0DkKU
fd0*E*JH
xSE@R@JH
xSE$T$JI
CFRuAuJI
CFReJO
mMT)I)JO
mMT%O%JP
jNAzPzJP
jNvAvCC
tGH#c#CC
tGt1n1Cm
kQHocoJOD
kQwAwJHL
JBA!BP!BgQ
JBT&O&hN
hLTNENINENtF
hLRemd
yKR(A(fFL
yKE-T-cFQ
=E_R_OFN
=0BfBEBf!b
n10KjL0KjLRbD
nKhLhD0bL
bQ==n
bKRDkK0DkLn
FSA*E*0Dg
FMO@R@0Dg
FGAA$T$EKy
FBfuAuEKy
FKCeRLh
St)I)RLh
MJ%O%TBJ
GgzPzTBJ
BULILAvAQk
KJO#c#AQk
1CJI1n1HGt
CmocoAGt
CCLOKAwANj
CC!BP!BTNj
JP&O&TMm
JPNENINEum
JOeRFC
JO(A(EFC
JI-T-ESx
JI_R_0Sx
JHBfBEBfB0df
JHKjL0KjFQf
UDhLhFBAI
bbSnbB
SRbFLE1ns
FAbSTDgi
MIbNHDgq
NPbBOKyr
GcbDAAKyp
QH1HFMAILha
!KHFQxLhV
LH!FKmBJZ
KHGHFtBJY
DHMHGJQkX
1HSHLyQkW
lH1nGtlH
WUGtW
XUNjX
YUNjY
ZUMmZ
VUMmV
aUFCa
pUFCp
rUSxr
qUSxq
iUdfi
sUdfs
d0dUFKAId0d

在线尝试!

我花了大约2个小时来制作,因为我是手动更换东西。我在///中所做的最大的事情。

可能我还能打高尔夫球。

另外,请参阅////中的高尔夫球手Erik的答案(比我的短4个字节)。



2

Fortran,214个字节,200个错误

字符串“ Fortran”的标识

Fortran可能不是代码高尔夫的首选,但是它的identicon很简单,我想我可以试试看。实际上,我无法与某些terser语言竞争,但是使用隐式变量和其他类似的技巧(例如,-double作为xor),还不错-我将其缩减为214个字节:

logical A(-12:87,-12:87)
do 1 r=-12,12
do 1 s=-12,12
x=abs(r)
y=abs(s)
l=x+y<6
k=(x<y/2+7.and.y<x/2+7)-l
A((/r+25,r+50/),(/s,s+75/))=k
A((/r,r+75/),(/s+25,s+50/))=k
1A((/r,r+75/),(/s,s+75/))=l
print'(100I1)',-A
end

注意:不适用于gfortranifort如果给文件.f90扩展名,它将与一起编译(这将激活自由格式源)。


2

Perl- 3244 3188 1609 1387字节,0 13 66 78错误

我花了一些时间才意识到,但图标是对称的。另外,我只能每100个字符后打印换行符,而不是对其进行硬编码。

@i=qw(1;76 0;24 1;77 0;21 1;2 1;78 0;22 1;79 0;21 0;4 1;17 0;4 1;55 0;20 1;81 0;13 1;6 0;6 1;13 0;6 1;57 0;11 1;7 0;7 1;11 0;7 1;12 0;1 1;45 0;9 1;8 0;8 1;9 0;8 1;11 0;3 1;22 0;3 1;20 0;7 1;9 0;9 1;7 0;9 1;10 0;5 1;20 0;5 1;20 0;5 1;10 0;10 1;5 0;10 1;9 0;7 1;18 0;7 1;20 0;3 1;11 0;11 1;3 0;11 1;8 0;9 1;16 0;9 1;20 0;1 1;12 0;12 1;1 0;12 1;7 0;11 1;14 0;11 1;32 0;11 1;3 0;11 1;8 0;9 1;16 0;9 1;33 0;10 1;5 0;10 1;9 0;7 1;18 0;7 1;20 0;3 1;11 0;9 1;7 0;9 1;10 0;5 1;20 0;5 1;20 0;5 1;10 0;8 1;9 0;8 1;11 0;3 1;22 0;3 1;20 0;7 1;9 0;7 1;11 0;7 1;12 0;1 1;24 0;1 1;20 0;9 1;8 0;6 1;13 0;6 1;57 0;11 1;7 0;5 1;15 0;5 1;56 0;13 1;6 0;4 1;17 0;4 1;55 0;15 1;5 0;3 1;19 0;3 1;54 0;17 1;4 0;2 1;21 0;2 1;53 0;19 1;3 0;1 1;23 0;1 1;52 0;21 1;2 1;76 0;23 1;1 1;25 0;50 1;25 1;25 0;50 1;25 1;25 0;50 1;25 1;25 0;50 1;25 1;25 0;50 1;25 1;25 0;50 1;25 1;25 0;50 1;25 1;12 0;1 1;12 0;50 1;12 0;1 1;12 1;11 0;3 1;11 0;50 1;11 0;3 1;11 1;10 0;5 1;10 0;50 1;10 0;5 1;10 1;9 0;7 1;9 0;50 1;9 0;7 1;9 1;8 0;9 1;8 0;50 1;8 0;9 1;8 1;7 0;11 1;7 0;50 1;7 0;11 1;7 1;8 0;9 1;8 0;50 1;8 0;9 1;8 1;9 0;7 1;9 0;50 1;9 0;7 1;9 1;10 0;5 1;10 0;50 1;10 0;5 1;10 1;11 0;3 1;11 0;50 1;11 0;3 1;11 1;25 0;50 1;25 1;25 0;50 1;25 1;25 0;50 1;25 1;25 0;50 1;25 1;25 0;50 1;25 1;25 0;50 1;25 1;25 0;50 1;25 1;25 0;50 1;25);$n=0;for(@i,reverse@i){@p=split';';$n+=$p[1];print $p[0]x int($p[1]);if($n>=100){print"\n";$n=0}}

为此生成文本:

佩尔


一些简单的节省了:你并不需要$n=0,也不int(); if($n>=100){print"\n";$n=0}$n>99and$n=!print"\n"; @p可以替换为/(.*);(.*)/;$n+=$2;print$1x$2
xebtl

2

///,1315字节,0个错误

///

/-/\/\///O/00000-I/11111-o/OOO-i/11-@/000-!/II-8/O0-|/Ii-*/O@-+/0|-_/i1-=/oO-#/ii-$/I1-%/|i-^/!1-&/*0-2/+1-3/=O-4/I8_8I-5/!!-6/#8I8#-7/$818$-9/18^81-A/_8|8_-B/i8%8i-C/o@-D/O8-d/o8-E/o0-F/|1-g/+i-H/O*-h/o*-j/!%8!%-k/!i-l/!O!-m/#80#-n/0_-p/1O!_-q/^@^-r/iOOi-s/0$-t/
=-u/%8g-v/o&-w/|D|-x/
F*2-y/#*_O-z/#o#0-Z/0IHI-Y/E0/5i_D0!_35I
qHk3q
lHk3l
uO&^3uxO&^3F*2
wo!3w
7o!37
4og34
6og36
AE23A
BE23B
9C|39
ph+3p8
9Csh_8^81
BCsd$8%8i
A=ICg8|8_
6=IYk8I8#
4d#o!4
7d#H!F818$
wdnD!^D|xdn&5#*2
uhi805|8g
lhiO5l
qv1@5!_@^
k0kv105!$0k
D0!#hih13
Hk0iCn0iCn3
Hk0z0#o#=8
O&^00ID$@ID$=8
O&^0+8+@+8+=80
o!@F@%OF@%=80
o!@j=*
og@2g82g=*
og@+@|*|@|=&
E2OIO$&IO$=&
E2OmOOmoo
C|8i&_Di&_oo
C|C1v1oE
Cs8rDr=*i
CsOyO#*_=8#tIOI8I&I8Ih$tI@+@s*|@sdF
d#@2028202C!
d#@jEk
dn@%0!O%0!H!#
dn02OF@2OFD!$
hi0s*+@$*+*!F
hiZ0Z85
v1nY#nY#@5i
v_d#di05#
5$hihiv
5_@iCn0iC0#v
!^Oz0zih
!%*ID$@ID$0ih
!|OO|8+@+8+0nd0
!IHF@%OF@%0nd0
!_oj@#d
^CFg82g@#d
%=|@|*|@|@0I=
|hIO$&IO$@0I=
I3mOOmO$C0
_=*i&_Di&_O$C0
1o=801v18|C
oErDrO|C
ooyOyFY
ooI8I&I8I@2Yt*+@s*|@s@gEt*2028202@%Et*j@!ot*%0!O%0!00!ot82OF@2OF00^O&t8s*+@$*+0^O&t8IHI0Z0kHt8_Y#nY!$H
3id#d!ID0
55^v5I
^@5!#001vq
!O5^@0ihl
%805F8ihu
F&5I*_d2*2
|D5iOO_d+D|
$818!%D0#d7
I8_8!$O&#d4
#8I8!_EI=6
_8|8!CI=A
i8%8|=$C0B
18^8#dsC09
p81h+Cp8
93|C9
B3FYB
A3FYA
63%E6
43%E4
73!o7
w3!owx3^H2*2
u3^Hg8g
l3kHl
q3kHq
k0k3!_D0k0k

在线尝试!

这是的标识///。这可能是我曾经///做过的最大的事情!


1

IDL 8.4、333字节,105个错误

这样就给出了不同的标识,而我能够使用完全不同的方法来打高尔夫球。

IDL 8.4身份图标

b=byte('AKMLOJMLPIMLQHMLRGMLSFMLTEMLUDMLVCMLWBMLXAMLfLfLNKBWOJCVPIDUQHETRGFSSFGRTEHQUDIPVCJOWBKNXALMfLMLfLfLfLfLfLfLfLTLFLTLFLTLFLTLFLTLFLTLFLTLFLTLFLTLFLTLFLTLFLTLFLfLfLfLfLfLf')-64
f=[]
for i=1,169 do f=[f,replicate(i mod 2,b[i-1])]
f=reform(f,50,50)
print,[[rotate(f,4),rotate(f,5)],[rotate(f,7),rotate(f,6)]],format='(100I1)'
end

首先,将第1行中的字符转换为字节值并减去64(这样A = 1,B = 2,依此类推)。然后,将许多连续的1和0粘贴到一个数组中,并将其重新设置为50x50(即左上象限,但转置)。然后,转置并旋转4次,将它们缝在一起,然后打印。

1111111111111111111111111000000000000000000000000011111111111110000000000001111111111111000000000001
0111111111111011111111111000000000000000000000000011111111111110000000000001111111111111000000000011
0011111111111001111111111000000000000000000000000011111111111110000000000001111111111111000000000111
0001111111111000111111111000000000000000000000000011111111111110000000000001111111111111000000001111
0000111111111000011111111000000000000000000000000011111111111110000000000001111111111111000000011111
0000011111111000001111111000000000000000000000000011111111111110000000000001111111111111000000111111
0000001111111000000111111000000000000000000000000011111111111110000000000001111111111111000001111111
0000000111111000000011111000000000000000000000000011111111111110000000000001111111111111000011111111
0000000011111000000001111000000000000000000000000011111111111110000000000001111111111111000111111111
0000000001111000000000111000000000000000000000000011111111111110000000000001111111111111001111111111
0000000000111000000000011000000000000000000000000011111111111110000000000001111111111111011111111111
0000000000011000000000001000000000000000000000000011111111111110000000000001111111111111111111111111
1111111111111111111111111111111111111111111111111111111111111110000000000001111111111111111111111111
1111111111111111111111111111111111111111111111111111111111111110000000000000000000000011000000000001
1111111111111011111111111111111111111111111111111111111111111110000000000000000000000111000000000011
1111111111111001111111111111111111111111111111111111111111111110000000000000000000001111000000000111
1111111111111000111111111111111111111111111111111111111111111110000000000000000000011111000000001111
1111111111111000011111111111111111111111111111111111111111111110000000000000000000111111000000011111
1111111111111000001111111111111111111111111111111111111111111110000000000000000001111111000000111111
1111111111111000000111111111111111111111111111111111111111111110000000000000000011111111000001111111
1111111111111000000011111111111111111111111111111111111111111110000000000000000111111111000011111111
1111111111111000000001111111111111111111111111111111111111111110000000000000001111111111000111111111
1111111111111000000000111111111111111111111111111111111111111110000000000000011111111111001111111111
1111111111111000000000011111111111111111111111111111111111111110000000000000111111111111011111111111
1111111111111000000000001111111111111111111111111111111111111110000000000001111111111111111111111111
0000000000000000000000000111111111111111111111111111111111111111111111111111111111111111000000000000
0000000000000000000000000111111111111111111111111111111111111111111111111111111111111111000000000000
0000000000000000000000000111111111111111111111111111111111111111111111111111111111111111000000000000
0000000000000000000000000111111111111111111111111111111111111111111111111111111111111111000000000000
0000000000000000000000000111111111111111111111111111111111111111111111111111111111111111000000000000
0000000000000000000000000111111111111111111111111111111111111111111111111111111111111111000000000000
0000000000000000000000000111111111111111111111111111111111111111111111111111111111111111000000000000
0000000000000000000000000111111100000000000011111111111100000000000011111111111111111111000000000000
0000000000000000000000000111111100000000000011111111111100000000000011111111111111111111000000000000
0000000000000000000000000111111100000000000011111111111100000000000011111111111111111111000000000000
0000000000000000000000000111111100000000000011111111111100000000000011111111111111111111000000000000
0000000000000000000000000111111100000000000011111111111100000000000011111111111111111111000000000000
1111111111111111111111111111111100000000000011111111111100000000000011111111111111111111000000000000
1111111111111111111111111111111100000000000011111111111100000000000011111111111111111111000000000000
1111111111111111111111111111111100000000000011111111111100000000000011111111111111111111000000000000
1111111111111111111111111111111100000000000011111111111100000000000011111111111111111111000000000000
1111111111111111111111111111111100000000000011111111111100000000000011111111111111111111000000000000
1111111111111111111111111111111100000000000011111111111100000000000011111111111111111111000000000000
1111111111111111111111111111111100000000000011111111111100000000000011111111111111111111000000000000
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000000000000
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000000000000
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000000000000
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000000000000
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000000000000
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000000000000
0000000000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
0000000000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
0000000000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
0000000000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
0000000000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
0000000000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
0000000000001111111111111111111100000000000011111111111100000000000011111111111111111111111111111111
0000000000001111111111111111111100000000000011111111111100000000000011111111111111111111111111111111
0000000000001111111111111111111100000000000011111111111100000000000011111111111111111111111111111111
0000000000001111111111111111111100000000000011111111111100000000000011111111111111111111111111111111
0000000000001111111111111111111100000000000011111111111100000000000011111111111111111111111111111111
0000000000001111111111111111111100000000000011111111111100000000000011111111111111111111111111111111
0000000000001111111111111111111100000000000011111111111100000000000011111111111111111111111111111111
0000000000001111111111111111111100000000000011111111111100000000000011111110000000000000000000000000
0000000000001111111111111111111100000000000011111111111100000000000011111110000000000000000000000000
0000000000001111111111111111111100000000000011111111111100000000000011111110000000000000000000000000
0000000000001111111111111111111100000000000011111111111100000000000011111110000000000000000000000000
0000000000001111111111111111111100000000000011111111111100000000000011111110000000000000000000000000
0000000000001111111111111111111111111111111111111111111111111111111111111110000000000000000000000000
0000000000001111111111111111111111111111111111111111111111111111111111111110000000000000000000000000
0000000000001111111111111111111111111111111111111111111111111111111111111110000000000000000000000000
0000000000001111111111111111111111111111111111111111111111111111111111111110000000000000000000000000
0000000000001111111111111111111111111111111111111111111111111111111111111110000000000000000000000000
0000000000001111111111111111111111111111111111111111111111111111111111111110000000000000000000000000
0000000000001111111111111111111111111111111111111111111111111111111111111110000000000000000000000000
1111111111111111111111111000000000000111111111111111111111111111111111111111000000000001111111111111
1111111111101111111111110000000000000111111111111111111111111111111111111111100000000001111111111111
1111111111001111111111100000000000000111111111111111111111111111111111111111110000000001111111111111
1111111110001111111111000000000000000111111111111111111111111111111111111111111000000001111111111111
1111111100001111111110000000000000000111111111111111111111111111111111111111111100000001111111111111
1111111000001111111100000000000000000111111111111111111111111111111111111111111110000001111111111111
1111110000001111111000000000000000000111111111111111111111111111111111111111111111000001111111111111
1111100000001111110000000000000000000111111111111111111111111111111111111111111111100001111111111111
1111000000001111100000000000000000000111111111111111111111111111111111111111111111110001111111111111
1110000000001111000000000000000000000111111111111111111111111111111111111111111111111001111111111111
1100000000001110000000000000000000000111111111111111111111111111111111111111111111111101111111111111
1000000000001100000000000000000000000111111111111111111111111111111111111111111111111111111111111111
1111111111111111111111111000000000000111111111111111111111111111111111111111111111111111111111111111
1111111111111111111111111000000000000111111111111100000000000000000000000001000000000001100000000000
1111111111101111111111111000000000000111111111111100000000000000000000000001100000000001110000000000
1111111111001111111111111000000000000111111111111100000000000000000000000001110000000001111000000000
1111111110001111111111111000000000000111111111111100000000000000000000000001111000000001111100000000
1111111100001111111111111000000000000111111111111100000000000000000000000001111100000001111110000000
1111111000001111111111111000000000000111111111111100000000000000000000000001111110000001111111000000
1111110000001111111111111000000000000111111111111100000000000000000000000001111111000001111111100000
1111100000001111111111111000000000000111111111111100000000000000000000000001111111100001111111110000
1111000000001111111111111000000000000111111111111100000000000000000000000001111111110001111111111000
1110000000001111111111111000000000000111111111111100000000000000000000000001111111111001111111111100
1100000000001111111111111000000000000111111111111100000000000000000000000001111111111101111111111110
1000000000001111111111111000000000000111111111111100000000000000000000000001111111111111111111111111

1

Bubblegum,535个字节,0个错误

在此处输入图片说明

0000000: bd96 410a 4431 0843 f739 4d73 ffcb cdf2  ..A.D1.C.9Ms....
0000010: 93a1 0f2a 04b3 ab22 b1ad 1acf 07fb c489  ...*..."........
0000020: 70ee 7006 9f0f 0207 b31c 60b1 33d4 3792  p.p.......`.3.7.
0000030: b033 4b24 03b9 dbc9 2220 2796 6b36 9f31  .3K$...." '.k6.1
0000040: c3fe 49d2 8a2c 904e d8fc 2149 d288 2c90  ..I..,.N..!I..,.
0000050: 4f98 9c01 1f49 da90 0512 0a8b 131f 0914  O....I..........
0000060: 275c 3e8e 61a0 0756 384e 00be 9148 8da5  '\>.a..V8N...H..
0000070: a25b ae09 4adc cea3 b1e8 75e2 cc2c f080  .[..J.....u..,..
0000080: 71a2 f655 1e91 056a 210e 0822 4938 0e63  q..U...j!.."I8.c
0000090: 346f 7208 d53f 2174 ab0b 50ed 1342 b5e3  4or..?!t..P..B..
00000a0: 01dd d905 e84e 6142 554f 0855 6524 5435  .....NaBUO.Ue$T5
00000b0: 1ed0 dd56 086a ee5d 04b9 0666 d7a1 801a  ...V.j.]...f....
00000c0: 8b2d fedf 128b 6d71 a54e c1ed 2cee b939  .-....mq.N..,..9
00000d0: a8d5 c4d3 630c 9c37 e239 3806 4e4e e144  ....c..7.98.NN.D
00000e0: e752 6307 6880 509b b80c d801 696a aeb2  .Rc.h.P.....ij..
00000f0: 7387 705c 635e e4e0 2b8a 0629 ab2c 39f8  s.p\c^..+..).,9.
0000100: b384 230e 6b85 1c8c ed9b f4ff 64b1 ba16  ..#.k.......d...
0000110: fa64 a1e3 7766 d7f2 145e d093 0565 5cd0  .d..wf...^...e\.
0000120: f89d 6d65 67ef 424f 11b2 6b1c 87ec c2df  ..meg.BO..k.....
0000130: 9a03 6b48 5877 7360 3708 3b68 0eec 6be1  ..kHXws`7.;h..k.
0000140: 2c98 0327 94e6 628a c059 abb1 98b2 0355  ,..'..b..Y.....U
0000150: 4363 3165 07ea 9f8a 2a8b 4aae b198 b203  Cc1e....*.J.....
0000160: 7712 8dc5 941d b85d 692c a6ec c03d 71fd  w......]i,...=q.
0000170: 26fd 3f59 acae 853e 59e8 f89d d9b5 3c85  &.?Y...>Y.....<.
0000180: 17f4 6441 1917 347e 655b d9d9 bb0e 61cc  ..dA..4~e[....a.
0000190: 1e01 7162 129b cccc 11a9 bc91 98ac cc11  ..qb............
00001a0: f77d 2331 199d a056 7b23 c150 e4c8 9f7b  .}#1...V{#.P...{
00001b0: 2331 999c 8068 bf91 982c c891 ee37 1293  #1...h...,...7..
00001c0: 0139 d2fb 4662 38a7 01a3 fd40 3250 5988  .9..Fb8....@2PY.
00001d0: f61b 89e9 7198 2315 9349 5865 b161 21da  ....q.#..IXe.a!.
00001e0: f218 3ce0 e624 cd9b d0b8 2bff 896f a857  ..<..$....+..o.W
00001f0: d795 a3de 2737 8e7e c73b 519f 5d10 d29e  ....'7.~.;Q.]...
0000200: c270 f9b2 9ef0 bfb6 9531 2f58 d678 20ef  .p.......1/X.x .
0000210: 6e2b e0e8 ee5d 3f                        n+...]?

使用zopfli(--deflate --i10000)压缩。在线尝试。

非常坦率的; 我稍后可能会尝试添加一些错误。


0

ForceLang,2749 2499 2495字节

非竞争性语言会推迟发布该问题。

def S set
S W io.writeln
S R string.rev
S a ""+0x6D79F82328EA3DA61E0701C9182D91DDE8B1C71C7
S b ""+0x786C90F379CE770387732B1CDC3135DC3CE1C71C6
S c ""+0x7984D36EB5187CC012312A961B9A27CB5BF9C71BC
S d ""+0x79A0DA14A16CB0862210C8BE24D40F55C1D5C7158
S e ""+0x79A3A78B9F751C1A0472203FA900BFF60DEBC6D70
S f ""+0x79A3EF4AB8DC5A0FFC9CDC4D56BD69F1DBBAC4660
S g ""+0x79A3F6776E99E049FE5189BC60823AF3FB1C2BFC0
S h ""+0x79A3F72F1A60079DE42E0BC3623C9CC0D0A4F7D80
S i ""+0x79A3F741785A41CCDA794C67E9EBDAB9EAC2CE700
S j ""+0x79A3F7434E8CFFB9AC2E70DEA901D141036760600
S k ""+0x79A3F7437D9343C8FBEF208311B066CF95614BC00
S l ""+0x79A3F7438253021069541D3C0D7DBD353F18E9800
S m ""+0x79A3F74382CB60F176B1C1A99D8D000C45AA51000
W a+a
W b+b
W c+c
W d+d
W e+e
W f+f
W g+g
W h+h
W i+i
W j+j
W k+k
W l+l
W m+m
W l+l
W k+k
W j+j
W i+i
W h+h
W g+g
W f+f
W e+e
W d+d
W c+c
W b+b
W a+a
W S n ""+0x2082FAED7A3F16F730463D6FB0529164157A6772E72577EC590ADCDD251957F2BC21BCECCEDA1000001
W S o "0"+0x3404C4AF29FE8B251A078D51F3422C44257DE9CCEE48C93AB6DDD70037D6F058EF1E96AE389780000B
W S p "00"+0x533AD44B766411D4F4ED5F3E08CDC08896ADBCDC1213E71D9792DAFE2655B4B0D387777F349C0006F
W S q "000"+0x852AED458A39B62094B066CF194EDEE006289DFD2093DCC403A9A369F588AB436E4125B928600457
W S r "0000"+0xD5117BA276C2BC68EEC80E4BF8D5C1A068B3ABB7496F715789D4298974E6B48DA0883E68B702B67
W S s "00000"+0x154E8C5D0BE0401A871156A755E768D3BEF3334F8FA7C61A4F116CE6907EB4964CFA6EB1559B207
W S t "000000"+0x221746FB462FE3C989A43900F01111A46D39389143FAB11D7C222D858D8B7420DC570C3CCCF447
W S u "0000000"+0x368BA4C53AC7AFE49E5162CA0DA3D0B1C8CDBE64A8195738CB712D2038B74223F9C849AEF8AC7
W S v "00000000"+0x5745D46D515CD860B238C63288EE96F8425A28BBF8CE27A5F060FE9F8B742263237710A66BC7
W S w "000000000"+0x8BA2EC93C7B8B205605DCC1242ACE73FE320C62A60CEC941E4474B78B742266B0F5F107B5C7
W S x "0000000000"+0xDF6A832B1C8B32B27AA702FBBFD960651EAB9E37CE30AD4E093DA78B7422670BEB558DD9C7
W S y "00000000000"+0x1651C9F6F18C5FB47C580D61E4F69EB8CFDD04644901F0B5CFB5078B742267151AEC7761C7
W S z "000000000000"+0x202C1796B182D85E5704E2B93930E38C74A50C6F9CC338492A1C78B7422671603C11C71C7
W y
W x
W w
W v
W u
W t
W s
W r
W q
W p
W o
W n
W R n
W R o
W R p
W R q
W R r
W R s
W R t
W R u
W R v
W R w
W R x
W R y
W R z
W R y
W R x
W R w
W R v
W R u
W R t
W R s
W R r
W R q
W R p
W R o
W R n
W S a R a+a
W S b R b+b
W S c R c+c
W S d R d+d
W S e R e+e
W S f R f+f
W S g R g+g
W S h R h+h
W S i R i+i
W S j R j+j
W S k R k+k
W S l R l+l
W R m+m
W l
W k
W j
W i
W h
W g
W f
W e
W d
W c
W b
W a
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.