Skip to main content
added 270 characters in body
Source Link
hobbs
  • 2.5k
  • 1
  • 15
  • 15

Perl, 14121461 bytes, score=1393score=1412, totalerr=21092totalerr=21050

$|++;
while(!eof) {
  $l = $pg = '';
  %d = "[eaitrnoslcdupmhygfbvwkxjqz]<[scpardetmfbilwhognuvjkyqz]a[tlrncsidbpgmyuvkfwxzhoj]b[leoairusytjvmb]c[oetahiulrkcysq]d[eiaourlyvdgsmfwjnhqt]e[rnaslcdtmxevpfgqiwyobhkzju]f[ieoauflrty]g[erhiaunolygsmtdb]h[eaoituyrnldmbcw]i[notsclvdagrmefbpzxkuq]j[uoea]k[einaslywftogd]l[eyialoutdfvskcmpbwnr]m[eaipombuysnftl]n[tgedcsaionvufkylmhjqwxp]o[nrumlstwpocvdgfbaikyexjh]p[reoaliptuhsymdbfw]q[u]r[eaiotymdsruncgvklpbfwh]s[teisuhpoacmlykwfqndbr]t[iearhoyultcmwnsfbpg]u[rnstliceampbgdfyok]v[eiaoyu]w[aiehonrlsdtkfy]x[pctiaehuy]y[esomatpcwbildgrn]z[eoaiy]"
    =~ /(.?)\[(.*?)\]/g;
  %r = ">[etynrldgshmkpcwfoabxui]a[retclmnphisfvwbudgoxykjz]b[aiumoerylbhgspt]c[ienaouscrxtlyh]d[neairoludhsywgpk]e[rtldsvcmnphgefibkuwyzjox]f[eifnoalrustdmkwp]g[niaeroudgykt]h[tcsgwpenrxado]i[trsldnacmfhvpugwbekoxyz]j[nbdeao]k[carnosilewu]l[aeliobpuctfsrdgnwhkym]m[oeiarumstdynlghbp]n[oieaurngwkhtmsldy]o[icrplthmsfnobdwvgejyuzak]p[msaoepuixrlynt]q[eisncd]r[eaotpuigcrbdfhwlys]s[iesaunorbydclptmkgw]t[ansicreuolthpfxbygkwmd]u[ostcqlrfdbpagnmjhixev]v[ieoanrdlb]w[oaesrtydnlkph]x[eiaon]y[ltradcnsheomfbgpkuvzxw]z[iae]"
    =~ /(.?)\[(.*?)\]/g;
  while (<>) {
    chomp; last if !/_/ or /^END$/;
    $l++ unless /$pg/;
    last if $l>5;
    s/$pg//g for values %d;%d, values %r;
    $_ = "<$_>";
    my %s;
    while (/([^_]?)_/g) {
      $x = $d{$1} || $d{''};
      $s = 26;180;
      for (split //, ($d{$1}||$d{''})$x ){ $s{$_} += $s; $s- -= 100 / length $x }
    }
    while (/_([^_])/g) {
      $x = $r{$1} || $d{''};
      $s = 26;180;
      for (split //, ($r{$1}||$d{''})$x ) { $s{$_} += $s; $s- -= 100 / length $x }
    }
    ($pg) = sort { $s{$b} <=> $s{$a} } a..z;
    print $pg, $/
  }
}

(Note, it's 14121461 bytes after removing quite a bit of optional whitespace. As printed, it's a hundred or so heavier, but still well under 2000.)

For every unknown position in the word, it looks at the preceding character, gives each possible following character a score, starting at 26180 for the top-ranked, and decreasing by one asto 80 at the rank goes down;end of the list; then the same thing is done for the following character. All the scores for all characters are added up, and the one with the highest score is selected.

After a letter is guessed, it's removed directly from the ranking tables, so it can't be guessed again (until we start a new word and re-initialize the tables).

Update: gained a bunch of points by fixing a bug (we weren't removing letters from the reverse table) and changing the way the points drop off as we go down the list.

Perl, 1412 bytes, score=1393, totalerr=21092

$|++;
while(!eof) {
  $l = $pg = '';
  %d = "[eaitrnoslcdupmhygfbvwkxjqz]<[scpardetmfbilwhognuvjkyqz]a[tlrncsidbpgmyuvkfwxzhoj]b[leoairusytjvmb]c[oetahiulrkcysq]d[eiaourlyvdgsmfwjnhqt]e[rnaslcdtmxevpfgqiwyobhkzju]f[ieoauflrty]g[erhiaunolygsmtdb]h[eaoituyrnldmbcw]i[notsclvdagrmefbpzxkuq]j[uoea]k[einaslywftogd]l[eyialoutdfvskcmpbwnr]m[eaipombuysnftl]n[tgedcsaionvufkylmhjqwxp]o[nrumlstwpocvdgfbaikyexjh]p[reoaliptuhsymdbfw]q[u]r[eaiotymdsruncgvklpbfwh]s[teisuhpoacmlykwfqndbr]t[iearhoyultcmwnsfbpg]u[rnstliceampbgdfyok]v[eiaoyu]w[aiehonrlsdtkfy]x[pctiaehuy]y[esomatpcwbildgrn]z[eoaiy]"
    =~ /(.?)\[(.*?)\]/g;
  %r = ">[etynrldgshmkpcwfoabxui]a[retclmnphisfvwbudgoxykjz]b[aiumoerylbhgspt]c[ienaouscrxtlyh]d[neairoludhsywgpk]e[rtldsvcmnphgefibkuwyzjox]f[eifnoalrustdmkwp]g[niaeroudgykt]h[tcsgwpenrxado]i[trsldnacmfhvpugwbekoxyz]j[nbdeao]k[carnosilewu]l[aeliobpuctfsrdgnwhkym]m[oeiarumstdynlghbp]n[oieaurngwkhtmsldy]o[icrplthmsfnobdwvgejyuzak]p[msaoepuixrlynt]q[eisncd]r[eaotpuigcrbdfhwlys]s[iesaunorbydclptmkgw]t[ansicreuolthpfxbygkwmd]u[ostcqlrfdbpagnmjhixev]v[ieoanrdlb]w[oaesrtydnlkph]x[eiaon]y[ltradcnsheomfbgpkuvzxw]z[iae]"
    =~ /(.?)\[(.*?)\]/g;
  while (<>) {
    chomp; last if !/_/ or /^END$/;
    $l++ unless /$pg/;
    last if $l>5;
    s/$pg//g for values %d;
    $_ = "<$_>";
    my %s;
    while (/([^_]?)_/g) {
      $s = 26;
      for (split //, ($d{$1}||$d{''}) ){ $s{$_} += $s-- }
    }
    while (/_([^_])/g) {
      $s = 26;
      for (split //, ($r{$1}||$d{''}) ) { $s{$_} += $s-- }
    }
    ($pg) = sort { $s{$b} <=> $s{$a} } a..z;
    print $pg, $/
  }
}

(Note, it's 1412 bytes after removing quite a bit of optional whitespace. As printed, it's a hundred or so heavier, but still well under 2000.)

For every unknown position in the word, it looks at the preceding character, gives each possible following character a score, starting at 26 for the top-ranked, and decreasing by one as the rank goes down; then the same thing is done for the following character. All the scores for all characters are added up, and the one with the highest score is selected.

After a letter is guessed, it's removed directly from the ranking tables, so it can't be guessed again (until we start a new word and re-initialize the tables).

Perl, 1461 bytes, score=1412, totalerr=21050

$|++;
while(!eof) {
  $l = $pg = '';
  %d = "[eaitrnoslcdupmhygfbvwkxjqz]<[scpardetmfbilwhognuvjkyqz]a[tlrncsidbpgmyuvkfwxzhoj]b[leoairusytjvmb]c[oetahiulrkcysq]d[eiaourlyvdgsmfwjnhqt]e[rnaslcdtmxevpfgqiwyobhkzju]f[ieoauflrty]g[erhiaunolygsmtdb]h[eaoituyrnldmbcw]i[notsclvdagrmefbpzxkuq]j[uoea]k[einaslywftogd]l[eyialoutdfvskcmpbwnr]m[eaipombuysnftl]n[tgedcsaionvufkylmhjqwxp]o[nrumlstwpocvdgfbaikyexjh]p[reoaliptuhsymdbfw]q[u]r[eaiotymdsruncgvklpbfwh]s[teisuhpoacmlykwfqndbr]t[iearhoyultcmwnsfbpg]u[rnstliceampbgdfyok]v[eiaoyu]w[aiehonrlsdtkfy]x[pctiaehuy]y[esomatpcwbildgrn]z[eoaiy]"
    =~ /(.?)\[(.*?)\]/g;
  %r = ">[etynrldgshmkpcwfoabxui]a[retclmnphisfvwbudgoxykjz]b[aiumoerylbhgspt]c[ienaouscrxtlyh]d[neairoludhsywgpk]e[rtldsvcmnphgefibkuwyzjox]f[eifnoalrustdmkwp]g[niaeroudgykt]h[tcsgwpenrxado]i[trsldnacmfhvpugwbekoxyz]j[nbdeao]k[carnosilewu]l[aeliobpuctfsrdgnwhkym]m[oeiarumstdynlghbp]n[oieaurngwkhtmsldy]o[icrplthmsfnobdwvgejyuzak]p[msaoepuixrlynt]q[eisncd]r[eaotpuigcrbdfhwlys]s[iesaunorbydclptmkgw]t[ansicreuolthpfxbygkwmd]u[ostcqlrfdbpagnmjhixev]v[ieoanrdlb]w[oaesrtydnlkph]x[eiaon]y[ltradcnsheomfbgpkuvzxw]z[iae]"
    =~ /(.?)\[(.*?)\]/g;
  while (<>) {
    chomp; last if !/_/ or /^END$/;
    $l++ unless /$pg/;
    last if $l>5;
    s/$pg//g for values %d, values %r;
    $_ = "<$_>";
    my %s;
    while (/([^_]?)_/g) {
      $x = $d{$1} || $d{''};
      $s = 180;
      for (split //, $x ){ $s{$_} += $s; $s -= 100 / length $x }
    }
    while (/_([^_])/g) {
      $x = $r{$1} || $d{''};
      $s = 180;
      for (split //, $x ) { $s{$_} += $s; $s -= 100 / length $x }
    }
    ($pg) = sort { $s{$b} <=> $s{$a} } a..z;
    print $pg, $/
  }
}

(Note, it's 1461 bytes after removing quite a bit of optional whitespace. As printed, it's a hundred or so heavier, but still well under 2000.)

For every unknown position in the word, it looks at the preceding character, gives each possible following character a score, starting at 180 for the top-ranked, and decreasing to 80 at the end of the list; then the same thing is done for the following character. All the scores for all characters are added up, and the one with the highest score is selected.

After a letter is guessed, it's removed directly from the ranking tables, so it can't be guessed again (until we start a new word and re-initialize the tables).

Update: gained a bunch of points by fixing a bug (we weren't removing letters from the reverse table) and changing the way the points drop off as we go down the list.

Fix the explanation of the digraphs, I was tired.
Source Link
hobbs
  • 2.5k
  • 1
  • 15
  • 15

Perl, 1412 bytes, score=1393, totalerr=21092

$|++;
while(!eof) {
  $l = $pg = '';
  %d = "[eaitrnoslcdupmhygfbvwkxjqz]<[scpardetmfbilwhognuvjkyqz]a[tlrncsidbpgmyuvkfwxzhoj]b[leoairusytjvmb]c[oetahiulrkcysq]d[eiaourlyvdgsmfwjnhqt]e[rnaslcdtmxevpfgqiwyobhkzju]f[ieoauflrty]g[erhiaunolygsmtdb]h[eaoituyrnldmbcw]i[notsclvdagrmefbpzxkuq]j[uoea]k[einaslywftogd]l[eyialoutdfvskcmpbwnr]m[eaipombuysnftl]n[tgedcsaionvufkylmhjqwxp]o[nrumlstwpocvdgfbaikyexjh]p[reoaliptuhsymdbfw]q[u]r[eaiotymdsruncgvklpbfwh]s[teisuhpoacmlykwfqndbr]t[iearhoyultcmwnsfbpg]u[rnstliceampbgdfyok]v[eiaoyu]w[aiehonrlsdtkfy]x[pctiaehuy]y[esomatpcwbildgrn]z[eoaiy]"
    =~ /(.?)\[(.*?)\]/g;
  %r = ">[etynrldgshmkpcwfoabxui]a[retclmnphisfvwbudgoxykjz]b[aiumoerylbhgspt]c[ienaouscrxtlyh]d[neairoludhsywgpk]e[rtldsvcmnphgefibkuwyzjox]f[eifnoalrustdmkwp]g[niaeroudgykt]h[tcsgwpenrxado]i[trsldnacmfhvpugwbekoxyz]j[nbdeao]k[carnosilewu]l[aeliobpuctfsrdgnwhkym]m[oeiarumstdynlghbp]n[oieaurngwkhtmsldy]o[icrplthmsfnobdwvgejyuzak]p[msaoepuixrlynt]q[eisncd]r[eaotpuigcrbdfhwlys]s[iesaunorbydclptmkgw]t[ansicreuolthpfxbygkwmd]u[ostcqlrfdbpagnmjhixev]v[ieoanrdlb]w[oaesrtydnlkph]x[eiaon]y[ltradcnsheomfbgpkuvzxw]z[iae]"
    =~ /(.?)\[(.*?)\]/g;
  while (<>) {
    chomp; last if !/_/ or /^END$/;
    $l++ unless /$pg/;
    last if $l>5;
    s/$pg//g for values %d;
    $_ = "<$_>";
    my %s;
    while (/([^_]?)_/g) {
      $s = 26;
      for (split //, ($d{$1}||$d{''}) ){ $s{$_} += $s-- }
    }
    while (/_([^_])/g) {
      $s = 26;
      for (split //, ($r{$1}||$d{''}) ) { $s{$_} += $s-- }
    }
    ($pg) = sort { $s{$b} <=> $s{$a} } a..z;
    print $pg, $/
  }
}

(Note, it's 1412 bytes after removing quite a bit of optional whitespace. As printed, it's a hundred or so heavier, but still well under 2000.)

I tried a bunch of more "subtle" approaches, but this one ended up beating them all. The two data strings are simply ranked lists of the characters most likely to follow each character, and the characters leastmost likely to followprecede each character (with digraphs that don't occur in the wordlist not represented at all). < and > are used to represent the beginning and end of the word. As an example, "w[aiehonrlsdtkfy]" means that "wa" is more common than "wi" is more common than "we" etc. %d, the forward mapping, includes a global ranking, stored as $d{''}. It's used for places where there are two unknowns in a row, or where all the digraphs in the wordlist are exhausted (so we must be dealing with a non-wordlist word).

For every unknown position in the word, it looks at the preceding character, gives each possible following character a score, starting at 26 for the top-ranked, and decreasing by one as the rank goes down; then the same thing is done for the following character. All the scores for all characters are added up, and the one with the highest score is selected.

After a letter is guessed, it's removed directly from the ranking tables, so it can't be guessed again (until we start a new word and re-initialize the tables).

Perl, 1412 bytes, score=1393, totalerr=21092

$|++;
while(!eof) {
  $l = $pg = '';
  %d = "[eaitrnoslcdupmhygfbvwkxjqz]<[scpardetmfbilwhognuvjkyqz]a[tlrncsidbpgmyuvkfwxzhoj]b[leoairusytjvmb]c[oetahiulrkcysq]d[eiaourlyvdgsmfwjnhqt]e[rnaslcdtmxevpfgqiwyobhkzju]f[ieoauflrty]g[erhiaunolygsmtdb]h[eaoituyrnldmbcw]i[notsclvdagrmefbpzxkuq]j[uoea]k[einaslywftogd]l[eyialoutdfvskcmpbwnr]m[eaipombuysnftl]n[tgedcsaionvufkylmhjqwxp]o[nrumlstwpocvdgfbaikyexjh]p[reoaliptuhsymdbfw]q[u]r[eaiotymdsruncgvklpbfwh]s[teisuhpoacmlykwfqndbr]t[iearhoyultcmwnsfbpg]u[rnstliceampbgdfyok]v[eiaoyu]w[aiehonrlsdtkfy]x[pctiaehuy]y[esomatpcwbildgrn]z[eoaiy]"
    =~ /(.?)\[(.*?)\]/g;
  %r = ">[etynrldgshmkpcwfoabxui]a[retclmnphisfvwbudgoxykjz]b[aiumoerylbhgspt]c[ienaouscrxtlyh]d[neairoludhsywgpk]e[rtldsvcmnphgefibkuwyzjox]f[eifnoalrustdmkwp]g[niaeroudgykt]h[tcsgwpenrxado]i[trsldnacmfhvpugwbekoxyz]j[nbdeao]k[carnosilewu]l[aeliobpuctfsrdgnwhkym]m[oeiarumstdynlghbp]n[oieaurngwkhtmsldy]o[icrplthmsfnobdwvgejyuzak]p[msaoepuixrlynt]q[eisncd]r[eaotpuigcrbdfhwlys]s[iesaunorbydclptmkgw]t[ansicreuolthpfxbygkwmd]u[ostcqlrfdbpagnmjhixev]v[ieoanrdlb]w[oaesrtydnlkph]x[eiaon]y[ltradcnsheomfbgpkuvzxw]z[iae]"
    =~ /(.?)\[(.*?)\]/g;
  while (<>) {
    chomp; last if !/_/ or /^END$/;
    $l++ unless /$pg/;
    last if $l>5;
    s/$pg//g for values %d;
    $_ = "<$_>";
    my %s;
    while (/([^_]?)_/g) {
      $s = 26;
      for (split //, ($d{$1}||$d{''}) ){ $s{$_} += $s-- }
    }
    while (/_([^_])/g) {
      $s = 26;
      for (split //, ($r{$1}||$d{''}) ) { $s{$_} += $s-- }
    }
    ($pg) = sort { $s{$b} <=> $s{$a} } a..z;
    print $pg, $/
  }
}

(Note, it's 1412 bytes after removing quite a bit of optional whitespace. As printed, it's a hundred or so heavier, but still well under 2000.)

I tried a bunch of more "subtle" approaches, but this one ended up beating them all. The two data strings are simply ranked lists of the characters most likely to follow each character, and the characters least likely to follow each character (with digraphs that don't occur in the wordlist not represented at all). < and > are used to represent the beginning and end of the word. As an example, "w[aiehonrlsdtkfy]" means that "wa" is more common than "wi" is more common than "we" etc. %d, the forward mapping, includes a global ranking, stored as $d{''}. It's used for places where there are two unknowns in a row, or where all the digraphs in the wordlist are exhausted (so we must be dealing with a non-wordlist word).

For every unknown position in the word, it looks at the preceding character, gives each possible following character a score, starting at 26 for the top-ranked, and decreasing by one as the rank goes down; then the same thing is done for the following character. All the scores for all characters are added up, and the one with the highest score is selected.

After a letter is guessed, it's removed directly from the ranking tables, so it can't be guessed again (until we start a new word and re-initialize the tables).

Perl, 1412 bytes, score=1393, totalerr=21092

$|++;
while(!eof) {
  $l = $pg = '';
  %d = "[eaitrnoslcdupmhygfbvwkxjqz]<[scpardetmfbilwhognuvjkyqz]a[tlrncsidbpgmyuvkfwxzhoj]b[leoairusytjvmb]c[oetahiulrkcysq]d[eiaourlyvdgsmfwjnhqt]e[rnaslcdtmxevpfgqiwyobhkzju]f[ieoauflrty]g[erhiaunolygsmtdb]h[eaoituyrnldmbcw]i[notsclvdagrmefbpzxkuq]j[uoea]k[einaslywftogd]l[eyialoutdfvskcmpbwnr]m[eaipombuysnftl]n[tgedcsaionvufkylmhjqwxp]o[nrumlstwpocvdgfbaikyexjh]p[reoaliptuhsymdbfw]q[u]r[eaiotymdsruncgvklpbfwh]s[teisuhpoacmlykwfqndbr]t[iearhoyultcmwnsfbpg]u[rnstliceampbgdfyok]v[eiaoyu]w[aiehonrlsdtkfy]x[pctiaehuy]y[esomatpcwbildgrn]z[eoaiy]"
    =~ /(.?)\[(.*?)\]/g;
  %r = ">[etynrldgshmkpcwfoabxui]a[retclmnphisfvwbudgoxykjz]b[aiumoerylbhgspt]c[ienaouscrxtlyh]d[neairoludhsywgpk]e[rtldsvcmnphgefibkuwyzjox]f[eifnoalrustdmkwp]g[niaeroudgykt]h[tcsgwpenrxado]i[trsldnacmfhvpugwbekoxyz]j[nbdeao]k[carnosilewu]l[aeliobpuctfsrdgnwhkym]m[oeiarumstdynlghbp]n[oieaurngwkhtmsldy]o[icrplthmsfnobdwvgejyuzak]p[msaoepuixrlynt]q[eisncd]r[eaotpuigcrbdfhwlys]s[iesaunorbydclptmkgw]t[ansicreuolthpfxbygkwmd]u[ostcqlrfdbpagnmjhixev]v[ieoanrdlb]w[oaesrtydnlkph]x[eiaon]y[ltradcnsheomfbgpkuvzxw]z[iae]"
    =~ /(.?)\[(.*?)\]/g;
  while (<>) {
    chomp; last if !/_/ or /^END$/;
    $l++ unless /$pg/;
    last if $l>5;
    s/$pg//g for values %d;
    $_ = "<$_>";
    my %s;
    while (/([^_]?)_/g) {
      $s = 26;
      for (split //, ($d{$1}||$d{''}) ){ $s{$_} += $s-- }
    }
    while (/_([^_])/g) {
      $s = 26;
      for (split //, ($r{$1}||$d{''}) ) { $s{$_} += $s-- }
    }
    ($pg) = sort { $s{$b} <=> $s{$a} } a..z;
    print $pg, $/
  }
}

(Note, it's 1412 bytes after removing quite a bit of optional whitespace. As printed, it's a hundred or so heavier, but still well under 2000.)

I tried a bunch of more "subtle" approaches, but this one ended up beating them all. The two data strings are simply ranked lists of the characters most likely to follow each character, and the characters most likely to precede each character (with digraphs that don't occur in the wordlist not represented at all). < and > are used to represent the beginning and end of the word. As an example, "w[aiehonrlsdtkfy]" means that "wa" is more common than "wi" is more common than "we" etc. %d, the forward mapping, includes a global ranking, stored as $d{''}. It's used for places where there are two unknowns in a row, or where all the digraphs in the wordlist are exhausted (so we must be dealing with a non-wordlist word).

For every unknown position in the word, it looks at the preceding character, gives each possible following character a score, starting at 26 for the top-ranked, and decreasing by one as the rank goes down; then the same thing is done for the following character. All the scores for all characters are added up, and the one with the highest score is selected.

After a letter is guessed, it's removed directly from the ranking tables, so it can't be guessed again (until we start a new word and re-initialize the tables).

syntax highlighting, added error count
Source Link
user12205
  • 9k
  • 3
  • 32
  • 65

Perl, 1412 bytes, score=1393, totalerr=21092

$|++;
while(!eof) {
  $l = $pg = '';
  %d = "[eaitrnoslcdupmhygfbvwkxjqz]<[scpardetmfbilwhognuvjkyqz]a[tlrncsidbpgmyuvkfwxzhoj]b[leoairusytjvmb]c[oetahiulrkcysq]d[eiaourlyvdgsmfwjnhqt]e[rnaslcdtmxevpfgqiwyobhkzju]f[ieoauflrty]g[erhiaunolygsmtdb]h[eaoituyrnldmbcw]i[notsclvdagrmefbpzxkuq]j[uoea]k[einaslywftogd]l[eyialoutdfvskcmpbwnr]m[eaipombuysnftl]n[tgedcsaionvufkylmhjqwxp]o[nrumlstwpocvdgfbaikyexjh]p[reoaliptuhsymdbfw]q[u]r[eaiotymdsruncgvklpbfwh]s[teisuhpoacmlykwfqndbr]t[iearhoyultcmwnsfbpg]u[rnstliceampbgdfyok]v[eiaoyu]w[aiehonrlsdtkfy]x[pctiaehuy]y[esomatpcwbildgrn]z[eoaiy]"
    =~ /(.?)\[(.*?)\]/g;
  %r = ">[etynrldgshmkpcwfoabxui]a[retclmnphisfvwbudgoxykjz]b[aiumoerylbhgspt]c[ienaouscrxtlyh]d[neairoludhsywgpk]e[rtldsvcmnphgefibkuwyzjox]f[eifnoalrustdmkwp]g[niaeroudgykt]h[tcsgwpenrxado]i[trsldnacmfhvpugwbekoxyz]j[nbdeao]k[carnosilewu]l[aeliobpuctfsrdgnwhkym]m[oeiarumstdynlghbp]n[oieaurngwkhtmsldy]o[icrplthmsfnobdwvgejyuzak]p[msaoepuixrlynt]q[eisncd]r[eaotpuigcrbdfhwlys]s[iesaunorbydclptmkgw]t[ansicreuolthpfxbygkwmd]u[ostcqlrfdbpagnmjhixev]v[ieoanrdlb]w[oaesrtydnlkph]x[eiaon]y[ltradcnsheomfbgpkuvzxw]z[iae]"
    =~ /(.?)\[(.*?)\]/g;
  while (<>) {
    chomp; last if !/_/ or /^END$/;
    $l++ unless /$pg/;
    last if $l>5;
    s/$pg//g for values %d;
    $_ = "<$_>";
    my %s;
    while (/([^_]?)_/g) {
      $s = 26;
      for (split //, ($d{$1}||$d{''}) ){ $s{$_} += $s-- }
    }
    while (/_([^_])/g) {
      $s = 26;
      for (split //, ($r{$1}||$d{''}) ) { $s{$_} += $s-- }
    }
    ($pg) = sort { $s{$b} <=> $s{$a} } a..z;
    print $pg, $/
  }
}
$|++;
while(!eof) {
  $l = $pg = '';
  %d = "[eaitrnoslcdupmhygfbvwkxjqz]<[scpardetmfbilwhognuvjkyqz]a[tlrncsidbpgmyuvkfwxzhoj]b[leoairusytjvmb]c[oetahiulrkcysq]d[eiaourlyvdgsmfwjnhqt]e[rnaslcdtmxevpfgqiwyobhkzju]f[ieoauflrty]g[erhiaunolygsmtdb]h[eaoituyrnldmbcw]i[notsclvdagrmefbpzxkuq]j[uoea]k[einaslywftogd]l[eyialoutdfvskcmpbwnr]m[eaipombuysnftl]n[tgedcsaionvufkylmhjqwxp]o[nrumlstwpocvdgfbaikyexjh]p[reoaliptuhsymdbfw]q[u]r[eaiotymdsruncgvklpbfwh]s[teisuhpoacmlykwfqndbr]t[iearhoyultcmwnsfbpg]u[rnstliceampbgdfyok]v[eiaoyu]w[aiehonrlsdtkfy]x[pctiaehuy]y[esomatpcwbildgrn]z[eoaiy]"
    =~ /(.?)\[(.*?)\]/g;
  %r = ">[etynrldgshmkpcwfoabxui]a[retclmnphisfvwbudgoxykjz]b[aiumoerylbhgspt]c[ienaouscrxtlyh]d[neairoludhsywgpk]e[rtldsvcmnphgefibkuwyzjox]f[eifnoalrustdmkwp]g[niaeroudgykt]h[tcsgwpenrxado]i[trsldnacmfhvpugwbekoxyz]j[nbdeao]k[carnosilewu]l[aeliobpuctfsrdgnwhkym]m[oeiarumstdynlghbp]n[oieaurngwkhtmsldy]o[icrplthmsfnobdwvgejyuzak]p[msaoepuixrlynt]q[eisncd]r[eaotpuigcrbdfhwlys]s[iesaunorbydclptmkgw]t[ansicreuolthpfxbygkwmd]u[ostcqlrfdbpagnmjhixev]v[ieoanrdlb]w[oaesrtydnlkph]x[eiaon]y[ltradcnsheomfbgpkuvzxw]z[iae]"
    =~ /(.?)\[(.*?)\]/g;
  while (<>) {
    chomp; last if !/_/ or /^END$/;
    $l++ unless /$pg/;
    last if $l>5;
    s/$pg//g for values %d;
    $_ = "<$_>";
    my %s;
    while (/([^_]?)_/g) {
      $s = 26;
      for (split //, ($d{$1}||$d{''}) ){ $s{$_} += $s-- }
    }
    while (/_([^_])/g) {
      $s = 26;
      for (split //, ($r{$1}||$d{''}) ) { $s{$_} += $s-- }
    }
    ($pg) = sort { $s{$b} <=> $s{$a} } a..z;
    print $pg, $/
  }
}

Perl, 1412 bytes, score=1393

$|++;
while(!eof) {
  $l = $pg = '';
  %d = "[eaitrnoslcdupmhygfbvwkxjqz]<[scpardetmfbilwhognuvjkyqz]a[tlrncsidbpgmyuvkfwxzhoj]b[leoairusytjvmb]c[oetahiulrkcysq]d[eiaourlyvdgsmfwjnhqt]e[rnaslcdtmxevpfgqiwyobhkzju]f[ieoauflrty]g[erhiaunolygsmtdb]h[eaoituyrnldmbcw]i[notsclvdagrmefbpzxkuq]j[uoea]k[einaslywftogd]l[eyialoutdfvskcmpbwnr]m[eaipombuysnftl]n[tgedcsaionvufkylmhjqwxp]o[nrumlstwpocvdgfbaikyexjh]p[reoaliptuhsymdbfw]q[u]r[eaiotymdsruncgvklpbfwh]s[teisuhpoacmlykwfqndbr]t[iearhoyultcmwnsfbpg]u[rnstliceampbgdfyok]v[eiaoyu]w[aiehonrlsdtkfy]x[pctiaehuy]y[esomatpcwbildgrn]z[eoaiy]"
    =~ /(.?)\[(.*?)\]/g;
  %r = ">[etynrldgshmkpcwfoabxui]a[retclmnphisfvwbudgoxykjz]b[aiumoerylbhgspt]c[ienaouscrxtlyh]d[neairoludhsywgpk]e[rtldsvcmnphgefibkuwyzjox]f[eifnoalrustdmkwp]g[niaeroudgykt]h[tcsgwpenrxado]i[trsldnacmfhvpugwbekoxyz]j[nbdeao]k[carnosilewu]l[aeliobpuctfsrdgnwhkym]m[oeiarumstdynlghbp]n[oieaurngwkhtmsldy]o[icrplthmsfnobdwvgejyuzak]p[msaoepuixrlynt]q[eisncd]r[eaotpuigcrbdfhwlys]s[iesaunorbydclptmkgw]t[ansicreuolthpfxbygkwmd]u[ostcqlrfdbpagnmjhixev]v[ieoanrdlb]w[oaesrtydnlkph]x[eiaon]y[ltradcnsheomfbgpkuvzxw]z[iae]"
    =~ /(.?)\[(.*?)\]/g;
  while (<>) {
    chomp; last if !/_/ or /^END$/;
    $l++ unless /$pg/;
    last if $l>5;
    s/$pg//g for values %d;
    $_ = "<$_>";
    my %s;
    while (/([^_]?)_/g) {
      $s = 26;
      for (split //, ($d{$1}||$d{''}) ){ $s{$_} += $s-- }
    }
    while (/_([^_])/g) {
      $s = 26;
      for (split //, ($r{$1}||$d{''}) ) { $s{$_} += $s-- }
    }
    ($pg) = sort { $s{$b} <=> $s{$a} } a..z;
    print $pg, $/
  }
}

Perl, 1412 bytes, score=1393, totalerr=21092

$|++;
while(!eof) {
  $l = $pg = '';
  %d = "[eaitrnoslcdupmhygfbvwkxjqz]<[scpardetmfbilwhognuvjkyqz]a[tlrncsidbpgmyuvkfwxzhoj]b[leoairusytjvmb]c[oetahiulrkcysq]d[eiaourlyvdgsmfwjnhqt]e[rnaslcdtmxevpfgqiwyobhkzju]f[ieoauflrty]g[erhiaunolygsmtdb]h[eaoituyrnldmbcw]i[notsclvdagrmefbpzxkuq]j[uoea]k[einaslywftogd]l[eyialoutdfvskcmpbwnr]m[eaipombuysnftl]n[tgedcsaionvufkylmhjqwxp]o[nrumlstwpocvdgfbaikyexjh]p[reoaliptuhsymdbfw]q[u]r[eaiotymdsruncgvklpbfwh]s[teisuhpoacmlykwfqndbr]t[iearhoyultcmwnsfbpg]u[rnstliceampbgdfyok]v[eiaoyu]w[aiehonrlsdtkfy]x[pctiaehuy]y[esomatpcwbildgrn]z[eoaiy]"
    =~ /(.?)\[(.*?)\]/g;
  %r = ">[etynrldgshmkpcwfoabxui]a[retclmnphisfvwbudgoxykjz]b[aiumoerylbhgspt]c[ienaouscrxtlyh]d[neairoludhsywgpk]e[rtldsvcmnphgefibkuwyzjox]f[eifnoalrustdmkwp]g[niaeroudgykt]h[tcsgwpenrxado]i[trsldnacmfhvpugwbekoxyz]j[nbdeao]k[carnosilewu]l[aeliobpuctfsrdgnwhkym]m[oeiarumstdynlghbp]n[oieaurngwkhtmsldy]o[icrplthmsfnobdwvgejyuzak]p[msaoepuixrlynt]q[eisncd]r[eaotpuigcrbdfhwlys]s[iesaunorbydclptmkgw]t[ansicreuolthpfxbygkwmd]u[ostcqlrfdbpagnmjhixev]v[ieoanrdlb]w[oaesrtydnlkph]x[eiaon]y[ltradcnsheomfbgpkuvzxw]z[iae]"
    =~ /(.?)\[(.*?)\]/g;
  while (<>) {
    chomp; last if !/_/ or /^END$/;
    $l++ unless /$pg/;
    last if $l>5;
    s/$pg//g for values %d;
    $_ = "<$_>";
    my %s;
    while (/([^_]?)_/g) {
      $s = 26;
      for (split //, ($d{$1}||$d{''}) ){ $s{$_} += $s-- }
    }
    while (/_([^_])/g) {
      $s = 26;
      for (split //, ($r{$1}||$d{''}) ) { $s{$_} += $s-- }
    }
    ($pg) = sort { $s{$b} <=> $s{$a} } a..z;
    print $pg, $/
  }
}
Source Link
hobbs
  • 2.5k
  • 1
  • 15
  • 15
Loading