quine golf: store 5 chars per uint by treating them as base 80 digits, 69x69 grid! total 4751 bytes
This commit is contained in:
parent
9e20abb767
commit
725db5735b
3 changed files with 31 additions and 26 deletions
|
@ -5,19 +5,19 @@ Shader"S"{SubShader{Pass{CGPROGRAM#pragma vertex a
|
||||||
struct A{float4 v:POSITION;float2 u:TEXCOORD0;UNITY_VERTEX_INPUT_INSTANCE_ID};struct V{float2 u:TEXCOORD0;float4 v:SV_POSITION;UNITY_VERTEX_OUTPUT_STEREO};
|
struct A{float4 v:POSITION;float2 u:TEXCOORD0;UNITY_VERTEX_INPUT_INSTANCE_ID};struct V{float2 u:TEXCOORD0;float4 v:SV_POSITION;UNITY_VERTEX_OUTPUT_STEREO};
|
||||||
V a(A v){V o;UNITY_SETUP_INSTANCE_ID(v);UNITY_INITIALIZE_OUTPUT(V,o);UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);o.v=UnityObjectToClipPos(v.v);o.u=v.u;return o;}
|
V a(A v){V o;UNITY_SETUP_INSTANCE_ID(v);UNITY_INITIALIZE_OUTPUT(V,o);UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);o.v=UnityObjectToClipPos(v.v);o.u=v.u;return o;}
|
||||||
float3 f(V U):SV_Target{
|
float3 f(V U):SV_Target{
|
||||||
w t[]={0x13140b0e,0x0f151613,0x16171318,0x0c13140b,0x0e0f1517,0x190b1a1a,0x171b1c19,0x1d1e1c1d,0x1f202122,0x150b2324,0x0b00250f,0x15260f11,0x000b2721,0x22150b23,0x240b0010,0x150b2324,0x0f282600,0x10272129,0x280d2a18,0x0e0f162b,0x2829262c,0x1b1c2d0d,0x2329280d,0x1627210e,0x0f102928,0x0f002e00,0x0d2f281a,0x26001829,0x2826271a,0x2615180d,0x26001f17,0x102a2f0b,0x26050025,0x30191e13,0x3132311e,0x3334102a,0x2f0b2603,0x00183032,0x35361b1e,0x1e1d3701,0x342b3331,0x3238393a,0x351d3235,0x36393133,0x192b3239,0x31331332,0x1f331b35,0x3931373b,0x341a2615,0x180d2600,0x3a17102a,0x2f0b2603,0x00183032,0x35361b1e,0x1e1d3701,0x34102a2f,0x0b260500,0x2530133a,0x39191e13,0x3132311e,0x33342b33,0x31323839,0x3a351d32,0x3536391e,0x2b32192b,0x32391332,0x351d351e,0x3b34273a,0x000b3c1f,0x00253d17,0x3a002f34,0x2b333132,0x38391335,0x322b1939,0x31331332,0x1f331b35,0x3931373c,0x253d342b,0x33313238,0x39313331,0x32311f3e,0x313f3539,0x1e2b3219,0x2b323c3a,0x122f3d34,0x2b333132,0x38393133,0x3132311f,0x3e313f35,0x393a351d,0x32353639,0x1e2b3219,0x2b323913,0x32351d35,0x1e3c2f3d,0x342f2d25,0x402b2829,0x262c1e0c,0x410f0d26,0x322f1b2a,0x2922192f,0x1a3c252d,0x253d342f,0x2d184025,0x2d183415,0x0f261815,0x28002f34,0x3b27102a,0x2f0b2604,0x00103c3a,0x002b3d30,0x133a3932,0x0b15230f,0x2617272e,0x00264243,0x40173b34,0x272e003e,0x40050108,0x01342e00,0x0c400507,0x0334272e,0x00444243,0x40170112,0x050a0104,0x0a0a0207,0x09120205,0x01070505,0x09010112,0x03050405,0x07080805,0x05120305,0x04050805,0x07060712,0x0402020a,0x03080105,0x01120601,0x05070103,0x09050912,0x03010307,0x02040a06,0x03120602,0x02090409,0x03080312,0x03050506,0x03050303,0x05120302,0x02030401,0x0a020312,0x03020102,0x09040702,0x07120405,0x09050209,0x03051207,0x04030605,0x05011203,0x0808030a,0x03050901,0x12030202,0x03060708,0x07091205,0x03020806,0x0a010501,0x120a0705,0x01030305,0x12020405,0x12050802,0x01020607,0x05091204,0x05090502,0x09090912,0x020a0908,0x03011204,0x05070104,0x01010901,0x12020407,0x05020604,0x0701120a,0x08050208,0x07011203,0x05050605,0x09070501,0x12070404,0x01070401,0x12050908,0x07040905,0x07051205,0x08020305,0x07030803,0x12030505,0x06060801,0x09091205,0x09090207,0x03080603,0x12030202,0x01080504,0x04071206,0x0a0a0505,0x030a0807,0x12040709,0x05010a0a,0x03011204,0x04020307,0x08041202,0x030a0304,0x02080512,0x04090307,0x03051206,0x07080503,0x05120805,0x06020707,0x01091203,0x0808010a,0x070a0401,0x12030409,0x09090112,0x02040505,0x02090909,0x01120301,0x06070607,0x06020312,0x04020208,0x0402040a,0x03120607,0x08050307,0x12020309,0x12060809,0x09090112,0x07060a06,0x08080712,0x05020a05,0x05040312,0x05080501,0x0a020a07,0x09120201,0x05050602,0x070a0a03,0x12060a02,0x01070306,0x07011205,0x020a0505,0x04091206,0x0105060a,0x060a0407,0x12060902,0x0106030a,0x07011202,0x01070302,0x01060309,0x12060909,0x06090401,0x05011205,0x09011206,0x09090902,0x09060701,0x12080208,0x01010605,0x05120501,0x05090209,0x04010512,0x03010a0a,0x09060803,0x09120405,0x07040803,0x09011202,0x01050908,0x02010202,0x03120205,0x070a0505,0x01011203,0x07090801,0x07020305,0x12030104,0x050a0206,0x03011203,0x01060706,0x07030607,0x12060105,0x060a0605,0x09091202,0x01070308,0x01080312,0x05070608,0x02060312,0x050a0206,0x03011208,0x0206070a,0x05080312,0x08030a06,0x06020a01,0x12020407,0x04050a09,0x0305120a,0x06080106,0x0a031206,0x0506040a,0x03070803,0x123b3427,0x102a2f0b,0x26001112,0x2c402b2d,0x182d2c45,0x08063411,0x402b2d18,0x2d114508,0x06342718,0x29282600,0x0d122912,0x0e123812,0x36401134,0x38402c34,0x29403646,0x3c080547,0x383d4508,0x06342729,0x103c2948,0x400c4949,0x294a0c46,0x3e3d1727,0x0e403c29,0x470c3d4b,0x02023427,0x29103c0e,0x4a033d0d,0x403c0e4a,0x4a053d46,0x0234270f,0x2a1a0f00,0x29103c0e,0x40400201,0x3d0d4002,0x0934270f,0x2a1a0f00,0x0d403c26,0x423c2947,0x0c3d4c02,0x02434848,0x3c3c0847,0x3c3c0e47,0x033d4908,0x3d3d4505,0x3d490206,0x3d460234,0x273b0f2a,0x1a0f1727,0x29103c29,0x480c3d29,0x47403e34,0x270d4026,0x42294c05,0x4348483c,0x3c04473c,0x2949043d,0x3d45093d,0x49030606,0x343b2738,0x403c2c47,0x383d4507,0x3436403c,0x1147363d,0x45073427,0x150f2618,0x15280044,0x420d4348,0x483c3646,0x3845063d,0x4902453c,0x364a063d,0x34273b35,0x33371b1c,0x3b3b3b00,};
|
w t[]={0x2f00576f,0x33f2c1f7,0x2f1fb204,0x1b49dda7,0x3d618237,0x42c83a2e,0x4541a121,0x53a72e14,0x1adea1c5,0x5d3cd90b,0x603c289b,0x568d5310,0x339e664f,0x62d0e527,0x51d53c3a,0x3b06de0b,0x62ec13db,0x45bce019,0x620fc251,0x22a4ccf8,0x24a37e0d,0x73fa15e0,0x3bdc4407,0x40a4f48d,0x5cc90e40,0x67fa4ee5,0x0125c7ee,0x2fe6c16e,0x7e1add4f,0x1c042b18,0x76bbddfb,0x4a2b4631,0x8048fa82,0x8a7b0aad,0x7bb56801,0x7d4a92d9,0x79315abf,0x7d5b2f01,0x88190c46,0x3401d0e0,0x8e4f4d4f,0x1c042b18,0x76bbddfb,0x4a2b4631,0x7f7528bb,0x5ced1bc0,0x302db8ee,0x2fe6c16e,0x7e1d8321,0x7bcd2355,0x4858de19,0x4a92d9fb,0x7bd13ad5,0x486e10a4,0x60fc23ac,0x4bb2b027,0x8d9ea76b,0x7e06c3b9,0x3005ff89,0x8cacd122,0x4d4023c9,0x795497cd,0x8048fa82,0x8a7a2921,0x7b93ea91,0x9b72aa8b,0x7ad992dc,0x8e2b4a44,0x6a8e48d8,0x8cacda82,0x78994d8f,0x83280aad,0x7bb567ee,0x6a841ea2,0x8bc262ad,0x82554aed,0x8067a0d0,0x6a378d0c,0x49a21dbd,0x5e513f9a,0x65251fca,0x93a180cd,0x80679cc0,0x5bb6f855,0x25ca3eb8,0x01745697,0x285cba96,0x09c5a2fa,0x0155f413,0x8f5c3585,0x55ebed57,0x7051cae3,0x9cf98367,0x704f4005,0x1133905e,0x0219c730,0x3830939a,0x02913d22,0x115f12a5,0x02a82e99,0x027a92f5,0x09ebc188,0x0c5dd2f5,0x09ebd997,0x0ede7342,0x05306d81,0x0c3e93e1,0x0c6bc9f9,0x0c7d12f1,0x0789e34a,0x0ebf33e2,0x0528b6d3,0x13a132f5,0x0c642c93,0x077bd2f2,0x04f9d45a,0x04fb32f2,0x02818247,0x051a7345,0x162044d3,0x0cc25043,0x0ecd8d62,0x079248fa,0x077af162,0x0762d2f6,0x115631e2,0x0c4ca486,0x18724d62,0x18a12d53,0x077bd2a4,0x0cc21f82,0x02813835,0x16860599,0x0c4583d9,0x2c029cd8,0x075c9345,0x111f3451,0x160292a4,0x113e43e4,0x11209528,0x0c456a31,0x2c09ee96,0x0c7c0091,0x2c291541,0x11365ea5,0x16383049,0x0c6c32a5,0x1397ec97,0x0791d0a3,0x0c5ca7e8,0x02b836a5,0x163f8433,0x13b730a3,0x04f1bb85,0x09e3f4a6,0x18b89e93,0x18a934a4,0x115dcd5a,0x18818ea4,0x09d3ed38,0x0a50d2fa,0x07727485,0x2c1221f7,0x077bd3e7,0x13af5ca2,0x13afa6a7,0x111fb6a3,0x13c69c27,0x18895ea3,0x0a0b33d1,0x2c020595,0x052933d1,0x2c098ae7,0x0edd46a3,0x2c1172a8,0x09d40723,0x2c219185,0x078b72a3,0x16863889,0x163f6ea7,0x0ef4b888,0x11a41daa,0x0c5c7502,0x0c73fd5a,0x0530d1e2,0x04ea4e96,0x0519ad23,0x2c21daa1,0x112f0831,0x2c194525,0x0c5526a6,0x0298a926,0x1889f4a6,0x1608bae3,0x18a0cea2,0x02a7fba1,0x0ebe56a6,0x163fe8d4,0x02982ea5,0x160293e9,0x163f84d6,0x11209482,0x138feae5,0x0cc21d55,0x16098241,0x0cc1eb5a,0x18b0e883,0x16860597,0x0a02cdd1,0x2c01ba99,0x1397b9a2,0x07dfd397,0x18918d51,0x2c0a21d8,0x02a7e2f5,0x2c098a45,0x187a36f1,0x2c098ae7,0x0edcfce7,0x2c20fa96,0x18995fd9,0x2c01bb33,0x13909902,0x0c6c4882,0x0ebf339a,0x05112b62,0x1398383a,0x0c73d0a8,0x07a1b7e2,0x187392a4,0x1136c029,0x077bd526,0x13906923,0x2c215ee4,0x18822183,0x2dc41040,0x67fa4ee0,0x2a12002b,0x6e9cf305,0x116a3990,0x6a5cf621,0xa8acba67,0x3bdc43e0,0x204da6ae,0x2da95320,0x2b1ccc2c,0x803aa126,0x92b3a768,0x9708c254,0x6078f2e9,0xb1bd4319,0x665b8683,0x1a48db3e,0x9e18d73c,0x973722d4,0x6078f2ce,0xb4c76950,0x92f0b125,0x97102267,0x25e9aeb0,0x649be0a0,0x9c4fcc1d,0x9c509167,0x25e9aeb0,0x21b6e822,0x93c342fd,0xb99be738,0xb1a29ec7,0x94523433,0x97282b4d,0xa8a21bd2,0x108966d4,0x6105743a,0x25568be0,0x93c35bfd,0x6649f143,0x115aa03d,0x9d6f5f1c,0x10b6892f,0x351dd8b0,0x10405825,0x803b3c1d,0x221502d1,0x7f60f709,0x040d0f68,0x9e192268,0x9708cf76,0x9e167f66,0x9708cf67,0x33bded95,0x61aeb8ad,0xa5cc9af6,0xaca23f1d,0xb24f6ff6,0xb4dee567,0x91ae1c4b,0x462ec570,};
|
||||||
w L=4070;w b=462;
|
w b=462;
|
||||||
w F[]={0,490399168,140644800,243467744,243474656,311927040,504602848,202613952,511838272,244524224,211230912,210183616,34841824,6325440,277292480,211256768,421759040,9640224,134,471015648,34841888,198720,346030080,136415360,9741760,244548640,6330630,487638464,471246272,244557088,488162752,211074336,599442976,368409920,3312673,12923174,382624,567424,74516608,277096930,238880,134418880,205656512,311731392,567426,128,578880,6595776,4194432,474091968,1044516992,591062560,4194438,504595936,581052960,106210528,588583040,480,588818560,71700544,404818304,209985728,34637280,1048710112,14694400,268706124,203491520,205656256,504595488,10627072,4657152,491520,71569472,72955190,136349824,9570592,545392672,};
|
w F[]={0,490399168,140644800,243467744,243474656,311927040,504602848,202613952,511838272,244524224,211230912,210183616,34841824,6325440,277292480,211256768,421759040,9640224,134,471015648,34841888,198720,346030080,136415360,9741760,244548640,6330630,487638464,471246272,244557088,488162752,211074336,599442976,368409920,3312673,12923174,382624,567424,74516608,277096930,238880,134418880,205656512,311731392,567426,128,578880,6595776,4194432,474091968,1044516992,591062560,4194438,504595936,581052960,106210528,588583040,480,588818560,71700544,404818304,209985728,34637280,1048710112,14694400,268706124,203491520,205656256,504595488,10627072,4657152,491520,71569472,72955190,136349824,9570592,545392672,};
|
||||||
float x,y=U.u.y*75;x=U.u.x*75;
|
float x,y=U.u.y*69;x=U.u.x*69;
|
||||||
uint c,i,d,Y,X=x;Y=y;i=X+(74-Y)*75;
|
uint c,i,d,Y,X=x;Y=y;i=X+(68-Y)*69;
|
||||||
if(i>=b&&i<b+L){
|
if(i>=b&&i<3729){
|
||||||
d=(i-b)%11;
|
d=(i-b)%11;
|
||||||
if(d<2)c=(d<<4)+1;
|
if(d<2)c=(d<<4)+1;
|
||||||
else if(d==10)c=18;
|
else if(d==10)c=18;
|
||||||
else c=(t[(i-b)/11]>>((7-((d-2)&7))*4)&15)+1;
|
else c=(t[(i-b)/11]>>((7-((d-2)&7))*4)&15)+1;
|
||||||
}else{
|
}else{
|
||||||
if(i>b)i-=L;
|
if(i>b)i-=3267;
|
||||||
c=t[i/4]>>((3-(i&3))*8)&255;}
|
c=t[i/5];for(i%=5;i<4;i++)c/=80;c%=80;}
|
||||||
Y=(y-Y)*6;X=(x-X)*6;
|
Y=(y-Y)*6;X=(x-X)*6;
|
||||||
return F[c]>>(X+Y*5)&1*(X<5);
|
return F[c]>>(X+Y*5)&1*(X<5);
|
||||||
}ENDCG}}}
|
}ENDCG}}}
|
|
@ -1,3 +1,5 @@
|
||||||
w t[]={0x13140b0e,0x0f151613,0x16171318,0x0c13140b,0x0e0f1517,0x190b1a1a,0x171b1c19,0x1d1e1c1d,0x1f202122,0x150b2324,0x0b00250f,0x15260f11,0x000b2721,0x22150b23,0x240b0010,0x150b2324,0x0f282600,0x10272129,0x280d2a18,0x0e0f162b,0x2829262c,0x1b1c2d0d,0x2329280d,0x1627210e,0x0f102928,0x0f002e00,0x0d2f281a,0x26001829,0x2826271a,0x2615180d,0x26001f17,0x102a2f0b,0x26050025,0x30191e13,0x3132311e,0x3334102a,0x2f0b2603,0x00183032,0x35361b1e,0x1e1d3701,0x342b3331,0x3238393a,0x351d3235,0x36393133,0x192b3239,0x31331332,0x1f331b35,0x3931373b,0x341a2615,0x180d2600,0x3a17102a,0x2f0b2603,0x00183032,0x35361b1e,0x1e1d3701,0x34102a2f,0x0b260500,0x2530133a,0x39191e13,0x3132311e,0x33342b33,0x31323839,0x3a351d32,0x3536391e,0x2b32192b,0x32391332,0x351d351e,0x3b34273a,0x000b3c1f,0x00253d17,0x3a002f34,0x2b333132,0x38391335,0x322b1939,0x31331332,0x1f331b35,0x3931373c,0x253d342b,0x33313238,0x39313331,0x32311f3e,0x313f3539,0x1e2b3219,0x2b323c3a,0x122f3d34,0x2b333132,0x38393133,0x3132311f,0x3e313f35,0x393a351d,0x32353639,0x1e2b3219,0x2b323913,0x32351d35,0x1e3c2f3d,0x342f2d25,0x402b2829,0x262c1e0c,0x410f0d26,0x322f1b2a,0x2922192f,0x1a3c252d,0x253d342f,0x2d184025,0x2d183415,0x0f261815,0x28002f34,0x3b27102a,0x2f0b2604,0x00103c3a,0x002b3d30,0x133a3932,0x0b15230f,0x2617272e,0x00264243,0x40173b34,0x272e003e,0x40050108,0x01342e00,0x0c400507,0x0334272e,0x00444243,0x40170112,0x050a0104,0x0a0a0207,0x09120205,0x01070505,0x09010112,0x03050405,0x07080805,0x05120305,0x04050805,0x07060712,0x0402020a,0x03080105,0x01120601,0x05070103,0x09050912,0x03010307,0x02040a06,0x03120602,0x02090409,0x03080312,0x03050506,0x03050303,0x05120302,0x02030401,0x0a020312,0x03020102,0x09040702,0x07120405,0x09050209,0x03051207,0x04030605,0x05011203,0x0808030a,0x03050901,0x12030202,0x03060708,0x07091205,0x03020806,0x0a010501,0x120a0705,0x01030305,0x12020405,0x12050802,0x01020607,0x05091204,0x05090502,0x09090912,0x020a0908,0x03011204,0x05070104,0x01010901,0x12020407,0x05020604,0x0701120a,0x08050208,0x07011203,0x05050605,0x09070501,0x12070404,0x01070401,0x12050908,0x07040905,0x07051205,0x08020305,0x07030803,0x12030505,0x06060801,0x09091205,0x09090207,0x03080603,0x12030202,0x01080504,0x04071206,0x0a0a0505,0x030a0807,0x12040709,0x05010a0a,0x03011204,0x04020307,0x08041202,0x030a0304,0x02080512,0x04090307,0x03051206,0x07080503,0x05120805,0x06020707,0x01091203,0x0808010a,0x070a0401,0x12030409,0x09090112,0x02040505,0x02090909,0x01120301,0x06070607,0x06020312,0x04020208,0x0402040a,0x03120607,0x08050307,0x12020309,0x12060809,0x09090112,0x07060a06,0x08080712,0x05020a05,0x05040312,0x05080501,0x0a020a07,0x09120201,0x05050602,0x070a0a03,0x12060a02,0x01070306,0x07011205,0x020a0505,0x04091206,0x0105060a,0x060a0407,0x12060902,0x0106030a,0x07011202,0x01070302,0x01060309,0x12060909,0x06090401,0x05011205,0x09011206,0x09090902,0x09060701,0x12080208,0x01010605,0x05120501,0x05090209,0x04010512,0x03010a0a,0x09060803,0x09120405,0x07040803,0x09011202,0x01050908,0x02010202,0x03120205,0x070a0505,0x01011203,0x07090801,0x07020305,0x12030104,0x050a0206,0x03011203,0x01060706,0x07030607,0x12060105,0x060a0605,0x09091202,0x01070308,0x01080312,0x05070608,0x02060312,0x050a0206,0x03011208,0x0206070a,0x05080312,0x08030a06,0x06020a01,0x12020407,0x04050a09,0x0305120a,0x06080106,0x0a031206,0x0506040a,0x03070803,0x123b3427,0x102a2f0b,0x26001112,0x2c402b2d,0x182d2c45,0x08063411,0x402b2d18,0x2d114508,0x06342718,0x29282600,0x0d122912,0x0e123812,0x36401134,0x38402c34,0x29403646,0x3c080547,0x383d4508,0x06342729,0x103c2948,0x400c4949,0x294a0c46,0x3e3d1727,0x0e403c29,0x470c3d4b,0x02023427,0x29103c0e,0x4a033d0d,0x403c0e4a,0x4a053d46,0x0234270f,0x2a1a0f00,0x29103c0e,0x40400201,0x3d0d4002,0x0934270f,0x2a1a0f00,0x0d403c26,0x423c2947,0x0c3d4c02,0x02434848,0x3c3c0847,0x3c3c0e47,0x033d4908,0x3d3d4505,0x3d490206,0x3d460234,0x273b0f2a,0x1a0f1727,0x29103c29,0x480c3d29,0x47403e34,0x270d4026,0x42294c05,0x4348483c,0x3c04473c,0x2949043d,0x3d45093d,0x49030606,0x343b2738,0x403c2c47,0x383d4507,0x3436403c,0x1147363d,0x45073427,0x150f2618,0x15280044,0x420d4348,0x483c3646,0x3845063d,0x4902453c,0x364a063d,0x34273b35,0x33371b1c,0x3b3b3b00,};
|
w t[]={0x2f00576f,0x33f2c1f7,0x2f1fb204,0x1b49dda7,0x3d618237,0x42c83a2e,0x4541a121,0x53a72e14,0x1adea1c5,0x5d3cd90b,0x603c289b,0x568d5310,0x339e664f,0x62d0e527,0x51d53c3a,0x3b06de0b,0x62ec13db,0x45bce019,0x620fc251,0x22a4ccf8,0x24a37e0d,0x73fa15e0,0x3bdc4407,0x40a4f48d,0x5cc90e40,0x67fa4ee5,0x0125c7ee,0x2fe6c16e,0x7e1add4f,0x1c042b18,0x76bbddfb,0x4a2b4631,0x8048fa82,0x8a7b0aad,0x7bb56801,0x7d4a92d9,0x79315abf,0x7d5b2f01,0x88190c46,0x3401d0e0,0x8e4f4d4f,0x1c042b18,0x76bbddfb,0x4a2b4631,0x7f7528bb,0x5ced1bc0,0x302db8ee,0x2fe6c16e,0x7e1d8321,0x7bcd2355,0x4858de19,0x4a92d9fb,0x7bd13ad5,0x486e10a4,0x60fc23ac,0x4bb2b027,0x8d9ea76b,0x7e06c3b9,0x3005ff89,0x8cacd122,0x4d4023c9,0x795497cd,0x8048fa82,0x8a7a2921,0x7b93ea91,0x9b72aa8b,0x7ad992dc,0x8e2b4a44,0x6a8e48d8,0x8cacda82,0x78994d8f,0x83280aad,0x7bb567ee,0x6a841ea2,0x8bc262ad,0x82554aed,0x8067a0d0,0x6a378d0c,0x49a21dbd,0x5e513f9a,0x65251fca,0x93a180cd,0x80679cc0,0x5bb6f855,0x25ca3eb8,0x01745697,0x285cba96,0x09c5a2fa,0x0155f413,0x8f5c3585,0x55ebed57,0x7051cae3,0x9cf98367,0x704f4005,0x1133905e,0x0219c730,0x3830939a,0x02913d22,0x115f12a5,0x02a82e99,0x027a92f5,0x09ebc188,0x0c5dd2f5,0x09ebd997,0x0ede7342,0x05306d81,0x0c3e93e1,0x0c6bc9f9,0x0c7d12f1,0x0789e34a,0x0ebf33e2,0x0528b6d3,0x13a132f5,0x0c642c93,0x077bd2f2,0x04f9d45a,0x04fb32f2,0x02818247,0x051a7345,0x162044d3,0x0cc25043,0x0ecd8d62,0x079248fa,0x077af162,0x0762d2f6,0x115631e2,0x0c4ca486,0x18724d62,0x18a12d53,0x077bd2a4,0x0cc21f82,0x02813835,0x16860599,0x0c4583d9,0x2c029cd8,0x075c9345,0x111f3451,0x160292a4,0x113e43e4,0x11209528,0x0c456a31,0x2c09ee96,0x0c7c0091,0x2c291541,0x11365ea5,0x16383049,0x0c6c32a5,0x1397ec97,0x0791d0a3,0x0c5ca7e8,0x02b836a5,0x163f8433,0x13b730a3,0x04f1bb85,0x09e3f4a6,0x18b89e93,0x18a934a4,0x115dcd5a,0x18818ea4,0x09d3ed38,0x0a50d2fa,0x07727485,0x2c1221f7,0x077bd3e7,0x13af5ca2,0x13afa6a7,0x111fb6a3,0x13c69c27,0x18895ea3,0x0a0b33d1,0x2c020595,0x052933d1,0x2c098ae7,0x0edd46a3,0x2c1172a8,0x09d40723,0x2c219185,0x078b72a3,0x16863889,0x163f6ea7,0x0ef4b888,0x11a41daa,0x0c5c7502,0x0c73fd5a,0x0530d1e2,0x04ea4e96,0x0519ad23,0x2c21daa1,0x112f0831,0x2c194525,0x0c5526a6,0x0298a926,0x1889f4a6,0x1608bae3,0x18a0cea2,0x02a7fba1,0x0ebe56a6,0x163fe8d4,0x02982ea5,0x160293e9,0x163f84d6,0x11209482,0x138feae5,0x0cc21d55,0x16098241,0x0cc1eb5a,0x18b0e883,0x16860597,0x0a02cdd1,0x2c01ba99,0x1397b9a2,0x07dfd397,0x18918d51,0x2c0a21d8,0x02a7e2f5,0x2c098a45,0x187a36f1,0x2c098ae7,0x0edcfce7,0x2c20fa96,0x18995fd9,0x2c01bb33,0x13909902,0x0c6c4882,0x0ebf339a,0x05112b62,0x1398383a,0x0c73d0a8,0x07a1b7e2,0x187392a4,0x1136c029,0x077bd526,0x13906923,0x2c215ee4,0x18822183,0x2dc41040,0x67fa4ee0,0x2a12002b,0x6e9cf305,0x116a3990,0x6a5cf621,0xa8acba67,0x3bdc43e0,0x204da6ae,0x2da95320,0x2b1ccc2c,0x803aa126,0x92b3a768,0x9708c254,0x6078f2e9,0xb1bd4319,0x665b8683,0x1a48db3e,0x9e18d73c,0x973722d4,0x6078f2ce,0xb4c76950,0x92f0b125,0x97102267,0x25e9aeb0,0x649be0a0,0x9c4fcc1d,0x9c509167,0x25e9aeb0,0x21b6e822,0x93c342fd,0xb99be738,0xb1a29ec7,0x94523433,0x97282b4d,0xa8a21bd2,0x108966d4,0x6105743a,0x25568be0,0x93c35bfd,0x6649f143,0x115aa03d,0x9d6f5f1c,0x10b6892f,0x351dd8b0,0x10405825,0x803b3c1d,0x221502d1,0x7f60f709,0x040d0f68,0x9e192268,0x9708cf76,0x9e167f66,0x9708cf67,0x33bded95,0x61aeb8ad,0xa5cc9af6,0xaca23f1d,0xb24f6ff6,0xb4dee567,0x91ae1c4b,0x462ec570,};
|
||||||
w L=4070;w b=462;
|
w b=462;
|
||||||
|
uint magic_number_L_plus_b= 3729;
|
||||||
|
uint magic_number_L= 3267;
|
||||||
w F[]={0,490399168,140644800,243467744,243474656,311927040,504602848,202613952,511838272,244524224,211230912,210183616,34841824,6325440,277292480,211256768,421759040,9640224,134,471015648,34841888,198720,346030080,136415360,9741760,244548640,6330630,487638464,471246272,244557088,488162752,211074336,599442976,368409920,3312673,12923174,382624,567424,74516608,277096930,238880,134418880,205656512,311731392,567426,128,578880,6595776,4194432,474091968,1044516992,591062560,4194438,504595936,581052960,106210528,588583040,480,588818560,71700544,404818304,209985728,34637280,1048710112,14694400,268706124,203491520,205656256,504595488,10627072,4657152,491520,71569472,72955190,136349824,9570592,545392672,};
|
w F[]={0,490399168,140644800,243467744,243474656,311927040,504602848,202613952,511838272,244524224,211230912,210183616,34841824,6325440,277292480,211256768,421759040,9640224,134,471015648,34841888,198720,346030080,136415360,9741760,244548640,6330630,487638464,471246272,244557088,488162752,211074336,599442976,368409920,3312673,12923174,382624,567424,74516608,277096930,238880,134418880,205656512,311731392,567426,128,578880,6595776,4194432,474091968,1044516992,591062560,4194438,504595936,581052960,106210528,588583040,480,588818560,71700544,404818304,209985728,34637280,1048710112,14694400,268706124,203491520,205656256,504595488,10627072,4657152,491520,71569472,72955190,136349824,9570592,545392672,};
|
||||||
|
|
|
@ -36,8 +36,8 @@ fn main() {
|
||||||
temp = 0;
|
temp = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if i > 0{
|
if i > 0 {
|
||||||
temp <<= (4-i)*8;
|
temp <<= (4 - i) * 8;
|
||||||
encoded_text.push(temp);
|
encoded_text.push(temp);
|
||||||
}
|
}
|
||||||
let mut out_string = String::new();
|
let mut out_string = String::new();
|
||||||
|
@ -82,7 +82,6 @@ fn main() {
|
||||||
file.write_all(out_string.as_bytes()).unwrap();
|
file.write_all(out_string.as_bytes()).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fn golfed() {
|
fn golfed() {
|
||||||
// source code conversion
|
// source code conversion
|
||||||
let source_text = read_to_string("../Assets/test/quine_golf.shader").unwrap();
|
let source_text = read_to_string("../Assets/test/quine_golf.shader").unwrap();
|
||||||
|
@ -90,13 +89,13 @@ fn golfed() {
|
||||||
let mut temp = 0;
|
let mut temp = 0;
|
||||||
let mut i = 0;
|
let mut i = 0;
|
||||||
let mut blob_start = 0;
|
let mut blob_start = 0;
|
||||||
let mut used_charset:Vec<_> = " 0123456789abcdefx,".chars().collect();
|
let mut used_charset: Vec<_> = " 0123456789abcdefx,".chars().collect();
|
||||||
for (index, char) in source_text.chars().enumerate() {
|
for (index, char) in source_text.chars().enumerate() {
|
||||||
if char == '?' && blob_start==0 {
|
if char == '?' && blob_start == 0 {
|
||||||
blob_start = index;
|
blob_start = index;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
temp <<= 8;
|
temp *= 80;
|
||||||
let char_index = used_charset
|
let char_index = used_charset
|
||||||
.iter()
|
.iter()
|
||||||
.position(|&c| c == char)
|
.position(|&c| c == char)
|
||||||
|
@ -104,16 +103,18 @@ fn golfed() {
|
||||||
used_charset.push(char);
|
used_charset.push(char);
|
||||||
used_charset.len() - 1
|
used_charset.len() - 1
|
||||||
});
|
});
|
||||||
temp |= (char_index as u32) & 0xff;
|
temp += char_index as u32;
|
||||||
i += 1;
|
i += 1;
|
||||||
if i == 4 {
|
if i == 5 {
|
||||||
i = 0;
|
i = 0;
|
||||||
encoded_text.push(temp);
|
encoded_text.push(temp);
|
||||||
temp = 0;
|
temp = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if i > 0{
|
if i > 0 {
|
||||||
temp <<= (4-i)*8;
|
for _ in 0..(5 - i) {
|
||||||
|
temp *= 80;
|
||||||
|
}
|
||||||
encoded_text.push(temp);
|
encoded_text.push(temp);
|
||||||
}
|
}
|
||||||
let mut out_string = String::new();
|
let mut out_string = String::new();
|
||||||
|
@ -122,8 +123,12 @@ fn golfed() {
|
||||||
out_string += &format!("{t:#010x},");
|
out_string += &format!("{t:#010x},");
|
||||||
}
|
}
|
||||||
out_string += "};\n";
|
out_string += "};\n";
|
||||||
out_string += &format!("w L={};", encoded_text.len()*11);
|
|
||||||
out_string += &format!("w b={blob_start};\n");
|
out_string += &format!("w b={blob_start};\n");
|
||||||
|
out_string += &format!(
|
||||||
|
"uint magic_number_L_plus_b= {};\n",
|
||||||
|
encoded_text.len() * 11 + blob_start
|
||||||
|
);
|
||||||
|
out_string += &format!("uint magic_number_L= {};\n", encoded_text.len() * 11);
|
||||||
|
|
||||||
// font
|
// font
|
||||||
let img = ImageReader::open("6x6.png").unwrap().decode().unwrap();
|
let img = ImageReader::open("6x6.png").unwrap().decode().unwrap();
|
||||||
|
@ -131,16 +136,14 @@ fn golfed() {
|
||||||
for c in used_charset {
|
for c in used_charset {
|
||||||
let col = c as u32 & 0b1_1111;
|
let col = c as u32 & 0b1_1111;
|
||||||
let row = (c as u32 >> 5) & 0b111;
|
let row = (c as u32 >> 5) & 0b111;
|
||||||
let mut encoded=0u32;
|
let mut encoded = 0u32;
|
||||||
for y in 0..6 {
|
for y in 0..6 {
|
||||||
for x in 0..5 {
|
for x in 0..5 {
|
||||||
let px = col * 6 + x;
|
let px = col * 6 + x;
|
||||||
let py = row * 6 + 5 - y;
|
let py = row * 6 + 5 - y;
|
||||||
let pixel = (img.get_pixel(px, py).0[0] >40) as u32;
|
let pixel = (img.get_pixel(px, py).0[0] > 40) as u32;
|
||||||
let offset = x + y * 5;
|
let offset = x + y * 5;
|
||||||
// if offset < 32{
|
encoded |= pixel << offset;
|
||||||
encoded |= pixel << offset;
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
out.push(encoded);
|
out.push(encoded);
|
||||||
|
|
Loading…
Reference in a new issue