#PHP, (削除) 1217 (削除ここまで) 1081
PHP, (削除) 1217 (削除ここまで) 1081
The code:
for(;$T!=T;$T=($T+52)%95)echo chr(32+$T);
Because the variables are not initialized, it needs to suppress the notices on running (PHP complains but continues execution and uses a default value that is appropriate in the context; 0 in this case):
$ php -d error_reporting=0 remapping-ascii.php
Its output:
T)]2f;oDxM"V+_4h=qFzO$X-a6j?sH|Q&Z/c8lAuJ~S(1円e:nCwL!U*^3g<pEyN#W,`5i>rG{P%Y.b7k@tI}R'[0d9mBvK
Remarks:
- the output starts with a white space (
chr(32)); - the code prints the white space then each 52th character, wrapping around the range;
- the magic number
52was "discovered" by searching the entire range (1..94) of possible offsets; 1 produces the list of printable chars in the ascending order of their ASCII codes, 94 produces the list in the reverse order, both are bad; the multiples of 5 and 19 (the divisors of 95) produce short cycles and don't cover the entire range of values (also bad); 52seems to be magic; it is the best offset for this code; but it is also the best for some variations of the code (that produce slightly bigger scores); the variations I tried: usewhile()instead offor(), use$f++,$f--or--$finstead of++$f, swap the operands around the<and+operators; squeeze the modification of$Tinto32+$T;- the names of the variables (
$Tand$f) are the first letters from the output; - I tried to initialize
$Twith4or11but the scores were worse; starting with4makes$the first character in the output; it is the most used character in a PHP source code;11brings+in front;$and+are the most used characters in this code.
The code, tests, incremental changes I tried until I reached this solution and the script that tested all possible step values (the authoritative provider for 52 as the best step) can be found on github.
#PHP, (削除) 1217 (削除ここまで) 1081
The code:
for(;$T!=T;$T=($T+52)%95)echo chr(32+$T);
Because the variables are not initialized, it needs to suppress the notices on running (PHP complains but continues execution and uses a default value that is appropriate in the context; 0 in this case):
$ php -d error_reporting=0 remapping-ascii.php
Its output:
T)]2f;oDxM"V+_4h=qFzO$X-a6j?sH|Q&Z/c8lAuJ~S(1円e:nCwL!U*^3g<pEyN#W,`5i>rG{P%Y.b7k@tI}R'[0d9mBvK
Remarks:
- the output starts with a white space (
chr(32)); - the code prints the white space then each 52th character, wrapping around the range;
- the magic number
52was "discovered" by searching the entire range (1..94) of possible offsets; 1 produces the list of printable chars in the ascending order of their ASCII codes, 94 produces the list in the reverse order, both are bad; the multiples of 5 and 19 (the divisors of 95) produce short cycles and don't cover the entire range of values (also bad); 52seems to be magic; it is the best offset for this code; but it is also the best for some variations of the code (that produce slightly bigger scores); the variations I tried: usewhile()instead offor(), use$f++,$f--or--$finstead of++$f, swap the operands around the<and+operators; squeeze the modification of$Tinto32+$T;- the names of the variables (
$Tand$f) are the first letters from the output; - I tried to initialize
$Twith4or11but the scores were worse; starting with4makes$the first character in the output; it is the most used character in a PHP source code;11brings+in front;$and+are the most used characters in this code.
The code, tests, incremental changes I tried until I reached this solution and the script that tested all possible step values (the authoritative provider for 52 as the best step) can be found on github.
PHP, (削除) 1217 (削除ここまで) 1081
The code:
for(;$T!=T;$T=($T+52)%95)echo chr(32+$T);
Because the variables are not initialized, it needs to suppress the notices on running (PHP complains but continues execution and uses a default value that is appropriate in the context; 0 in this case):
$ php -d error_reporting=0 remapping-ascii.php
Its output:
T)]2f;oDxM"V+_4h=qFzO$X-a6j?sH|Q&Z/c8lAuJ~S(1円e:nCwL!U*^3g<pEyN#W,`5i>rG{P%Y.b7k@tI}R'[0d9mBvK
Remarks:
- the output starts with a white space (
chr(32)); - the code prints the white space then each 52th character, wrapping around the range;
- the magic number
52was "discovered" by searching the entire range (1..94) of possible offsets; 1 produces the list of printable chars in the ascending order of their ASCII codes, 94 produces the list in the reverse order, both are bad; the multiples of 5 and 19 (the divisors of 95) produce short cycles and don't cover the entire range of values (also bad); 52seems to be magic; it is the best offset for this code; but it is also the best for some variations of the code (that produce slightly bigger scores); the variations I tried: usewhile()instead offor(), use$f++,$f--or--$finstead of++$f, swap the operands around the<and+operators; squeeze the modification of$Tinto32+$T;- the names of the variables (
$Tand$f) are the first letters from the output; - I tried to initialize
$Twith4or11but the scores were worse; starting with4makes$the first character in the output; it is the most used character in a PHP source code;11brings+in front;$and+are the most used characters in this code.
The code, tests, incremental changes I tried until I reached this solution and the script that tested all possible step values (the authoritative provider for 52 as the best step) can be found on github.
- 769
- 6
- 13
#PHP, 1217(削除) 1217 (削除ここまで) 1081
The code:
for(;++$f<96;$T=;$T!=T;$T=($T+52)%95)echo chr(32+$T);
Because the variables are not initialized, it needs to suppress the notices on running (PHP complains but continues execution and uses a default value that is appropriate in the context; 0 in this case):
$ php -d error_reporting=0 remapping-ascii.php
Its output:
T)]2f;oDxM"V+_4h=qFzO$X-a6j?sH|Q&Z/c8lAuJ~S(1円e:nCwL!U*^3g<pEyN#W,`5i>rG{P%Y.b7k@tI}R'[0d9mBvK
Remarks:
- the output starts with a white space (
chr(32)); - the code prints the white space then each 52th character, wrapping around the range;
- the magic number
52was "discovered" by searching the entire range (1..94) of possible offsets; 1 produces the list of printable chars in the ascending order of their ASCII codes, 94 produces the list in the reverse order, both are bad; the multiples of 5 and 19 (the divisors of 95) produce short cycles and don't cover the entire range of values (also bad); 52seems to be magic; it is the best offset for this code; but it is also the best for some variations of the code (that produce slightly bigger scores); the variations I tried: usewhile()instead offor(), use$f++,$f--or--$finstead of++$f, swap the operands around the<and+operators; squeeze the modification of$Tinto32+$T;- the names of the variables (
$Tand$f) are the first letters from the output; - I tried to initialize
$Twith4or11but the scores were worse; starting with4makes$the first character in the output; it is the most used character in a PHP source code;11brings+in front;$and+are the most used characters in this code.
The code, tests, incremental changes I tried until I reached this solution and the script that tested all possible step values (the authoritative provider for 52 as the best step) can be found on github .
#PHP, 1217
The code:
for(;++$f<96;$T=($T+52)%95)echo chr(32+$T);
Because the variables are not initialized, it needs to suppress the notices on running (PHP complains but continues execution and uses a default value that is appropriate in the context; 0 in this case):
$ php -d error_reporting=0 remapping-ascii.php
Its output:
T)]2f;oDxM"V+_4h=qFzO$X-a6j?sH|Q&Z/c8lAuJ~S(1円e:nCwL!U*^3g<pEyN#W,`5i>rG{P%Y.b7k@tI}R'[0d9mBvK
Remarks:
- the output starts with a white space (
chr(32)); - the code prints the white space then each 52th character, wrapping around the range;
- the magic number
52was "discovered" by searching the entire range (1..94) of possible offsets; 1 produces the list of printable chars in the ascending order of their ASCII codes, 94 produces the list in the reverse order, both are bad; the multiples of 5 and 19 (the divisors of 95) produce short cycles and don't cover the entire range of values (also bad); 52seems to be magic; it is the best offset for this code; but it is also the best for some variations of the code (that produce slightly bigger scores); the variations I tried: usewhile()instead offor(), use$f++,$f--or--$finstead of++$f, swap the operands around the<and+operators; squeeze the modification of$Tinto32+$T;- the names of the variables (
$Tand$f) are the first letters from the output; - I tried to initialize
$Twith4or11but the scores were worse; starting with4makes$the first character in the output; it is the most used character in a PHP source code;11brings+in front;$and+are the most used characters in this code.
#PHP, (削除) 1217 (削除ここまで) 1081
The code:
for(;$T!=T;$T=($T+52)%95)echo chr(32+$T);
Because the variables are not initialized, it needs to suppress the notices on running (PHP complains but continues execution and uses a default value that is appropriate in the context; 0 in this case):
$ php -d error_reporting=0 remapping-ascii.php
Its output:
T)]2f;oDxM"V+_4h=qFzO$X-a6j?sH|Q&Z/c8lAuJ~S(1円e:nCwL!U*^3g<pEyN#W,`5i>rG{P%Y.b7k@tI}R'[0d9mBvK
Remarks:
- the output starts with a white space (
chr(32)); - the code prints the white space then each 52th character, wrapping around the range;
- the magic number
52was "discovered" by searching the entire range (1..94) of possible offsets; 1 produces the list of printable chars in the ascending order of their ASCII codes, 94 produces the list in the reverse order, both are bad; the multiples of 5 and 19 (the divisors of 95) produce short cycles and don't cover the entire range of values (also bad); 52seems to be magic; it is the best offset for this code; but it is also the best for some variations of the code (that produce slightly bigger scores); the variations I tried: usewhile()instead offor(), use$f++,$f--or--$finstead of++$f, swap the operands around the<and+operators; squeeze the modification of$Tinto32+$T;- the names of the variables (
$Tand$f) are the first letters from the output; - I tried to initialize
$Twith4or11but the scores were worse; starting with4makes$the first character in the output; it is the most used character in a PHP source code;11brings+in front;$and+are the most used characters in this code.
The code, tests, incremental changes I tried until I reached this solution and the script that tested all possible step values (the authoritative provider for 52 as the best step) can be found on github .
#PHP, 1217
The code:
for(;++$f<96;$T=($T+52)%95)echo chr(32+$T);
Because the variables are not initialized, it needs to suppress the notices on running (PHP complains but continues execution and uses a default value that is appropriate in the context; 0 in this case):
$ php -d error_reporting=0 remapping-ascii.php
Its output:
T)]2f;oDxM"V+_4h=qFzO$X-a6j?sH|Q&Z/c8lAuJ~S(1円e:nCwL!U*^3g<pEyN#W,`5i>rG{P%Y.b7k@tI}R'[0d9mBvK
Remarks:
- the output starts with a white space (
chr(32)); - the code prints the white space then each 52th character, wrapping around the range;
- the magic number
52was "discovered" by searching the entire range (1..94) of possible offsets; 1 produces the list of printable chars in the ascending order of their ASCII codes, 94 produces the list in the reverse order, both are bad; the multiples of 5 and 19 (the divisors of 95) produce short cycles and don't cover the entire range of values (also bad); 52seems to be magic; it is the best offset for this code; but it is also the best for some variations of the code (that produce slightly bigger scores); the variations I tried: usewhile()instead offor(), use$f++,$f--or--$finstead of++$f, swap the operands around the<and+operators; squeeze the modification of$Tinto32+$T;- the names of the variables (
$Tand$f) are the first letters from the output; - I tried to initialize
$Twith4or11but the scores were worse; starting with4makes$the first character in the output; it is the most used character in a PHP source code;11brings+in front;$and+are the most used characters in this code.