Shell - Bytes: 25462545, False +ves: 0, False -ves: 0 = Score: (削除) 2582 (削除ここまで)(削除) 2548 (削除ここまで) 25462545
Code: (削除) 54 (削除ここまで) 52 bytes, Dictionary: (削除) 2518 (削除ここまで) 2494(削除) 2494 (削除ここまで) 2493 bytes, FP: (削除) 1 (削除ここまで) 0, FN: 0
wget -qqO- 'http://pastebin.com/raw.php?i=wh6yxrqp' \
| perl -pne 's/\r//; s/^I$//' | lzma -cc9 > z
Shell - Bytes: 2546, False +ves: 0, False -ves: 0 = Score: (削除) 2582 (削除ここまで)(削除) 2548 (削除ここまで) 2546
Code: (削除) 54 (削除ここまで) 52 bytes, Dictionary: (削除) 2518 (削除ここまで) 2494 bytes, FP: (削除) 1 (削除ここまで) 0, FN: 0
wget -qqO- 'http://pastebin.com/raw.php?i=wh6yxrqp' \
| perl -pne 's/\r//; s/^I$//' | lzma -c > z
Shell - Bytes: 2545, False +ves: 0, False -ves: 0 = Score: 2545
Code: (削除) 54 (削除ここまで) 52 bytes, Dictionary: (削除) 2518 (削除ここまで) (削除) 2494 (削除ここまで) 2493 bytes, FP: (削除) 1 (削除ここまで) 0, FN: 0
wget -qqO- 'http://pastebin.com/raw.php?i=wh6yxrqp' \
| perl -pne 's/\r//; s/^I$//' | lzma -c9 > z
The conditional compares the argument with itself after a string manipulation that alters the string if it matches any character followed by any number of characters followed by an uppercase letter (equivalent to s/^..*?[A-Z]// – ignore the ? if you don't understand it), which would compare coLoUr to oUr and Colour to Colour. This controls for mixed case (and fails all-caps), though because it skips the first letter, it doesn't reject. It accepts i. Yet (but neither i nor I are in the dictionary, see below).
If the conditional matches (there are no capitals after the first letter), unlzma is run on the contents of the file named z, which puts the uncompressed dictionary into standard output. grep then queries for the argument* quietly (-q), without regard to case—we've already controlled for casethat (-i), and on a whole line (-x).
*The argumentThe query is an altered a bitversion of the argument: if there isthe argument has a trailing capital I (case sensitive!), it is removed. This is fine because I converted Because we controlled for case earlier, the only time we'd remove a capital I would be for the word I, in which case the grep query seeks an empty string on its own line. The dictionary's I entry to bewas swapped for a blank line, so it still matcheswe'll get a match.
The conditional compares the argument with itself after a string manipulation that alters the string if it matches any character followed by any number of characters followed by an uppercase letter (equivalent to s/^..*?[A-Z]// – ignore the ? if you don't understand it), which would compare coLoUr to oUr and Colour to Colour. This controls for mixed case (and fails all-caps), though because it skips the first letter, it doesn't reject i. Yet.
If the conditional matches (there are no capitals after the first letter), unlzma is run on the contents of the file named z, which puts the uncompressed dictionary into standard output. grep then queries for the argument* quietly (-q), without regard to case—we've already controlled for case (-i), and on a whole line (-x).
*The argument is altered a bit: if there is a trailing capital I, it is removed. This is fine because I converted the dictionary's I entry to be a blank line, so it still matches.
The conditional compares the argument with itself after a string manipulation that alters the string if it matches any character followed by any number of characters followed by an uppercase letter (equivalent to s/^..*?[A-Z]// – ignore the ? if you don't understand it), which would compare coLoUr to oUr and Colour to Colour. This controls for mixed case (and fails all-caps), though it skips the first letter. It accepts i (but neither i nor I are in the dictionary, see below).
If the conditional matches (there are no capitals after the first letter), unlzma is run on the contents of the file named z, which puts the uncompressed dictionary into standard output. grep then queries quietly (-q), without regard to case—we've already controlled for that (-i), and on a whole line (-x).
The query is an altered version of the argument: if the argument has a trailing capital I (case sensitive!), it is removed. Because we controlled for case earlier, the only time we'd remove a capital I would be for the word I, in which case the grep query seeks an empty string on its own line. The dictionary's I entry was swapped for a blank line, so we'll get a match.
- 364
- 6
- 11
Shell - Bytes: 25492546, False +ves: 0, False -ves: 0 = Score: (削除) 2582 (削除ここまで) 2548(削除) 2548 (削除ここまで) 2546
Code: 54(削除) 54 (削除ここまで) 52 bytes, Dictionary: (削除) 2518 (削除ここまで) 2494 bytes, FP: (削除) 1 (削除ここまで) 0, FN: 0
[ "1ドル"1ドル = "${1#?*[A-Z]}" ]&&unlzma<z|grep -qix "${1%I}"
If I were guaranteed to only get tests consisting of letters, I could strip out the first pair of quotes and reduceQuotes are not needed around the code size to 52initial (final score: 2546)1ドル because "the input is always a single word, all ASCII [A-Za-z]. (Other" However, quotes areare needed becausearound the substitutionsparameter expansions because they might result ingenerate an empty string.)
Shell - Bytes: 2549, False +ves: 0, False -ves: 0 = Score: (削除) 2582 (削除ここまで) 2548
Code: 54 bytes, Dictionary: (削除) 2518 (削除ここまで) 2494 bytes, FP: (削除) 1 (削除ここまで) 0, FN: 0
[ "1ドル" = "${1#?*[A-Z]}" ]&&unlzma<z|grep -qix "${1%I}"
If I were guaranteed to only get tests consisting of letters, I could strip out the first pair of quotes and reduce the code size to 52 (final score: 2546). (Other quotes are needed because the substitutions might result in an empty string.)
Shell - Bytes: 2546, False +ves: 0, False -ves: 0 = Score: (削除) 2582 (削除ここまで) (削除) 2548 (削除ここまで) 2546
Code: (削除) 54 (削除ここまで) 52 bytes, Dictionary: (削除) 2518 (削除ここまで) 2494 bytes, FP: (削除) 1 (削除ここまで) 0, FN: 0
[ 1ドル = "${1#?*[A-Z]}" ]&&unlzma<z|grep -qix "${1%I}"
Quotes are not needed around the initial 1ドル because "the input is always a single word, all ASCII [A-Za-z]." However, quotes are needed around the parameter expansions because they might generate an empty string.
- 364
- 6
- 11