Advertisement
Guest User

gay.pl - xchat port

a guest
Jan 8th, 2011
2,695
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 117.28 KB | None | 0 0
  1. #!/usr/bin/perl -w
  2.  
  3. # a suite of text filters to annoy people :D
  4. #
  5. # author: cj_ <cjones@insub.org>
  6. #
  7. # "If used sparingly, and in good taste, ASCII art generally
  8. # is very well-received !"
  9. #                             -- Some Sucker
  10. #
  11. # credits:
  12. #    fucter for translating to xchat2, only cli-fags use irssi
  13. #    ben for banner leetness
  14. #    Pi for the popeye filter
  15. #    j0no for entirety of 8.7 release features and bugfixes
  16. #    zb for adding ansi color support and putting this in ports :D
  17. #    sisko for the original color script
  18. #    various ideas from: tosat, jej, twid, cappy, rob
  19. #    uke for the inspiration for the checker
  20. #    hlprmnky for the jigs and for debugging
  21. #    various stolen things: emacs spook file, jwz's scrambler script
  22. #
  23. #
  24. # Copyright (C) 2003-2008 cj_ <cjones@insub.org>
  25. #
  26. # This program is free software; you can redistribute it and/or
  27. # modify it under the terms of the GNU General Public License
  28. # as published by the Free Software Foundation; either version 2
  29. # of the License, or (at your option) any later version.
  30. #
  31. # This program is distributed in the hope that it will be useful,
  32. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  33. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  34. # GNU General Public License for more details.
  35. #
  36. # You should have received a copy of the GNU General Public License
  37. # along with this program; if not, write to the Free Software
  38. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
  39. #
  40. # needs throttle, banner needs some cleaning , cmd, usages, general cleanup of code, smileys
  41. #msg works, code looks shitty
  42.  
  43.  
  44. #use strict;
  45. #use Text::Wrap;
  46. #use IPC::Open3;  #we dont need anymore
  47.  
  48.  
  49. Xchat::register("gay", "12.0", "a suite of annoying ascii color/art text filters", "");
  50. IRC::print "gay.pl by cjones, made for xchat by chuck wolfe";
  51. #Did you know cjones was a fag, he actually sucked dick and liked it
  52. IRC::print "For usage help, try /gay -help";
  53. #Xchat::hook_command("gay", "process");
  54. IRC::add_command_handler("gay", "process");
  55.  
  56. my $throttle = 0;
  57. my $USAGE;
  58.  
  59.     $USAGE = "/gay.pl\n";
  60.  
  61.  
  62. $USAGE .= "
  63. [-usage|-help|-version|-colors] [filters ...] [text ...]
  64.  
  65. FILTERS:
  66.     [-YES] [-blink] [-jive] [-exec] [-cow] [-cowfile <cow>] [-capchk] [-think]
  67.     [-fig] [-font <font>] [-box] [-3d] [-arrow] [-diag] [-banner]
  68.     [-banstyle <phrase|line|letter|char:?>] [-check] [-matrix] [-strip]
  69.     [-spook] [-scramble] [-mirror] [-rotate] [-rev] [-leet] [-hug] [-flip]
  70.     [-fake] [-ircii] [-jigs] [-tree] [-popeye] [-sine] [-chalk]
  71.     [-throttle <ms>] [-repeat <#>] [-rainbow <map>] [-skew <#>] [-msg <nick>]
  72.     [-pre <str>] [-cmd <cmd>] [-smiley <file>]";
  73.  
  74. sub process {
  75.  
  76.  
  77. my @args = split(' ', shift(@_));
  78. my $flags;
  79. my $text; my $repeat; my @text; my $style; my $map; my  $skew; my $sendto;  my $force; my $smilefile;
  80.  
  81. while(@args) {
  82.  
  83.         my $arg = shift(@args); last if (!defined $arg);
  84.         if ($arg =~ /^-msg/)      { $sendto = shift(@args); next }
  85.         if ($arg =~ /^-pre/)      { $prefix = shift(@args); next }
  86.         if ($arg =~ /^-cmd/)      { $cmd    = shift(@args); next }
  87.         if ($arg =~ /^-blink/)    { $flags .= "b"; next }
  88.         if ($arg =~ /^-jive/)     { $flags .= "j"; next }
  89.         if ($arg =~ /^-exec/)     { $flags .= "e"; next }
  90.         if ($arg =~ /^-cowfile/)  { $cowfile = shift(@args); next }
  91.         if ($arg =~ /^-cow/)      { $flags .= "c"; next }
  92.         if ($arg =~ /^-fig/)      { $flags .= "f"; next }
  93.         if ($arg =~ /^-font/)     { $figfont = shift(@args); next }
  94.         if ($arg =~ /^-banstyle/) { $banstyle = shift(@args); next }
  95.         if ($arg =~ /^-utf8/)     { $flags .= "8"; next }
  96.         if ($arg =~ /^-box/)      { $flags .= "o"; next }
  97.         if ($arg =~ /^-3d/)       { $flags .= "3"; next }
  98.         if ($arg =~ /^-arrow/)    { $flags .= "a"; next }
  99.         if ($arg =~ /^-diag/)     { $flags .= "D"; next }
  100.         if ($arg =~ /^-banner/)   { $flags .= "B"; next }
  101.         if ($arg =~ /^-check/)    { $flags .= "C"; next }
  102.         if ($arg =~ /^-capchk/)   { $flags .= "h"; next }
  103.         if ($arg =~ /^-matrix/)   { $flags .= "m"; next }
  104.         if ($arg =~ /^-strip/)    { $flags .= "n"; next }
  105.         if ($arg =~ /^-spook/)    { $flags .= "s"; next }
  106.         if ($arg =~ /^-scramble/) { $flags .= "S"; next }
  107.         if ($arg =~ /^-mirror/)   { $flags .= "M"; next }
  108.         if ($arg =~ /^-rotate/)   { $flags .= "4"; next }
  109.         if ($arg =~ /^-rev/)      { $flags .= "R"; next }
  110.         if ($arg =~ /^-leet/)     { $flags .= "l"; next }
  111.         if ($arg =~ /^-hug/)      { $flags .= "H"; next }
  112.         if ($arg =~ /^-flip/)     { $flags .= "F"; next }
  113.         if ($arg =~ /^-fake/)     { $flags .= "I"; next }
  114.         if ($arg =~ /^-ircii/)    { $flags .= "d"; next }
  115.         if ($arg =~ /^-jigs/)     { $flags .= "J"; next }
  116.         if ($arg =~ /^-tree/)     { $flags .= "t"; next }
  117.         if ($arg =~ /^-think/)    { $flags .= "T"; next }
  118.         if ($arg =~ /^-unused/)   { $flags .= "u"; next }
  119.         if ($arg =~ /^-popeye/)   { $flags .= "p"; next }
  120.         if ($arg =~ /^-sine/)     { $flags .= "w"; next }
  121.         if ($arg =~ /^-wave/)     { $flags .= "w"; next } # bck compat
  122.         if ($arg =~ /^-YES/i)     { $force = 1; next    }
  123.         if ($arg =~ /^-chalk/i)   { $flags .= "P"; next }
  124.         if ($arg =~ /^-thro/)     { $throttle = shift(@args); next }
  125.         if ($arg =~ /^-repeat/)   { $repeat   = shift(@args); next }
  126.         if ($arg =~ /^-rain/)     { $map = shift(@args); $flags .= 'r'; next }
  127.         if ($arg =~ /^-help/)      { IRC::print($USAGE); return 1; next }
  128.         if ($arg =~ /^-usage/)      { IRC::print($USAGE);return 1;  next }
  129.         if ($arg =~ /^-skew/)     { $skew = shift(@args); next }
  130.         if ($arg =~ /^-smiley/)   { $flags .= "E";   $smilefile = shift(@args); next }
  131.         # this is getting trickier
  132.         if ($arg =~ /^-(\d+)$/) {
  133.             $flags .= "r";
  134.             if    ($1 == 1) { $style = 'rainbow' }
  135.             elsif ($1 == 2) { $style = 'usa' }
  136.             elsif ($1 == 3) { $style = 'random' }
  137.             elsif ($1 == 4) { $style = 'randcol' }
  138.             elsif ($1 == 5) { $style = 'grey' }
  139.             elsif ($1 == 6) { $style = 'scale' }
  140.             elsif ($1 == 7) { $style = 'xmas' }
  141.             elsif ($1 == 8) { $style = 'canada' }
  142.             next;
  143.         } elsif ($arg =~ /^-4(\w+)$/) {
  144.             $flags .= "r";
  145.             $style = $1;
  146.             next;
  147.         }
  148.  
  149.         # doesn't match arguments, must be text!
  150.         push(@text, $arg);
  151.     }
  152.     $text = join(" ", @text);
  153.     $text =~ s/\\n/\n/sg;
  154.  
  155.  
  156.  
  157.     ########################################
  158.     # sanity check before applying filters #
  159.     ########################################
  160.    
  161.     if ($flags =~ /c/ and $flags =~ /T/) {
  162.         cprint("This cow cannot THINK and SPEAK at the same time.");
  163.         return;
  164.     }
  165.  
  166.     if ($flags =~ /c/) { $thoughts = "\\" }
  167.     if ($flags =~ /T/) { $thoughts = "o"  }
  168.    
  169.     # this stuff tries to protect you from yourself
  170.     # .. using -YES will skip this
  171.     unless ($force) {
  172.         if ($flags =~ /h/ and $flags =~ /M/) {
  173.             cprint("Combining -capchk and -mirror is bad, mkay (try -YES)");
  174.             return;
  175.         }
  176.  
  177.         if ($flags =~ /s/ and $flags =~ /f/) {
  178.             cprint("Spook and figlet is probably a bad idea (see: -YES)");
  179.             return;
  180.         }
  181.     }
  182.  
  183.     # for outlining, precedence must be set
  184.     # 3dbox > arrow > box
  185.     $flags =~ s/(o|a)//g if $flags =~ /3/;
  186.     $flags =~ s/o//g     if $flags =~ /a/;
  187.  
  188.     # check should override rainbow for now
  189.     $flags =~ s/r//g if $flags =~ /C/;
  190.  
  191.     # ... so should capchk, unless it's a cow, in which case
  192.     # we invoke cowcut-fu
  193.     #my $cowcut = 0;
  194.     #if ($flags =~ /h/) {
  195.     #   # yes, capchk was specified
  196.     #   if ($flags =~ /c/ and $flags =~ /r/) {
  197.     #       $cowcut = 1;
  198.     #   } else {
  199.     #       $flags =~ s/r//g;
  200.     #   }
  201.     #}
  202.  
  203.     # capchk takes precedence over check
  204.     $flags =~ s/C//g if $flags =~ /h/;
  205.  
  206.     # the TREE cannot be colored
  207.     $flags =~ s/r//g if $flags =~ /t/;
  208.     # the smiley cannot be colored
  209.     $flags =~ s/r//g if $flags =~ /E/;
  210.  
  211.    
  212.  
  213.     if (defined $repeat) {
  214.         $repeat =~ s/[^0-9]//g;
  215.         if ($repeat > 1) {
  216.             $text = $text x $repeat;
  217.         }
  218.     }
  219.  
  220.  
  221.     ##############################
  222.     # filter text based on flags #
  223.     ##############################
  224.    
  225.     my $flag_list = "348BCDFHIJMRSTabcdefhjlmnoprstuvwxPE";
  226.  
  227.     # flag sanity check.  because there are a lot of flags,
  228.     # require master list to contain all viable flags
  229.     if ($flag_list =~ /(.).*\1/) {
  230.         cprint("There was an internal error with flag processing: duplicate ($1)");
  231.         return;
  232.     }
  233.  
  234.     foreach my $f (split(//, $flags)) {
  235.         if ($flag_list !~ /$f/) {
  236.             cprint("There was an internal error with flag processing: missing ($f)");
  237.             return;
  238.         }
  239.     }
  240.  
  241.     # validate utf8 support, only works in 5.8+
  242.     my $utf8 = ($flags =~ /8/ && $] >= 5.008);
  243.  
  244.     # most useful command yet
  245.     if ($flags =~ /u/) {
  246.         cprint("Sorry, the -unused flag is unsupported.");
  247.         return;
  248.     }
  249.    
  250.     # where to get text
  251.     #if $flags =~ /v/;
  252.     #$text = shift
  253.     $text = execute($text)           if $flags =~ /e/;
  254.     $text = slurp($text, $utf8)      if $flags =~ /x/;
  255.     $text = spookify($text)          if $flags =~ /s/;
  256.  
  257.     # change the text contents itself
  258.     $text = jive($text)              if $flags =~ /j/;
  259.     $text = scramble($text)          if $flags =~ /S/;
  260.     $text = leet($text)              if $flags =~ /l/;
  261.     $text = reverse_ascii($text)     if $flags =~ /R/;
  262.     $text = jigs($text)              if $flags =~ /J/;
  263.  
  264.     # change the text appearance
  265.     $text = sine($text)              if $flags =~ /w/;
  266.     $text = diagonal($text)          if $flags =~ /D/;
  267.     $text = popeye($text)            if $flags =~ /p/;
  268.     $text = matrix($text)            if $flags =~ /m/;
  269.     $text = figlet($text, $figfont)  if $flags =~ /f/;
  270.     $text = banner($text, $banstyle) if $flags =~ /B/;
  271.     $text = hug($text)               if $flags =~ /H/;
  272.     $text = rotate($text)            if $flags =~ /4/;
  273.     $text = gwrap($text)             if $flags !~ /[f4]/;
  274.     $text = chalkboard($text)        if $flags =~ /P/;
  275.  
  276.     # change the text presentation
  277.     $text = checker($text)                    if $flags =~ /h/;
  278.     $text = reverse_ascii($text)              if $flags =~ /M/;
  279.     $text = cowsay($text, $cowfile, $cowcut)  if $flags =~ /(c|T)/;
  280.     $text = reverse_ascii($text)              if $flags =~ /M/ and $flags =~ /(c|T)/;
  281.     $text = upside_down($text)                if $flags =~ /F/;
  282.     $text = checker($text)                    if $flags =~ /C/;
  283.  
  284.     # draw a box, pass a style flag
  285.     $text = outline($text, 0)                 if $flags =~ /o/;
  286.     $text = outline($text, 1)                 if $flags =~ /3/;
  287.     $text = outline($text, 2)                 if $flags =~ /a/;
  288.  
  289.     # change the final products visual appearance
  290.     $text = rainbow($text, $style, $map, $skew)   if $flags =~ /r/;
  291.     $text = tree($text)              if $flags =~ /t/;
  292.     $text = blink($text)             if $flags =~ /b/;
  293.  
  294.     # stuff to bust ircii :D
  295.     $text = ircii_fake($text) if $flags =~ /I/;
  296.     $text = ircii_drop($text) if $flags =~ /d/;
  297.     $text = smiley($smilefile) if $flags =~ /E/;
  298.     $text = prefix($text, $prefix) if $prefix;
  299.     $text = strip($text) if $flags =~ /n/;
  300.  
  301.     ########################
  302.     # output final product #
  303.     ########################
  304.  
  305.     # don't go the final mile if a filter returned an error
  306.     #return unless (defined $text && (length($text) >= 1));
  307.  
  308.     # html needs to be handled with kids gloves
  309.      
  310. if(!defined $sendto){
  311.    
  312. cprint($text);
  313. }
  314. else{
  315.  
  316. cprintmsg($text, $sendto);
  317. }
  318.  
  319. return 1;
  320. }
  321.  
  322.  
  323.  
  324. sub cprintmsg {
  325.        
  326. my ($text, $sendto) = @_;
  327. @t = split(/\n/, $text);
  328. IRC::print $sendto;
  329. my $tline; # = shift(@t);
  330.  
  331. if(!@t){
  332. IRC::command("/msg $sendto $text");}
  333.    else{
  334.  
  335.  
  336.     while(@t){
  337.         $tline = shift(@t);
  338.         IRC::command("/msg $sendto $tline");
  339.        
  340.         #$tline = shift(@t);
  341.         }
  342.     }
  343.  
  344.  
  345. }
  346.  
  347. sub cprint {
  348.     #my $text = shift;
  349.     #$text =~ s/\n//g;
  350.     #IRC::command("/say $text");
  351.         #Xchat::print($text);
  352. my $text = shift;
  353. @t = split(/\n/, $text);
  354.  
  355. my $tline; # = shift(@t);
  356.  
  357. if(!@t){
  358. IRC::command("/say $text");}
  359.    else{
  360.  
  361.  
  362.     while(@t){
  363.         $tline = shift(@t);
  364.         IRC::command("/say $tline");
  365.         if ($throttle) {
  366. my $start = time();
  367. my $current = time() - $start;
  368.         IRC::print  $start;
  369. IRC::print  $current;
  370. #while ($current < $throttle){
  371. #$current = time() - $start;
  372. #};
  373.                     #sleep($throttle);  #locks xchat
  374.                 }
  375.         #$tline = shift(@t);
  376.         }
  377.     }
  378. }
  379.  
  380. my $settings = {
  381.     cowfile         => "default",
  382.     cowpath         => undef,
  383.     figfont         => "standard",
  384.     linewrap        => 70,
  385.     rainbow_offset      => 0,
  386.     rainbow_keepstate   => 1,
  387.     keepstate_file      => $ENV{HOME} . "/.gay-state",
  388.     default_style       => 1,
  389.     check_size      => 3,
  390.     check_text      => 0,
  391.     check_colors        => "4,2",
  392.     matrix_size     => 6,
  393.     matrix_spacing      => 2,
  394.     colcat_max      => 2048,
  395.     jive_cmd        => "jive",
  396.     spook_words     => 6,
  397.     hug_size        => 5,
  398.     sine_height     => 5,
  399.     sine_frequency      => "0.3",
  400.     sine_background     => " ",
  401.     banner_style        => "phrase",
  402. };
  403.  
  404. # wrap settings routines.. irssi cares about type
  405. # perl doesn't.. go figure
  406. sub settings_get_str {
  407.     my $key = shift;
  408.     if ($CONTEXT eq 'irssi') {
  409.         return Irssi::settings_get_str($key);
  410.     } else {
  411.         return $settings->{$key};
  412.     }
  413. }
  414.  
  415. sub settings_get_int {
  416.     my $key = shift;
  417.     if ($CONTEXT eq 'irssi') {
  418.         return Irssi::settings_get_int($key);
  419.     } else {
  420.         return $settings->{$key};
  421.     }
  422. }
  423.  
  424. sub settings_get_bool {
  425.     my $key = shift;
  426.     if ($CONTEXT eq 'irssi') {
  427.         return Irssi::settings_get_bool($key);
  428.     } else {
  429.         return $settings->{$key};
  430.     }
  431. }
  432.  
  433. sub settings_set_int {
  434.     my $key = shift;
  435.     my $val = shift;
  436.     if ($CONTEXT eq 'irssi') {
  437.         Irssi::settings_set_int($key, $val);
  438.     } else {
  439.         $settings->{$key} = $val;
  440.     }
  441. }
  442.  
  443.  
  444.  
  445.  
  446. #######################
  447. # define some globals #
  448. #######################
  449.  
  450. # type of cow variable
  451. my $thoughts;
  452.  
  453. # usage/contact info
  454.  
  455.  
  456.  
  457.  
  458.  
  459. my $blink = "\x1b[5m";
  460.  
  461. my $ansi_map = {
  462.     0 => 'white',
  463.     1 => 'black',
  464.     2 => 'blue',
  465.     3 => 'green',
  466.     4 => 'bold red',
  467.     5 => 'red',
  468.     6 => 'magenta',
  469.     7 => 'yellow',
  470.     8 => 'bold yellow',
  471.     9 => 'bold green',
  472.     10 => 'cyan',
  473.     11 => 'bold cyan',
  474.     12 => 'bold blue',
  475.     13 => 'bold magenta',
  476.     14 => 'bold black',
  477.     15 => 'bold white',
  478. };
  479.  
  480.  
  481.  
  482.  
  483.  
  484. my $colorCodeMap = {
  485.     r => 5,
  486.     o => 4,
  487.     y => 7,
  488.     Y => 8,
  489.     g => 3,
  490.     G => 9,
  491.     c => 10,
  492.     C => 11,
  493.     b => 2,
  494.     B => 12,
  495.     m => 6,
  496.     M => 13,
  497.     0 => 1,
  498.     1 => 14,
  499.     2 => 15,
  500.     w => 0,
  501. };
  502.  
  503.  
  504.  
  505.  
  506. my $has_color = 0;
  507. my $prev_fg_color;
  508. my $prev_bg_color;
  509.  
  510. sub do_color {
  511.     my $text = shift;
  512.     my $fg_col = shift;
  513.     my $bg_col = shift;
  514.     my $format = shift || 'mirc';
  515.  
  516.     if ($format eq 'code') {
  517.         $fg_col = $colorCodeMap->{$fg_col} if defined $fg_col;
  518.         $bg_col = $colorCodeMap->{$bg_col} if defined $bg_col;
  519.     }
  520.  
  521.     $has_color = 1;
  522.  
  523.  
  524.  
  525.    
  526.    
  527.         my $ret = "\003$fg_col";
  528.  
  529.         if (defined $bg_col) {
  530.             $ret .= ",$bg_col";
  531.         }
  532.        
  533.         # if first char is a , or number,
  534.         # we need some esc char's so the color thingy
  535.         # doesn't get confused
  536.         my $ord = ord(substr($text, 0, 1));
  537.         if (($ord >= 48 and $ord <= 57) or $ord == 44) {
  538.             $ret .= "\26\26";
  539.         }
  540.  
  541.         # mIRC remove formatting character
  542.         #return ($ret . $text . "\x0F");
  543.       return ($ret . $text );
  544.        
  545.  
  546.  
  547.     #return ($text);
  548. }
  549.  
  550. sub show_colmap {
  551.     foreach my $color (sort { $a <=> $b } keys %$ansi_map) {
  552.         my $color_name = $ansi_map->{$color};
  553.         my $msg = sprintf("%2d: %s\n", $color, $color_name);
  554.         my $bg = ($color == 1) ? 0 : undef; # use white background for black
  555.         cprint(do_color($msg, $color, $bg));
  556.     }
  557. }
  558.  
  559.  
  560. # spook array.. in a perfect world this would
  561. # be in its own file.  this is stolen right out of emacs,
  562. # with some more modern stuff tacked on
  563.  
  564. my @spook_lines = (
  565.     "\$400 million in gold bullion",
  566.     "[Hello to all my fans in domestic surveillance]", "AK-47",
  567.     "ammunition", "arrangements", "assassination", "BATF", "bomb", "CIA",
  568.     "class struggle", "Clinton", "Cocaine", "colonel",
  569.     "counter-intelligence", "cracking", "Croatian", "cryptographic",
  570.     "Delta Force", "DES", "domestic disruption", "explosion", "FBI", "FSF",
  571.     "fissionable", "Ft. Bragg", "Ft. Meade", "genetic", "Honduras",
  572.     "jihad", "Kennedy", "KGB", "Khaddafi", "kibo", "Legion of Doom",
  573.     "Marxist", "Mossad", "munitions", "Nazi", "Noriega", "North Korea",
  574.     "NORAD", "NSA", "nuclear", "Ortega", "Panama", "Peking", "PLO",
  575.     "plutonium", "Qaddafi", "quiche", "radar", "Rule Psix",
  576.     "Saddam Hussein", "SDI", "SEAL Team 6", "security", "Semtex",
  577.     "Serbian", "smuggle", "South Africa", "Soviet ", "spy", "strategic",
  578.     "supercomputer", "terrorist", "Treasury", "Uzi", "Waco, Texas",
  579.     "World Trade Center", "Liberals", "Cheney",
  580.  
  581.     # mine
  582.     "Eggs", "Libya", "Bush", "Kill the president", "GOP", "Republican",
  583.     "Shiite", "Muslim", "Chemical Ali", "Ashcroft", "Terrorism",
  584.     "Al Qaeda", "Al Jazeera", "Hamas", "Israel", "Palestine", "Arabs",
  585.     "Arafat", "Patriot Act", "Voter Fraud", "Punch-cards", "Diebold",
  586.     "conspiracy", "Fallujah", "IndyMedia", "Skull and Bones", "Free Masons",
  587.     "Kerry", "Grass Roots", "9-11", "Rocket Propelled Grenades",
  588.     "Embedded Journalism", "Lockheed-Martin", "war profiteering",
  589.  
  590.  
  591.     # from blogs about the spooks
  592.     "Kill the President", "anarchy", "echelon", "nuclear",
  593.     "assassinate", "Roswell", "Waco", "World Trade Center", "Soros",
  594.     "Whitewater", "Lebed", "HALO", "Spetznaz", "Al Amn al-Askari",
  595.     "Glock 26", "Steak Knife", "Rewson", "SAFE", "Waihopai", "ASPIC",
  596.     "MI6", "Information Security", "Information Warfare", "Privacy",
  597.     "Information Terrorism", "Terrorism", "Defensive Information",
  598.     "Defense Information Warfare", "Offensive Information",
  599.     "Offensive Information Warfare", "Ortega Waco", "assasinate",
  600.     "National Information Infrastructure", "InfoSec",
  601.     "Computer Terrorism", "DefCon V", "Encryption", "Espionage", "NSA",
  602.     "CIA", "FBI", "White House", "Undercover", "Compsec 97", "Europol",
  603.     "Military Intelligence", "Verisign", "Echelon",
  604.     "Ufologico Nazionale", "smuggle", "Bletchley Park", "Clandestine",
  605.     "Counter Terrorism Security", "Enemy of the State", "20755-6000",
  606.     "Electronic Surveillance", "Counterterrorism", "eavesdropping",
  607.     "nailbomb", "Satellite imagery", "subversives", "World Domination",
  608.     "wire transfer", "jihad", "fissionable", "Sayeret Mat'Kal",
  609.     "HERF pipe-bomb", "2.3 Oz.  cocaine", "Yellow Van",
  610. );
  611.  
  612. # leet mapping
  613. my $leet_map = {
  614.     a => [ "4", "/\\", "@", "a", "A" ],
  615.     b => [ "|o", "b", "B" ],
  616.     c => [ "C", "c", "<" ],
  617.     d => [ "d", "D", "|)" ],
  618.     e => [ "e", "E", "3" ],
  619.     f => [ "f", "F", "/=" ],
  620.     g => [ "g", "G", "6" ],
  621.     h => [ "h", "H", "|-|" ],
  622.     i => [ "i", "I", "|", "1" ],
  623.     j => [ "j", "J" ],
  624.     k => [ "keke", "x", "X", "k", "K", "|<" ],
  625.     l => [ "l", "L", "7", "|_" ],
  626.     m => [ "|V|", "|\\/|", "m", "M" ],
  627.     n => [ "n", "N", "|\\|" ],
  628.     o => [ "0", "o", "O", "()", "[]", "<>" ],
  629.     p => [ "p", "P", "9" ],
  630.     q => [ "q", "Q" ],
  631.     r => [ "r", "R" ],
  632.     s => [ "s", "S", "5" ],
  633.     t => [ "t", "T", "7" ],
  634.     u => [ "|_|", "u", "U", "\\/" ],
  635.     v => [ "v", "V", "\\/" ],
  636.     w => [ "w", "W", "uu", "UU", "uU", "Uu", "\\/\\/" ],
  637.     x => [ "x", "X", "><" ],
  638.     y => [ "y", "Y" ],
  639.     z => [ "z", "Z", "5" ],
  640. };
  641.  
  642. # 'jigs' mapping
  643. my $jigs_map = {
  644.     7   => "8",
  645.     8   => "9",
  646.     9   => "0",
  647.     0   => "-",
  648.     '-' => "=",
  649.     '=' => "7",
  650.     y   => "u",
  651.     h   => "j",
  652.     n   => "m",
  653.     u   => "i",
  654.     j   => "k",
  655.     m   => ".",
  656.     i   => "o",
  657.     k   => "l",
  658.     "," => ".",
  659.     o   => "p",
  660.     l   => ";",
  661.     "." => "/",
  662.     p   => "[",
  663.     ";" => "'",
  664.     "/" => "n",
  665.     "[" => "]",
  666.     "]" => '\\',
  667.     '"' => "h",
  668.     '\\'    => "u",
  669. };
  670.  
  671. my @bash_map = (
  672.     "a",
  673.     "d",
  674.     "D{[^{]*}",
  675.     "e",
  676.     "h",
  677.     "H",
  678.     "j",
  679.     "l",
  680.     "n",
  681.     "r",
  682.     "s",
  683.     "t",
  684.     "T",
  685.     "@",
  686.     "A",
  687.     "u",
  688.     "v",
  689.     "V",
  690.     "w",
  691.     "W",
  692.     "!",
  693.     "#",
  694.     "\\\$",
  695.     "\\d{1,3}",
  696.     "\\\\",
  697.     "\\[",
  698.     "\\]",
  699. );
  700.  
  701.  
  702. # random text for text substitution
  703. # needless to say if someone has this string
  704. # in their text, it'll get clobbered.
  705. my $rnd = "rAnDoM";
  706.  
  707. # markup stuff
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714. ###########
  715. # FILTERS #
  716. ###########
  717.  
  718. sub prefix {
  719.     my ($text, $prefix) = @_;
  720.     return if (!defined $text || !defined $prefix);
  721.  
  722.     my @new;
  723.     foreach my $line (split(/\n/, $text)) {
  724.         $line = "$prefix $line";
  725.         push(@new, $line);
  726.     }
  727.     $text = join("\n", @new);
  728.  
  729.     return $text;
  730. }
  731.  
  732. my $COWPATH;
  733. sub find_cowpath {
  734.     $COWPATH = $ENV{COWPATH} || "";
  735.     return if -d $COWPATH;
  736.  
  737.     $COWPATH = settings_get_str("cowpath") || "";
  738.     return if -d $COWPATH;
  739.  
  740.     my $cowsay_cmd = whereis("cowsay");
  741.     if ($cowsay_cmd) {
  742.         if (open(IN, "< $cowsay_cmd")) {
  743.             while (my $line = <IN>) {
  744.                 if ($line =~ m!^\$cowpath = \$ENV\{'COWPATH'\} \|\| '(.*?)';!) {
  745.                     $COWPATH = $1;
  746.                     last;
  747.                 }
  748.             }
  749.             close IN;
  750.         }
  751.     }
  752.  
  753.     $COWPATH ||= "";
  754.  
  755.     return if -d $COWPATH;
  756.  
  757.     $COWPATH = undef;
  758.     cprint("I could not figure out your COWPATH!!");
  759. }
  760.  
  761. sub cowsay {
  762.     # my cowsay implementation.. because normal cowsay
  763.     # messes up bubble-size if you have imbedded
  764.     # color codes.. this works pretty much the same,
  765.     # except it doesn't have support for stuff like
  766.     # tongue and eyes.
  767.  
  768.     my $text = shift;
  769.     return if (!defined $text);
  770.  
  771.     my $cowfile = shift || "default";
  772.     my $cowcut = shift;
  773.  
  774.     # my mother tried to find my cowpath once.. once.
  775.     unless ($COWPATH) { find_cowpath() }
  776.  
  777.     unless ($COWPATH) {
  778.         cprint("I cannot continue with cowsay, for there is no COWPATH!");
  779.         return $text;
  780.     }
  781.  
  782.     my @output;
  783.  
  784.     # this is the whole point of doing my own cowsay
  785.     my $length = 0;
  786.     my @text = split(/\n/, $text);
  787.     foreach my $line (@text) {
  788.         my $l = clean_length($line);
  789.         $length = $l if $l > $length;
  790.     }
  791.  
  792.     # add filler to the end
  793.     foreach my $line (@text) {
  794.         $line .= (" " x ($length - clean_length($line)));
  795.     }
  796.  
  797.     my $div = " " . ("-" x ($length+2));
  798.     push(@output, $div);
  799.     push(@output, $COWCUT) if $cowcut;
  800.     my $count = 0;
  801.     my $total = scalar(@text) - 1;
  802.     foreach my $line (@text) {
  803.         if ($total == 0) {
  804.             push(@output, "< $line >");
  805.         } elsif ($count == 0) {
  806.             push(@output, "/ $line \\");
  807.         } elsif ($count == $total) {
  808.             push(@output, "\\ $line /");
  809.         } else {
  810.             push(@output, "| $line |");
  811.         }
  812.         $count++;
  813.     }
  814.    
  815.     # this is rainbow() markup for toggling colorize
  816.     push(@output, $COWCUT) if $cowcut;
  817.     push(@output, $div);
  818.  
  819.     if ($cowfile =~ /^<rand(om)?>$/i) {
  820.         my @cowfiles;
  821.         foreach my $dir (split(/:/, $COWPATH)) {
  822.             unless (opendir(COWDIR, $dir)) {
  823.                 cprint("failed to open: $dir");
  824.                 return;
  825.             }
  826.  
  827.             push(@cowfiles, grep(/\.cow$/, readdir(COWDIR)));
  828.             close COWDIR;
  829.         }
  830.  
  831.         $cowfile = $cowfiles[rand(@cowfiles)];
  832.     }
  833.  
  834.     my $full;
  835.     $cowfile .= ".cow" unless ($cowfile =~ /\.cow$/);
  836.     if ($cowfile =~ m!/!) {
  837.         $full = $cowfile;
  838.     } else {
  839.         foreach my $path (split(/:/, $COWPATH)) {
  840.             if (-f "$path/$cowfile") {
  841.                 $full = "$path/$cowfile";
  842.                 last;
  843.             }
  844.         }
  845.     }
  846.  
  847.     unless (-f $full) {
  848.         cprint("could not find cowfile: $cowfile");
  849.         return;
  850.     }
  851.  
  852.     my $the_cow = "";
  853.     my $eyes = "oo";
  854.     my $tongue = "  ";
  855.  
  856.     # very odd.. unless $thoughts is addressed in some
  857.     # fasion in this scope, eval doesn't notice it
  858.     # i say this is a perl bug
  859.     $thoughts = $thoughts;
  860.  
  861.  
  862.     unless (open(IN, "<$full")) {
  863.         cprint("couldn't read $full: $!");
  864.         return;
  865.     }
  866.     my $cow_code = join('', <IN>);
  867.     close IN;
  868.  
  869.     eval $cow_code;
  870.  
  871.     push(@output, split(/\n/, $the_cow));
  872.     return join("\n", @output);
  873. }
  874.  
  875.  
  876. sub figlet {
  877.     # pass text through figlet
  878.     my $text = shift;
  879.     return if (!defined $text);
  880.  
  881.     my $figlet_font = shift || 'standard';
  882.     my $figlet_wrap = settings_get_int('linewrap');
  883.  
  884.     if ($figlet_font =~ /random/i) {
  885.         chomp(my $fontdir = run(command => "figlet", args => "-I2"));
  886.  
  887.         if (opendir(FONTDIR, $fontdir)) {
  888.             my @fonts = grep(s/\.flf$//, readdir(FONTDIR));
  889.             close FONTDIR;
  890.  
  891.             $figlet_font = $fonts[rand(@fonts)];
  892.         } else {
  893.             cprint("could not open $fontdir");
  894.             $figlet_font = "standard";
  895.         }
  896.     }
  897.  
  898.     my $output = run(
  899.         command => "figlet",
  900.         args    => "-f $figlet_font -w $figlet_wrap",
  901.         stdin   => $text,
  902.     ) || return $text;
  903.  
  904.     $output =~ s/^\s+\n//g;     # sometimes it leaves leading blanks too!
  905.     $output =~ s/\n\s+\n$//s;   # figlet leaves a trailing blank line.. sometimes
  906.  
  907.     return $output;
  908. }
  909.  
  910.  
  911.  
  912. sub jive {
  913.     # pass text through jive filter
  914.     my $text = shift;
  915.     return if (!defined $text);
  916.  
  917.     # see if we can find the program
  918.     my $jive_cmd = settings_get_str('jive_cmd');
  919.     $jive_cmd = -x $jive_cmd ? $jive_cmd : whereis("jive");
  920.     unless (-x $jive_cmd) {
  921.         cprint("$jive_cmd not found or not executable!");
  922.         return;
  923.     }
  924.  
  925.     my $pid = open3(
  926.         \*WRITE, \*READ, \*ERR,
  927.         $jive_cmd
  928.     );
  929.  
  930.     print WRITE $text;
  931.     close WRITE;
  932.  
  933.     $text = join('', <READ>);
  934.     close READ;
  935.  
  936.     # check for errors
  937.     cprint_lines(join('', <ERR>));
  938.     close ERR;
  939.  
  940.     waitpid($pid, 0);
  941.  
  942.     return $text;
  943. }
  944.  
  945. sub checker {
  946.     # checker filter.  thanks to uke
  947.     my $text = shift;
  948.     return if (!defined $text);
  949.    
  950.     my $checksize = settings_get_int('check_size');
  951.     my $checktext  = settings_get_int('check_text');
  952.  
  953.     my @colors = split(/\s*,\s*/, settings_get_str("check_colors"));
  954.  
  955.     my $rownum = 0;
  956.     my $offset = 0;
  957.     my @text = split(/\n/, $text);
  958.  
  959.     # what is the longest line?
  960.     my $length = 0;
  961.     foreach my $line (@text) {
  962.         $length = length($line) if length($line) > $length;
  963.     }
  964.  
  965.     foreach my $line (@text) {
  966.         # pad line with whitespace
  967.         $line .= (" " x ($length - length($line)));
  968.  
  969.         my $newline;
  970.         my $state = 0;
  971.         for (my $i = 0; $i < length($line); $i = $i + $checksize) {
  972.             my $chunk = substr($line, $i, $checksize);
  973.             my $index = ($state + $offset); $index -= scalar(@colors) if $index >= scalar(@colors);
  974.  
  975.             # add color
  976.             $newline .= do_color($chunk, $checktext, $colors[$index]);
  977.             $state++; $state = 0 if $state >= scalar(@colors);
  978.         }
  979.  
  980.         $line = $newline;
  981.  
  982.         # increment rowcount/swap offset
  983.         $rownum++;
  984.         if ($rownum == $checksize) {
  985.             $rownum = 0;
  986.             $offset++; $offset = 0 if $offset >= scalar(@colors);
  987.         }
  988.     }
  989.     return join("\n", @text);
  990. }
  991.  
  992. sub get_state {
  993.     my $state;
  994.    
  995.         $state = settings_get_int("rainbow_offset");
  996.    
  997.  
  998.     $state ||= 0;
  999.     return $state;
  1000. }
  1001.  
  1002. sub set_state {
  1003.     my $state = shift;
  1004.    
  1005.         settings_set_int("rainbow_offset", $state);
  1006.    
  1007. }
  1008.  
  1009. # New way of doing it
  1010. my $rainbowMap = {
  1011.     rainbow => 'rrooyyYYGGggccCCBBbbmmMM',  # -1
  1012.     usa => 'oowwBB',            # -2
  1013.     blue    => 'bB',            # -4blue
  1014.     green   => 'gG',            # -4green
  1015.     purple  => 'mM',            # -4purple
  1016.     grey    => '12',            # -4grey (-5)
  1017.     yellow  => 'yY',            # -4yellow
  1018.     red => 'or',            # -4red
  1019.     scale   => 'ww22CC11CC22',      # -6
  1020.     xmas    => 'og',            # -7
  1021.     canada  => 'ooww',          # -8
  1022.    
  1023. };
  1024.  
  1025. sub rainbow {
  1026.     my $text = shift;
  1027.     my $style = shift || 'rainbow';
  1028.     my $map = shift;
  1029.     my $skew = shift || 1;
  1030.  
  1031.     return if !defined $text;
  1032.  
  1033.     my $offset = settings_get_bool('rainbow_keepstate') ? get_state() : 0;
  1034.     $map = $rainbowMap->{$style} if (!defined $map && exists $rainbowMap->{$style});
  1035. #$map = $colorCodeMap;   ########################################
  1036.     return $text if !defined $map;
  1037.  
  1038.     my $colorize = 1;
  1039.     my $output = '';
  1040.     foreach my $line (split(/\r?\n/, $text)) {
  1041.        
  1042.         if (!$colorize % 2) { $output .= "$line\n"; next }
  1043.  
  1044.         my $i = 0;
  1045.         foreach my $char (split('', $line)) {
  1046.             my $color = substr($map, ($offset + $i) % length($map), 1);
  1047.             $output .= do_color($char, $color, undef, 'code');
  1048.             $i++;
  1049.         }
  1050.  
  1051.         $offset += $skew;
  1052.         $output .= "\n";
  1053.     }
  1054.  
  1055.     set_state($offset) if settings_get_bool('rainbow_keepstate');
  1056.     return $output
  1057. }
  1058.  
  1059. sub blink {
  1060.     # make the text blink
  1061.     my $text = shift;
  1062.     return if (!defined $text);
  1063.  
  1064.     my @newtext;
  1065.     foreach my $line (split(/\n/, $text)) {
  1066.         push(@newtext, $blink . $line);
  1067.            
  1068.        
  1069.     }
  1070.     return join("\n", @newtext);
  1071. }
  1072.  
  1073. sub clean_length {
  1074.     my $text = shift;
  1075.     return if (!defined $text);
  1076.  
  1077.     # generic mIRC color syntax
  1078.     $text =~ s/\x03\d{0,2}(,\d{0,2})?//g;
  1079.  
  1080.     # bold ^b, inverse ^v, underline ^_, clear ^O
  1081.     $text =~ s/\x02|\x16|\x1F|\x0F//g;
  1082.  
  1083.     # ansi
  1084.     $text =~ s/\x1b\[\d+(?:,\d+)?m//g;
  1085.  
  1086.     #html
  1087.     $text =~ s/<span[^>]+>//g;
  1088.     $text =~ s/<\/span>//g;
  1089.  
  1090.    
  1091.  
  1092.     return length($text);
  1093. }
  1094.  
  1095.  
  1096. sub matrix {
  1097.     # 0-day greetz to EnCapSulaTE1!11!one
  1098.     my $text = shift;
  1099.     return if (!defined $text);
  1100.  
  1101.     my $size = settings_get_int("matrix_size");
  1102.     my $spacing = settings_get_int("matrix_spacing");
  1103.  
  1104.     $size = 1 if ($size < 1);
  1105.  
  1106.     # first, let's dispense with the newlinesa
  1107.     # because they have no meaning up/down
  1108.     $text =~ s/\n/ /sg;
  1109.  
  1110.     my @text;
  1111.     for (my $i = 0; $i < length($text); $i += $size) {
  1112.         my $chunk = substr($text, $i, $size);
  1113.         for (my $j = 0; $j < length($chunk); $j++) {
  1114.             $text[$j] .= substr($chunk, $j, 1) . (" " x $spacing);
  1115.         }
  1116.     }
  1117.     return join("\n", @text);
  1118. }
  1119.  
  1120. sub outline {
  1121.     # draw a box around text.. thanks 2 twid
  1122.     # for the idea
  1123.     my $text = shift;
  1124.     return if (!defined $text);
  1125.    
  1126.     my $style = shift;
  1127.     my ($_3d, $_arrow);
  1128.  
  1129.     if ($style == 1) {
  1130.         $_3d = 1;
  1131.     } elsif ($style == 2) {
  1132.         # arrow-style, thanks to rob
  1133.         $_arrow = 1;
  1134.     }
  1135.    
  1136.     my @text = split(/\n/, $text);
  1137.  
  1138.     # what is the longest line
  1139.     my $length = 0;
  1140.    
  1141.     foreach my $line (@text) {
  1142.         $length = clean_length($line) if clean_length($line) > $length;
  1143.     }
  1144.  
  1145.     # add box around each line
  1146.     my $lc = "|"; my $rc = "|";
  1147.     if ($_arrow) { $lc = ">"; $rc = "<" }
  1148.     foreach my $line (@text) {
  1149.         $line = "$lc $line" . (" " x ($length - clean_length($line) + 1)) . "$rc";
  1150.         $line .= " |" if ($_3d);
  1151.     }
  1152.  
  1153.     # top/bottom frame
  1154.     my ($top_frame, $bottom_frame);
  1155.     if ($_arrow) {
  1156.         $top_frame = "\\" . ("^" x ($length + 2)) . "/";
  1157.         $bottom_frame = "/" . ("^" x ($length + 2)) . "\\";
  1158.     } else {
  1159.         $top_frame = "+" . ("-" x ($length + 2)) . "+";
  1160.         $bottom_frame = $top_frame;
  1161.     }
  1162.  
  1163.  
  1164.     if ($_3d) {
  1165.         push(@text, $bottom_frame . "/");
  1166.         unshift(@text, $top_frame . " |");
  1167.     } else {
  1168.         push(@text, $bottom_frame);
  1169.         unshift(@text, $top_frame);
  1170.     }
  1171.  
  1172.     if ($_3d) {
  1173.         unshift(@text, " /" . (" " x ($length + 2)) . "/|");
  1174.         unshift(@text, "  " . ("_" x ($length + 3)));
  1175.     }
  1176.  
  1177.  
  1178.     return join("\n", @text);
  1179. }
  1180.  
  1181.  
  1182.  
  1183. sub slurp {
  1184.     # read in a file with max setting (useful for catting /dev/urandom :D )
  1185.     # maybe make this read in chunks, not by line, or something.. seems clumsy
  1186.     my $file = shift || return;
  1187.     my $utf8 = shift;
  1188.  
  1189.     # expand ~
  1190.     $file =~ s!^~([^/]*)!$1 ? (getpwnam($1))[7] : ($ENV{HOME} || $ENV{LOGDIR} || (getpwuid($>))[7])!ex;
  1191.  
  1192.     {
  1193.         my $result;
  1194.         if ($utf8) { eval '$result = open(IN, "<:utf8", "$file");' }
  1195.         else { $result = open(IN, "<$file"); }
  1196.         unless ($result) {
  1197.             cprint("could not open $file: $!");
  1198.             return;
  1199.         }
  1200.     }
  1201.  
  1202.     my $max = settings_get_int("colcat_max");
  1203.     my $text;
  1204.     while (my $line = <IN>) {
  1205.         $text .= $line;
  1206.         last if length($text) >= $max;
  1207.     }
  1208.     close IN;
  1209.  
  1210.     return $text;
  1211. }
  1212.  
  1213.  
  1214.  
  1215.  
  1216.  
  1217.  
  1218.  
  1219. sub draw_box {
  1220.     # taken from a busted script distributed with irssi
  1221.     # just a simple ascii line-art around help text
  1222.     my ($title, $text, $footer, $color) = @_;
  1223.  
  1224.    
  1225.  
  1226.     $footer = $title unless($footer);
  1227.     my $box;
  1228.     $box .= '%R,--[%n%9%U' . $title . '%U%9%R]%n' . "\n";
  1229.     foreach my $line (split(/\n/, $text)) {
  1230.         $box .= '%R|%n ' . $line . "\n";
  1231.     }
  1232.     $box .= '%R`--<%n' . $footer . '%R>->%n';
  1233.     $box =~ s/%.//g unless $color;
  1234.     return $box;
  1235. }
  1236.  
  1237.  
  1238.  
  1239.  
  1240. sub spookify {
  1241.     # add emacs spook text.  if there is previously existing text, it appends
  1242.     my $text = shift;
  1243.     my $count = settings_get_int('spook_words') || return $text;
  1244.     my @spook_words;
  1245.     for (my $i = 0; $i < $count; $i++) {
  1246.         my $word = $spook_lines[int(rand(0) * scalar(@spook_lines))];
  1247.         push(@spook_words, $word);
  1248.     }
  1249.     $text = join(" ", @spook_words) . " $text";
  1250.     return $text;
  1251. }
  1252.  
  1253. sub gwrap {
  1254.     # fix that shit
  1255.     my $text = shift;
  1256.     return if (!defined $text);
  1257.  
  1258.     my $wrap =  return $text;
  1259.     $Text::Wrap::columns = $wrap;
  1260.     my @output;
  1261.     foreach my $line (split(/\n/, $text)) {
  1262.         local $^W = undef; # silence spurious warnings
  1263.         if (length($line) > $wrap) {
  1264.             ($line) = Text::Wrap::wrap(undef, undef, $line);
  1265.         }
  1266.         $line =~ s/\t/     /g;
  1267.         push(@output, $line);
  1268.     }
  1269.  
  1270.     $text = join("\n", @output);
  1271.     return $text;
  1272. }
  1273.  
  1274. sub leet {
  1275.     # leet speak :(
  1276.     my $text = shift;
  1277.     return if (!defined $text);
  1278.  
  1279.     my @output;
  1280.     foreach my $line (split(/\n/, $text)) {
  1281.         my $newline;
  1282.         for (my $i = 0; $i < length($line); $i++) {
  1283.             my $char = lc(substr($line, $i, 1));
  1284.             if ($leet_map->{$char}) {
  1285.                 my @possibles = @{$leet_map->{$char}};
  1286.                 $char = $possibles[int(rand(0) * scalar(@possibles))];
  1287.             }
  1288.             $newline .= $char;
  1289.         }
  1290.         push(@output, $newline);
  1291.     }
  1292.     return join("\n", @output);
  1293. }
  1294.  
  1295. sub hug {
  1296.     my $text = shift;
  1297.     return if (!defined $text);
  1298.  
  1299.     my @text = split(/\n/, $text);
  1300.     my $size = settings_get_int("hug_size");
  1301.  
  1302.     # what is the longest line
  1303.     my $length = 0;
  1304.     foreach my $line (@text) {
  1305.         $length = clean_length($line) if clean_length($line) > $length;
  1306.     }
  1307.  
  1308.  
  1309.     my @output;
  1310.     foreach my $line (@text) {
  1311.         $line = ("{" x $size) . ' ' . $line . (' ' x ($length - length($line))) . ' ' . ("}" x $size);
  1312.         push(@output, $line);
  1313.     }
  1314.  
  1315.     return join("\n", @output);
  1316. }
  1317.  
  1318. sub reverse_ascii {
  1319.     #####################
  1320.     # reverse ascii art #
  1321.     #####################
  1322.    
  1323.     my $text = shift;
  1324.     return if (!defined $text);
  1325.  
  1326.     my @lines = split(/\n/, $text);
  1327.  
  1328.     # how big is the longest line
  1329.     my $length = 0;
  1330.     foreach my $line (@lines) {
  1331.         my $line_length = clean_length($line);
  1332.         $length = $line_length if ($line_length > $length);
  1333.     }
  1334.  
  1335.     my @output;
  1336.     foreach my $line (@lines) {
  1337.        
  1338.             $line =~ s!/!$rnd!g;  $line =~ s!\\!/!g; $line =~ s!$rnd!\\!g;
  1339.             $line =~ s!{!$rnd!g;  $line =~ s!}!{!g;  $line =~ s!$rnd!}!g;
  1340.             $line =~ s!\(!$rnd!g; $line =~ s!\)!(!g; $line =~ s!$rnd!)!g;
  1341.             $line =~ s!\[!$rnd!g; $line =~ s!\]![!g; $line =~ s!$rnd!]!g;
  1342.             $line =~ s!<!$rnd!g;  $line =~ s!>!<!g;  $line =~ s!$rnd!>!g;
  1343.             push(@output, sprintf("%" . $length . "s", scalar(reverse($line))));
  1344.        
  1345.     }
  1346.  
  1347.     return join("\n", @output);
  1348. }
  1349.  
  1350. sub upside_down {
  1351.     # kind of like reverse_ascii, only on a different axis
  1352.     my $text = shift;
  1353.     return if (!defined $text);
  1354.  
  1355.     my @output;
  1356.     foreach my $line (split(/\n/, $text)) {
  1357.         $line =~ s!/!$rnd!g;  $line =~ s!\\!/!g; $line =~ s!$rnd!\\!g;
  1358.         $line =~ s!v!$rnd!g;  $line =~ s!\^!v!g; $line =~ s!$rnd!^!g;
  1359.         $line =~ s!w!$rnd!g;  $line =~ s!m!w!g;  $line =~ s!$rnd!m!g;
  1360.         $line =~ s!_!-!g;
  1361.         unshift(@output, $line);
  1362.     }
  1363.  
  1364.     return join("\n", @output);
  1365. }
  1366.  
  1367. # irssi is not friendly to require semantic
  1368. # so just use perl's shellwords.pl here
  1369. sub shellwords {
  1370.     my $text = join('', @_);
  1371.     return if (!defined $text);
  1372.  
  1373.     my (@words, $snippet, $field);
  1374.  
  1375.     $text =~ s/^\s+//;
  1376.  
  1377.     # fix deep recursion case (can't escape newline :P)
  1378.     # found by hlprmnky
  1379.     if ($text =~ /(?:[^\\]|^)\x5c$/) {
  1380.         cprint("Unmatched escape");
  1381.         return;
  1382.     }
  1383.  
  1384.     while ($text ne '') {
  1385.         $field = '';
  1386.         for (;;) {
  1387.             if ($text =~ s/^"(([^"\\]|\\.)*)"//) {
  1388.                 ($snippet = $1) =~ s#\\(.)#$1#g;
  1389.             } elsif ($text =~ /^"/) {
  1390.                 cprint("Unmatched double quote");
  1391.                 return;
  1392.             } elsif ($text =~ s/^'(([^'\\]|\\.)*)'//) {
  1393.                 ($snippet = $1) =~ s#\\(.)#$1#g;
  1394.             } elsif ($text =~ /^'/) {
  1395.                 cprint("Unmatched single quote");
  1396.                 return;
  1397.             } elsif ($text =~ s/^\\(.)//) {
  1398.                 $snippet = $1;
  1399.             } elsif ($text =~ s/^([^\s\\'"]+)//) {
  1400.                 $snippet = $1;
  1401.             } else {
  1402.                 $text =~ s/^\s+//;
  1403.                 last;
  1404.             }
  1405.  
  1406.             $field .= $snippet;
  1407.         }
  1408.         push(@words, $field);
  1409.     }
  1410.     return @words;
  1411. }
  1412.  
  1413. sub scramble {
  1414.     # stupid blog meme about mixing up
  1415.     # the inside letters
  1416.     my $text = shift;
  1417.     return if (!defined $text);
  1418.  
  1419.     my @newtext;
  1420.     foreach my $line (split(/\n/, $text)) {
  1421.         my @newline;
  1422.         foreach my $word (split(/\s+/, $line)) {
  1423.             my @letters = split(//, $word);
  1424.             my $first = shift(@letters);
  1425.             my $last = pop(@letters);
  1426.             fisher_yates_shuffle(\@letters) if scalar(@letters) > 0;
  1427.             my $newline = $first . join('', @letters) . $last;
  1428.             push(@newline, $newline);
  1429.         }
  1430.         push(@newtext, join(" ", @newline));
  1431.     }
  1432.  
  1433.     $text = join("\n", @newtext);
  1434.     return $text;
  1435. }
  1436.  
  1437. sub fisher_yates_shuffle {
  1438.     # safe randomizing
  1439.     my $array = shift;
  1440.     my $i;
  1441.     for ($i = @$array; --$i; ) {
  1442.         my $j = int rand ($i+1);
  1443.         next if $i == $j;
  1444.         @$array[$i,$j] = @$array[$j,$i];
  1445.     }
  1446. }
  1447.  
  1448. sub ircii_fake {
  1449.     # some ansi stuff to obscure the <nick>
  1450.     my $text = shift;
  1451.     return if (!defined $text);
  1452.  
  1453.     my @new;
  1454.  
  1455.     foreach my $line (split(/\n/, $text)) {
  1456.         $line = "\x85\x8d$line";
  1457.         push(@new, $line);
  1458.     }
  1459.  
  1460.     $text = join("\n", @new);
  1461.  
  1462.     return $text;
  1463. }
  1464.  
  1465. sub ircii_drop {
  1466.     # this is just evil.  move the cursor somewhere
  1467.     # inconvenient
  1468.    
  1469.     my $text = shift;
  1470.     return if (!defined $text);
  1471.  
  1472.     $text .= ("\x84" x 23);
  1473.  
  1474.     return $text;
  1475. }
  1476.  
  1477. # shift ascii homerow, code by hlprmnky
  1478. # hella copped from leet, above
  1479. sub jigs {
  1480.     my $text = shift;
  1481.     return if (!defined $text);
  1482.  
  1483.     my @output;
  1484.     foreach my $line (split(/\n/, $text)) {
  1485.         my $newline;
  1486.         for (my $i = 0; $i < length($line); $i++) {
  1487.             my $char = lc(substr($line, $i, 1));
  1488.             if ($jigs_map->{$char}) {
  1489.                 $char = $jigs_map->{$char};
  1490.             }
  1491.             $newline .= $char;
  1492.         }
  1493.         push(@output, $newline);
  1494.     }
  1495.     return join("\n", @output);
  1496. }
  1497.  
  1498. #######################
  1499. ### christmas stuff ###
  1500. #######################
  1501.  
  1502. sub tree {
  1503.     # this is the hardest filter i've ever written :(
  1504.     # there must be a more graceful, or at least ideomatic,
  1505.     # way of doing this, but i can't think of it.
  1506.    
  1507.         my $text = shift;
  1508.     return if (!defined $text);
  1509.  
  1510.     # bulbs.. only bright primary colors
  1511.         my @bulbs = (2,4,6,8,12);
  1512.  
  1513.     # don't do this in the loop or you don't get
  1514.     # random numbers
  1515.     srand(time());
  1516.  
  1517.     # cache green
  1518.     my $green = 3;
  1519.  
  1520.     my @output;
  1521.         foreach my $line (split(/\n/, $text)) {
  1522.         # it's gotta be at least 3 chars long to work
  1523.         unless (length($line) > 2) {
  1524.             push(@output, $line);
  1525.             next;
  1526.         }
  1527.  
  1528.         # the inside can't be all whitespace
  1529.         if ($line =~ /^.\s+.$/) {
  1530.             push(@output, $line);
  1531.             next;
  1532.         }
  1533.  
  1534.         # split line into an array of characters
  1535.         my @row = split(//, $line);
  1536.  
  1537.         # determine which points can be changed
  1538.         my @map;
  1539.         for (my $i = 0; $i < scalar(@row); $i++) {
  1540.             my $char = $row[$i];
  1541.  
  1542.             if ($i == 0 or $i == $#row) {
  1543.                 push(@map, 0);
  1544.             } elsif ($char =~ /\s/) {
  1545.                 push(@map, 0);
  1546.             } else {
  1547.                 push(@map, 1);
  1548.             }
  1549.         }
  1550.  
  1551.         # (int(rand(0) * (max - min + 1))) + min
  1552.         my $max = grep(($_ == 1), @map);
  1553.         my $min = 1;
  1554.         my $map_pos = (int(rand(0) * ($max - $min + 1))) + $min;
  1555.  
  1556.  
  1557.         # god this is such a hack...
  1558.         # figure out which part of @map we mean
  1559.         my $count = 0;
  1560.         my $actual;
  1561.         for (my $i = 0; $i < scalar(@map); $i++) {
  1562.             my $map = $map[$i];
  1563.  
  1564.             if ($map == 1) {
  1565.                 $count++;
  1566.             }
  1567.  
  1568.             if ($count == $map_pos) {
  1569.                 $actual = $i;
  1570.                 last;
  1571.             }
  1572.         }
  1573.  
  1574.  
  1575.         my ($head, $bulb, $foot);
  1576.         my $switch = 0;
  1577.         for (my $i = 0; $i < scalar(@row); $i++) {
  1578.             if ($i == $actual) {
  1579.                 my $color = $bulbs[rand(@bulbs)];
  1580.                 $bulb = do_color("*", $color);
  1581.                 $switch++;
  1582.             } elsif ($switch == 0) {
  1583.                 $head .= $row[$i];
  1584.             } elsif ($switch == 1) {
  1585.                 $foot .= $row[$i];
  1586.             }
  1587.         }
  1588.  
  1589.         my $newline = do_color($head, $green) . $bulb . do_color($foot, $green);
  1590.         push(@output, $newline);
  1591.         }
  1592.  
  1593.     $text = join("\n", @output);
  1594.         return $text;
  1595. }
  1596.  
  1597. sub rotate {
  1598.     my $text = shift;
  1599.     return if (!defined $text);
  1600.  
  1601.     my @lines = split(/\r?\n/, $text);
  1602.     my @new;
  1603.     foreach my $line (reverse @lines) {
  1604.         my @cols = reverse split('', $line);
  1605.         for (my $i = 0; $i < @cols; $i++) {
  1606.             $new[$i] .= $cols[$i];
  1607.         }
  1608.     }
  1609.     $text = join("\n", reverse @new);
  1610.     return $text;
  1611. }
  1612.  
  1613. sub diagonal {
  1614.     my $text = shift;
  1615.     return if (!defined $text);
  1616.  
  1617.     my $new;
  1618.     for (my $i = 0; $i < length($text); $i++) {
  1619.         $new .= sprintf "%s%s\n", (" " x $i), substr($text, $i, 1);
  1620.     }
  1621.  
  1622.     return $new;
  1623. }
  1624.  
  1625. sub popeye {
  1626.     my $text = shift;
  1627.     return if (!defined $text);
  1628.  
  1629.     my $spacer = 0;
  1630.     my $new;
  1631.     foreach my $word (split(/\s+/, $text)) {
  1632.         $new    .= (" " x $spacer) . $word . "\n";
  1633.         $spacer += length($word);
  1634.     }
  1635.  
  1636.     return $new;
  1637. }
  1638.  
  1639. sub sine {
  1640.     my $text = shift;
  1641.     return if (!defined $text);
  1642.  
  1643.     my $freq   = settings_get_str("sine_frequency");
  1644.     my $height = settings_get_int("sine_height");
  1645.     my $bg     = settings_get_str("sine_background");
  1646.  
  1647.     $bg ||= " ";
  1648.  
  1649.     return unless ($freq > 0);
  1650.  
  1651.     my @output;
  1652.     my $lineNO = 0;
  1653.     foreach my $line (split(/\n/, $text)) {
  1654.         my @chrs = split(//, $line);
  1655.         my $width  = @chrs * $freq;
  1656.  
  1657.         my $plot = {};
  1658.         my $x = 0;
  1659.         foreach my $chr (@chrs) {
  1660.             my $y = int($height * sin($x)) + $height;
  1661.             $plot->{$x}->{$y} = $chr;
  1662.             $x += $freq;
  1663.         }
  1664.  
  1665.         for (my $y = 0; $y <= $height * 2; $y++) {
  1666.             for (my $x = 0; $x <= $width; $x += $freq) {
  1667.                 if (exists $plot->{$x}->{$y}) {
  1668.                     $output[$lineNO] .= $plot->{$x}->{$y};
  1669.                 } else {
  1670.                     $output[$lineNO] .= $bg;
  1671.                 }
  1672.             }
  1673.  
  1674.             $lineNO++;
  1675.         }
  1676.     }
  1677.  
  1678.     my @cleaned;
  1679.     foreach my $line (@output) {
  1680.         next if $line =~ /^[$bg]+$/;
  1681.         $line =~ s/[$bg]+$//;
  1682.         push(@cleaned, $line);
  1683.     }
  1684.  
  1685.     $text = join("\n", @cleaned);
  1686.  
  1687.     return $text;
  1688. }
  1689.  
  1690. sub banner {
  1691.     my $text  = shift;
  1692.     return if (!defined $text);
  1693.  
  1694.     my $style = shift;
  1695.  
  1696.     my @chrs = split(//, $text);
  1697.     my $iter = 0;
  1698.  
  1699.     my $output;
  1700.     foreach my $chr (@chrs) {
  1701.         $chr =~ s/[\r\n]/ /;
  1702.         my $banner = perlBanner($chr);
  1703.  
  1704.         #next if (!defined $banner); # remove if you don't want to die for unknowns
  1705. while(0){  ##fix for getting it to work in xchat, need to fuck with styles
  1706.         if ($style eq "phrase") {
  1707.             foreach my $bchr (split(//, $banner)) {
  1708.                 if ($bchr =~ s/#/$chr/) {
  1709.                     $iter = 0 if ++$iter >= @chrs;
  1710.                 }
  1711.                 $output .= $bchr;
  1712.             }
  1713.         }
  1714.  
  1715.         elsif ($style eq "line") {
  1716.             foreach my $line (split(/\n/, $banner)) {
  1717.                 if ($line =~ s/#/$chr/g) {
  1718.                     $iter = 0 if ++$iter > (@chrs - 1);
  1719.                 }
  1720.                 $output .= "$line\n";
  1721.             }
  1722.         }
  1723.  
  1724.         elsif ($style eq "letter") {
  1725.             $banner =~ s/#/$chr/g;
  1726.             $output .= $banner;
  1727.         }
  1728.  
  1729.         elsif ($style =~ /char:(.)/) {
  1730.             my $chr = $1;
  1731.             $banner =~ s/#/$chr/g;
  1732.             $output .= $banner;
  1733.         }
  1734. } $output = $banner;  #remove if i get styles working
  1735.     }
  1736.  
  1737.     return $output;
  1738. }
  1739.  
  1740. ####################################
  1741. # port of c banner utility to perl #
  1742. ####################################
  1743.  
  1744. # defaults/constants
  1745. my $MAXMSG = 1024;
  1746. my $DWIDTH = 132;
  1747. my $NCHARS = 128;
  1748. my $NBYTES = 9470; # This really ought to be generated from the array
  1749.  
  1750. # Pointers into data_table for each ASCII char
  1751. my @asc_ptr = (
  1752.  #   0       1       2       3       4       5       6       7   Octal :(
  1753.      0,      0,      0,      0,      0,      0,      0,      0,  #  ^@ 000
  1754.      0,      0,      0,      0,      0,      0,      0,      0,  #  ^H 010
  1755.      0,      0,      0,      0,      0,      0,      0,      0,  #  ^P 020
  1756.      0,      0,      0,      0,      0,      0,      0,      0,  #  ^X 030
  1757.      1,      3,     50,     81,    104,    281,    483,    590,  #     040
  1758.    621,    685,    749,    851,    862,    893,    898,    921,  #   ( 050
  1759.   1019,   1150,   1200,   1419,   1599,   1744,   1934,   2111,  #   0 060
  1760.   2235,   2445,   2622,   2659,   9271,   2708,   9371,   2715,  #   8 070
  1761.   2857,   3072,   3273,   3403,   3560,   3662,   3730,   3785,  #   @ 100
  1762.   3965,   4000,   4015,   4115,   4281,   4314,   4432,   4548,  #   H 110
  1763.   4709,   4790,   4999,   5188,   5397,   5448,   5576,   5710,  #   P 120
  1764.   5892,   6106,   6257,      0,      0,      0,      0,      0,  #   X 130
  1765.     50,   6503,   6642,   6733,   6837,   6930,   7073,   7157,  #   ` 140
  1766.   7380,   7452,   7499,   7584,   7689,   7702,   7797,   7869,  #   h 150
  1767.   7978,   8069,   8160,   8222,   8381,   8442,   8508,   8605,  #   p 160
  1768.   8732,   8888,   9016,      0,      0,      0,      0,      0   #   x 170
  1769. );
  1770.  
  1771. # Table of stuff to print. Format:
  1772. # 128+n -> print current line n times.
  1773. # 64+n  -> this is last byte of char.
  1774. # else, put m chars at position n (where m
  1775. # is the next elt in array) and goto second
  1776. # next element in array.
  1777.  
  1778. # If you add new data, please be sane and add it to the end :<
  1779.  
  1780. my @data_table = (
  1781.   #    0     1     2     3     4     5     6     7     8     9
  1782.      129,  227,  130,   34,    6,   90,   19,  129,   32,   10,  #     0
  1783.       74,   40,  129,   31,   12,   64,   53,  129,   30,   14,  #    10
  1784.       54,   65,  129,   30,   14,   53,   67,  129,   30,   14,  #    20
  1785.       54,   65,  129,   31,   12,   64,   53,  129,   32,   10,  #    30
  1786.       74,   40,  129,   34,    6,   90,   19,  129,  194,  130,  #    40
  1787.       99,    9,  129,   97,   14,  129,   96,   18,  129,   95,  #    50
  1788.       22,  129,   95,   16,  117,    2,  129,   95,   14,  129,  #    60
  1789.       96,   11,  129,   97,    9,  129,   99,    6,  129,  194,  #    70
  1790.      129,   87,    4,  101,    4,  131,   82,   28,  131,   87,  #    80
  1791.        4,  101,    4,  133,   82,   28,  131,   87,    4,  101,  #    90
  1792.        4,  131,  193,  129,   39,    1,   84,   27,  129,   38,  #   100
  1793.        3,   81,   32,  129,   37,    5,   79,   35,  129,   36,  #   110
  1794.        5,   77,   38,  129,   35,    5,   76,   40,  129,   34,  #   120
  1795.        5,   75,   21,  103,   14,  129,   33,    5,   74,   19,  #   130
  1796.      107,   11,  129,   32,    5,   73,   17,  110,    9,  129,  #   140
  1797.       32,    4,   73,   16,  112,    7,  129,   31,    4,   72,  #   150
  1798.       15,  114,    6,  129,   31,    4,   72,   14,  115,    5,  #   160
  1799.      129,   30,    4,   71,   15,  116,    5,  129,   27,   97,  #   170
  1800.      131,   30,    4,   69,   14,  117,    4,  129,   30,    4,  #   180
  1801.       68,   15,  117,    4,  132,   30,    4,   68,   14,  117,  #   190
  1802.        4,  129,   27,   97,  131,   30,    5,   65,   15,  116,  #   200
  1803.        5,  129,   31,    4,   65,   14,  116,    4,  129,   31,  #   210
  1804.        6,   64,   15,  116,    4,  129,   32,    7,   62,   16,  #   220
  1805.      115,    4,  129,   32,    9,   61,   17,  114,    5,  129,  #   230
  1806.       33,   11,   58,   19,  113,    5,  129,   34,   14,   55,  #   240
  1807.       21,  112,    5,  129,   35,   40,  111,    5,  129,   36,  #   250
  1808.       38,  110,    5,  129,   37,   35,  109,    5,  129,   38,  #   260
  1809.       32,  110,    3,  129,   40,   27,  111,    1,  129,  193,  #   270
  1810.      129,   30,    4,  103,    9,  129,   30,    7,  100,   15,  #   280
  1811.      129,   30,   10,   99,   17,  129,   33,   10,   97,    6,  #   290
  1812.      112,    6,  129,   36,   10,   96,    5,  114,    5,  129,  #   300
  1813.       39,   10,   96,    4,  115,    4,  129,   42,   10,   95,  #   310
  1814.        4,  116,    4,  129,   45,   10,   95,    3,  117,    3,  #   320
  1815.      129,   48,   10,   95,    3,  117,    3,  129,   51,   10,  #   330
  1816.       95,    4,  116,    4,  129,   54,   10,   96,    4,  115,  #   340
  1817.        4,  129,   57,   10,   96,    5,  114,    5,  129,   60,  #   350
  1818.       10,   97,    6,  112,    6,  129,   63,   10,   99,   17,  #   360
  1819.      129,   66,   10,  100,   15,  129,   69,   10,  103,    9,  #   370
  1820.      129,   39,    9,   72,   10,  129,   36,   15,   75,   10,  #   380
  1821.      129,   35,   17,   78,   10,  129,   33,    6,   48,    6,  #   390
  1822.       81,   10,  129,   32,    5,   50,    5,   84,   10,  129,  #   400
  1823.       32,    4,   51,    4,   87,   10,  129,   31,    4,   52,  #   410
  1824.        4,   90,   10,  129,   31,    3,   53,    3,   93,   10,  #   420
  1825.      129,   31,    3,   53,    3,   96,   10,  129,   31,    4,  #   430
  1826.       52,    4,   99,   10,  129,   32,    4,   51,    4,  102,  #   440
  1827.       10,  129,   32,    5,   50,    5,  105,   10,  129,   33,  #   450
  1828.        6,   48,    6,  108,   10,  129,   35,   17,  111,   10,  #   460
  1829.      129,   36,   15,  114,    7,  129,   40,    9,  118,    4,  #   470
  1830.      129,  193,  129,   48,   18,  129,   43,   28,  129,   41,  #   480
  1831.       32,  129,   39,   36,  129,   37,   40,  129,   35,   44,  #   490
  1832.      129,   34,   46,  129,   33,   13,   68,   13,  129,   32,  #   500
  1833.        9,   73,    9,  129,   32,    7,   75,    7,  129,   31,  #   510
  1834.        6,   77,    6,  129,   31,    5,   78,    5,  129,   30,  #   520
  1835.        5,   79,    5,  129,   20,   74,  132,   30,    4,   80,  #   530
  1836.        4,  129,   31,    3,   79,    4,  129,   31,    4,   79,  #   540
  1837.        4,  129,   32,    3,   78,    4,  129,   32,    4,   76,  #   550
  1838.        6,  129,   33,    4,   74,    7,  129,   34,    4,   72,  #   560
  1839.        8,  129,   35,    5,   72,    7,  129,   37,    5,   73,  #   570
  1840.        4,  129,   39,    4,   74,    1,  129,  129,  193,  130,  #   580
  1841.      111,    6,  129,  109,   10,  129,  108,   12,  129,  107,  #   590
  1842.       14,  129,   97,    2,  105,   16,  129,   99,   22,  129,  #   600
  1843.      102,   18,  129,  105,   14,  129,  108,    9,  129,  194,  #   610
  1844.      130,   63,   25,  129,   57,   37,  129,   52,   47,  129,  #   620
  1845.       48,   55,  129,   44,   63,  129,   41,   69,  129,   38,  #   630
  1846.       75,  129,   36,   79,  129,   34,   83,  129,   33,   28,  #   640
  1847.       90,   28,  129,   32,   23,   96,   23,  129,   32,   17,  #   650
  1848.      102,   17,  129,   31,   13,  107,   13,  129,   30,    9,  #   660
  1849.      112,    9,  129,   30,    5,  116,    5,  129,   30,    1,  #   670
  1850.      120,    1,  129,  194,  130,   30,    1,  120,    1,  129,  #   680
  1851.       30,    5,  116,    5,  129,   30,    9,  112,    9,  129,  #   690
  1852.       31,   13,  107,   13,  129,   32,   17,  102,   17,  129,  #   700
  1853.       32,   23,   96,   23,  129,   33,   28,   90,   28,  129,  #   710
  1854.       34,   83,  129,   36,   79,  129,   38,   75,  129,   41,  #   720
  1855.       69,  129,   44,   63,  129,   48,   55,  129,   52,   47,  #   730
  1856.      129,   57,   37,  129,   63,   25,  129,  194,  129,   80,  #   740
  1857.        4,  130,   80,    4,  129,   68,    2,   80,    4,   94,  #   750
  1858.        2,  129,   66,    6,   80,    4,   92,    6,  129,   67,  #   760
  1859.        7,   80,    4,   90,    7,  129,   69,    7,   80,    4,  #   770
  1860.       88,    7,  129,   71,    6,   80,    4,   87,    6,  129,  #   780
  1861.       72,   20,  129,   74,   16,  129,   76,   12,  129,   62,  #   790
  1862.       40,  131,   76,   12,  129,   74,   16,  129,   72,   20,  #   800
  1863.      129,   71,    6,   80,    4,   87,    6,  129,   69,    7,  #   810
  1864.       80,    4,   88,    7,  129,   67,    7,   80,    4,   90,  #   820
  1865.        7,  129,   66,    6,   80,    4,   92,    6,  129,   68,  #   830
  1866.        2,   80,    4,   94,    2,  129,   80,    4,  130,  193,  #   840
  1867.      129,   60,    4,  139,   41,   42,  131,   60,    4,  139,  #   850
  1868.      193,  130,   34,    6,  129,   32,   10,  129,   31,   12,  #   860
  1869.      129,   30,   14,  129,   20,    2,   28,   16,  129,   22,  #   870
  1870.       22,  129,   24,   19,  129,   27,   15,  129,   31,    9,  #   880
  1871.      129,  194,  129,   60,    4,  152,  193,  130,   34,    6,  #   890
  1872.      129,   32,   10,  129,   31,   12,  129,   30,   14,  131,  #   900
  1873.       31,   12,  129,   32,   10,  129,   34,    6,  129,  194,  #   910
  1874.      129,   30,    4,  129,   30,    7,  129,   30,   10,  129,  #   920
  1875.       33,   10,  129,   36,   10,  129,   39,   10,  129,   42,  #   930
  1876.       10,  129,   45,   10,  129,   48,   10,  129,   51,   10,  #   940
  1877.      129,   54,   10,  129,   57,   10,  129,   60,   10,  129,  #   950
  1878.       63,   10,  129,   66,   10,  129,   69,   10,  129,   72,  #   960
  1879.       10,  129,   75,   10,  129,   78,   10,  129,   81,   10,  #   970
  1880.      129,   84,   10,  129,   87,   10,  129,   90,   10,  129,  #   980
  1881.       93,   10,  129,   96,   10,  129,   99,   10,  129,  102,  #   990
  1882.       10,  129,  105,   10,  129,  108,   10,  129,  111,   10,  #  1000
  1883.      129,  114,    7,  129,  117,    4,  129,  193,  129,   60,  #  1010
  1884.       31,  129,   53,   45,  129,   49,   53,  129,   46,   59,  #  1020
  1885.      129,   43,   65,  129,   41,   69,  129,   39,   73,  129,  #  1030
  1886.       37,   77,  129,   36,   79,  129,   35,   15,  101,   15,  #  1040
  1887.      129,   34,   11,  106,   11,  129,   33,    9,  109,    9,  #  1050
  1888.      129,   32,    7,  112,    7,  129,   31,    6,  114,    6,  #  1060
  1889.      129,   31,    5,  115,    5,  129,   30,    5,  116,    5,  #  1070
  1890.      129,   30,    4,  117,    4,  132,   30,    5,  116,    5,  #  1080
  1891.      129,   31,    5,  115,    5,  129,   31,    6,  114,    6,  #  1090
  1892.      129,   32,    7,  112,    7,  129,   33,    9,  109,    9,  #  1100
  1893.      129,   34,   11,  106,   11,  129,   35,   15,  101,   15,  #  1110
  1894.      129,   36,   79,  129,   37,   77,  129,   39,   73,  129,  #  1120
  1895.       41,   69,  129,   43,   65,  129,   46,   59,  129,   49,  #  1130
  1896.       53,  129,   53,   45,  129,   60,   31,  129,  193,  129,  #  1140
  1897.       30,    4,  129,   30,    4,  100,    1,  129,   30,    4,  #  1150
  1898.      100,    3,  129,   30,    4,  100,    5,  129,   30,   76,  #  1160
  1899.      129,   30,   78,  129,   30,   80,  129,   30,   82,  129,  #  1170
  1900.       30,   83,  129,   30,   85,  129,   30,   87,  129,   30,  #  1180
  1901.       89,  129,   30,   91,  129,   30,    4,  132,  193,  129,  #  1190
  1902.       30,    3,  129,   30,    7,  129,   30,   10,  112,    1,  #  1200
  1903.      129,   30,   13,  112,    2,  129,   30,   16,  112,    3,  #  1210
  1904.      129,   30,   18,  111,    5,  129,   30,   21,  111,    6,  #  1220
  1905.      129,   30,   23,  112,    6,  129,   30,   14,   47,    8,  #  1230
  1906.      113,    6,  129,   30,   14,   49,    8,  114,    5,  129,  #  1240
  1907.       30,   14,   51,    8,  115,    5,  129,   30,   14,   53,  #  1250
  1908.        8,  116,    4,  129,   30,   14,   55,    8,  116,    5,  #  1260
  1909.      129,   30,   14,   56,    9,  117,    4,  129,   30,   14,  #  1270
  1910.       57,    9,  117,    4,  129,   30,   14,   58,   10,  117,  #  1280
  1911.        4,  129,   30,   14,   59,   10,  117,    4,  129,   30,  #  1290
  1912.       14,   60,   11,  117,    4,  129,   30,   14,   61,   11,  #  1300
  1913.      116,    5,  129,   30,   14,   62,   11,  116,    5,  129,  #  1310
  1914.       30,   14,   63,   12,  115,    6,  129,   30,   14,   64,  #  1320
  1915.       13,  114,    7,  129,   30,   14,   65,   13,  113,    8,  #  1330
  1916.      129,   30,   14,   65,   15,  111,    9,  129,   30,   14,  #  1340
  1917.       66,   16,  109,   11,  129,   30,   14,   67,   17,  107,  #  1350
  1918.       12,  129,   30,   14,   68,   20,  103,   16,  129,   30,  #  1360
  1919.       14,   69,   49,  129,   30,   14,   70,   47,  129,   30,  #  1370
  1920.       14,   71,   45,  129,   30,   14,   73,   42,  129,   30,  #  1380
  1921.       15,   75,   38,  129,   33,   12,   77,   34,  129,   36,  #  1390
  1922.       10,   79,   30,  129,   40,    6,   82,   23,  129,   44,  #  1400
  1923.        3,   86,   15,  129,   47,    1,  129,  193,  129,  129,  #  1410
  1924.       38,    3,  129,   37,    5,  111,    1,  129,   36,    7,  #  1420
  1925.      111,    2,  129,   35,    9,  110,    5,  129,   34,    8,  #  1430
  1926.      110,    6,  129,   33,    7,  109,    8,  129,   32,    7,  #  1440
  1927.      110,    8,  129,   32,    6,  112,    7,  129,   31,    6,  #  1450
  1928.      113,    6,  129,   31,    5,  114,    6,  129,   30,    5,  #  1460
  1929.      115,    5,  129,   30,    5,  116,    4,  129,   30,    4,  #  1470
  1930.      117,    4,  131,   30,    4,  117,    4,  129,   30,    4,  #  1480
  1931.       79,    2,  117,    4,  129,   30,    5,   78,    4,  117,  #  1490
  1932.        4,  129,   30,    5,   77,    6,  116,    5,  129,   30,  #  1500
  1933.        6,   76,    8,  115,    6,  129,   30,    7,   75,   11,  #  1510
  1934.      114,    6,  129,   30,    8,   73,   15,  112,    8,  129,  #  1520
  1935.       31,    9,   71,   19,  110,    9,  129,   31,   11,   68,  #  1530
  1936.       26,  107,   12,  129,   32,   13,   65,   14,   82,   36,  #  1540
  1937.      129,   32,   16,   61,   17,   83,   34,  129,   33,   44,  #  1550
  1938.       84,   32,  129,   34,   42,   85,   30,  129,   35,   40,  #  1560
  1939.       87,   27,  129,   36,   38,   89,   23,  129,   38,   34,  #  1570
  1940.       92,   17,  129,   40,   30,   95,   11,  129,   42,   26,  #  1580
  1941.      129,   45,   20,  129,   49,   11,  129,  193,  129,   49,  #  1590
  1942.        1,  129,   49,    4,  129,   49,    6,  129,   49,    8,  #  1600
  1943.      129,   49,   10,  129,   49,   12,  129,   49,   14,  129,  #  1610
  1944.       49,   17,  129,   49,   19,  129,   49,   21,  129,   49,  #  1620
  1945.       23,  129,   49,   14,   65,    9,  129,   49,   14,   67,  #  1630
  1946.        9,  129,   49,   14,   69,    9,  129,   49,   14,   71,  #  1640
  1947.       10,  129,   49,   14,   74,    9,  129,   49,   14,   76,  #  1650
  1948.        9,  129,   49,   14,   78,    9,  129,   49,   14,   80,  #  1660
  1949.        9,  129,   49,   14,   82,    9,  129,   49,   14,   84,  #  1670
  1950.        9,  129,   30,    4,   49,   14,   86,   10,  129,   30,  #  1680
  1951.        4,   49,   14,   89,    9,  129,   30,    4,   49,   14,  #  1690
  1952.       91,    9,  129,   30,    4,   49,   14,   93,    9,  129,  #  1700
  1953.       30,   74,  129,   30,   76,  129,   30,   78,  129,   30,  #  1710
  1954.       81,  129,   30,   83,  129,   30,   85,  129,   30,   87,  #  1720
  1955.      129,   30,   89,  129,   30,   91,  129,   30,    4,   49,  #  1730
  1956.       14,  132,  193,  129,   37,    1,  129,   36,    3,   77,  #  1740
  1957.        3,  129,   35,    5,   78,   11,  129,   34,    7,   78,  #  1750
  1958.       21,  129,   33,    7,   79,   29,  129,   32,    7,   79,  #  1760
  1959.       38,  129,   32,    6,   80,    4,   92,   29,  129,   31,  #  1770
  1960.        6,   80,    5,  102,   19,  129,   31,    5,   80,    6,  #  1780
  1961.      107,   14,  129,   31,    4,   81,    5,  107,   14,  129,  #  1790
  1962.       30,    5,   81,    6,  107,   14,  129,   30,    4,   81,  #  1800
  1963.        6,  107,   14,  130,   30,    4,   81,    7,  107,   14,  #  1810
  1964.      129,   30,    4,   80,    8,  107,   14,  130,   30,    5,  #  1820
  1965.       80,    8,  107,   14,  129,   30,    5,   79,    9,  107,  #  1830
  1966.       14,  129,   31,    5,   79,    9,  107,   14,  129,   31,  #  1840
  1967.        6,   78,   10,  107,   14,  129,   32,    6,   76,   11,  #  1850
  1968.      107,   14,  129,   32,    8,   74,   13,  107,   14,  129,  #  1860
  1969.       33,   10,   71,   16,  107,   14,  129,   33,   15,   67,  #  1870
  1970.       19,  107,   14,  129,   34,   51,  107,   14,  129,   35,  #  1880
  1971.       49,  107,   14,  129,   36,   47,  107,   14,  129,   37,  #  1890
  1972.       45,  107,   14,  129,   39,   41,  107,   14,  129,   41,  #  1900
  1973.       37,  107,   14,  129,   44,   32,  107,   14,  129,   47,  #  1910
  1974.       25,  111,   10,  129,   51,   16,  115,    6,  129,  119,  #  1920
  1975.        2,  129,  193,  129,   56,   39,  129,   51,   49,  129,  #  1930
  1976.       47,   57,  129,   44,   63,  129,   42,   67,  129,   40,  #  1940
  1977.       71,  129,   38,   75,  129,   37,   77,  129,   35,   81,  #  1950
  1978.      129,   34,   16,   74,    5,  101,   16,  129,   33,   11,  #  1960
  1979.       76,    5,  107,   11,  129,   32,    9,   77,    5,  110,  #  1970
  1980.        9,  129,   32,    7,   79,    4,  112,    7,  129,   31,  #  1980
  1981.        6,   80,    4,  114,    6,  129,   31,    5,   81,    4,  #  1990
  1982.      115,    5,  129,   30,    5,   82,    4,  116,    5,  129,  #  2000
  1983.       30,    4,   82,    4,  116,    5,  129,   30,    4,   82,  #  2010
  1984.        5,  117,    4,  131,   30,    5,   82,    5,  117,    4,  #  2020
  1985.      129,   31,    5,   81,    6,  117,    4,  129,   31,    6,  #  2030
  1986.       80,    7,  117,    4,  129,   32,    7,   79,    8,  117,  #  2040
  1987.        4,  129,   32,    9,   77,    9,  116,    5,  129,   33,  #  2050
  1988.       11,   75,   11,  116,    4,  129,   34,   16,   69,   16,  #  2060
  1989.      115,    5,  129,   35,   49,  114,    5,  129,   37,   46,  #  2070
  1990.      113,    5,  129,   38,   44,  112,    6,  129,   40,   41,  #  2080
  1991.      112,    5,  129,   42,   37,  113,    3,  129,   44,   33,  #  2090
  1992.      114,    1,  129,   47,   27,  129,   51,   17,  129,  193,  #  2100
  1993.      129,  103,    2,  129,  103,    6,  129,  104,    9,  129,  #  2110
  1994.      105,   12,  129,  106,   15,  129,  107,   14,  135,   30,  #  2120
  1995.       10,  107,   14,  129,   30,   17,  107,   14,  129,   30,  #  2130
  1996.       25,  107,   14,  129,   30,   31,  107,   14,  129,   30,  #  2140
  1997.       37,  107,   14,  129,   30,   42,  107,   14,  129,   30,  #  2150
  1998.       46,  107,   14,  129,   30,   50,  107,   14,  129,   30,  #  2160
  1999.       54,  107,   14,  129,   30,   58,  107,   14,  129,   59,  #  2170
  2000.       32,  107,   14,  129,   64,   30,  107,   14,  129,   74,  #  2180
  2001.       23,  107,   14,  129,   81,   18,  107,   14,  129,   86,  #  2190
  2002.       16,  107,   14,  129,   91,   14,  107,   14,  129,   96,  #  2200
  2003.       25,  129,  100,   21,  129,  104,   17,  129,  107,   14,  #  2210
  2004.      129,  111,   10,  129,  114,    7,  129,  117,    4,  129,  #  2220
  2005.      120,    1,  129,  193,  129,   48,   13,  129,   44,   21,  #  2230
  2006.      129,   42,   26,  129,   40,   30,   92,   12,  129,   38,  #  2240
  2007.       34,   88,   20,  129,   36,   37,   86,   25,  129,   35,  #  2250
  2008.       39,   84,   29,  129,   34,   13,   63,   12,   82,   33,  #  2260
  2009.      129,   33,   11,   67,    9,   80,   36,  129,   32,    9,  #  2270
  2010.       70,    7,   79,   38,  129,   31,    8,   72,   46,  129,  #  2280
  2011.       30,    7,   74,   22,  108,   11,  129,   30,    6,   75,  #  2290
  2012.       19,  111,    9,  129,   30,    5,   75,   17,  113,    7,  #  2300
  2013.      129,   30,    5,   74,   16,  114,    6,  129,   30,    4,  #  2310
  2014.       73,   16,  115,    6,  129,   30,    4,   72,   16,  116,  #  2320
  2015.        5,  129,   30,    4,   72,   15,  117,    4,  129,   30,  #  2330
  2016.        4,   71,   16,  117,    4,  129,   30,    5,   70,   16,  #  2340
  2017.      117,    4,  129,   30,    5,   70,   15,  117,    4,  129,  #  2350
  2018.       30,    6,   69,   15,  116,    5,  129,   30,    7,   68,  #  2360
  2019.       17,  115,    5,  129,   30,    9,   67,   19,  114,    6,  #  2370
  2020.      129,   30,   10,   65,   22,  113,    6,  129,   31,   12,  #  2380
  2021.       63,   27,  110,    9,  129,   32,   14,   60,   21,   84,  #  2390
  2022.        9,  106,   12,  129,   33,   47,   85,   32,  129,   34,  #  2400
  2023.       45,   86,   30,  129,   35,   43,   88,   26,  129,   36,  #  2410
  2024.       40,   90,   22,  129,   38,   36,   93,   17,  129,   40,  #  2420
  2025.       32,   96,   10,  129,   42,   28,  129,   44,   23,  129,  #  2430
  2026.       48,   15,  129,  193,  129,   83,   17,  129,   77,   27,  #  2440
  2027.      129,   36,    1,   74,   33,  129,   35,    3,   72,   37,  #  2450
  2028.      129,   34,    5,   70,   41,  129,   33,    6,   69,   44,  #  2460
  2029.      129,   33,    5,   68,   46,  129,   32,    5,   67,   49,  #  2470
  2030.      129,   31,    5,   66,   17,  101,   16,  129,   31,    5,  #  2480
  2031.       66,   11,  108,   10,  129,   30,    4,   65,    9,  110,  #  2490
  2032.        9,  129,   30,    4,   64,    8,  112,    7,  129,   30,  #  2500
  2033.        4,   64,    7,  114,    6,  129,   30,    4,   64,    6,  #  2510
  2034.      115,    5,  129,   30,    4,   64,    5,  116,    5,  129,  #  2520
  2035.       30,    4,   64,    5,  117,    4,  131,   30,    4,   65,  #  2530
  2036.        4,  117,    4,  129,   30,    5,   65,    4,  116,    5,  #  2540
  2037.      129,   31,    5,   66,    4,  115,    5,  129,   31,    6,  #  2550
  2038.       67,    4,  114,    6,  129,   32,    7,   68,    4,  112,  #  2560
  2039.        7,  129,   32,    9,   69,    5,  110,    9,  129,   33,  #  2570
  2040.       11,   70,    5,  107,   11,  129,   34,   16,   72,    5,  #  2580
  2041.      101,   16,  129,   35,   81,  129,   37,   77,  129,   38,  #  2590
  2042.       75,  129,   40,   71,  129,   42,   67,  129,   44,   63,  #  2600
  2043.      129,   47,   57,  129,   51,   49,  129,   56,   39,  129,  #  2610
  2044.      193,  130,   34,    6,   74,    6,  129,   32,   10,   72,  #  2620
  2045.       10,  129,   31,   12,   71,   12,  129,   30,   14,   70,  #  2630
  2046.       14,  131,   31,   12,   71,   12,  129,   32,   10,   72,  #  2640
  2047.       10,  129,   34,    6,   74,    6,  129,  194,  130,   34,  #  2650
  2048.        6,   74,    6,  129,   32,   10,   72,   10,  129,   31,  #  2660
  2049.       12,   71,   12,  129,   30,   14,   70,   14,  129,   20,  #  2670
  2050.        2,   28,   16,   70,   14,  129,   22,   22,   70,   14,  #  2680
  2051.      129,   24,   19,   71,   12,  129,   27,   15,   72,   10,  #  2690
  2052.      129,   31,    9,   74,    6,  129,  194,  129,   53,    4,  #  2700
  2053.       63,    4,  152,  193,  130,   99,    7,  129,   97,   13,  #  2710
  2054.      129,   96,   16,  129,   96,   18,  129,   96,   19,  129,  #  2720
  2055.       97,   19,  129,   99,    6,  110,    7,  129,  112,    6,  #  2730
  2056.      129,  114,    5,  129,   34,    6,   57,    5,  115,    4,  #  2740
  2057.      129,   32,   10,   54,   12,  116,    4,  129,   31,   12,  #  2750
  2058.       53,   16,  117,    3,  129,   30,   14,   52,   20,  117,  #  2760
  2059.        4,  129,   30,   14,   52,   23,  117,    4,  129,   30,  #  2770
  2060.       14,   52,   25,  117,    4,  129,   31,   12,   52,   27,  #  2780
  2061.      117,    4,  129,   32,   10,   53,   10,   70,   11,  116,  #  2790
  2062.        5,  129,   34,    6,   55,    5,   73,   10,  115,    6,  #  2800
  2063.      129,   74,   11,  114,    7,  129,   75,   12,  112,    9,  #  2810
  2064.      129,   76,   13,  110,   10,  129,   77,   16,  106,   14,  #  2820
  2065.      129,   78,   41,  129,   80,   38,  129,   81,   36,  129,  #  2830
  2066.       82,   34,  129,   84,   30,  129,   86,   26,  129,   88,  #  2840
  2067.       22,  129,   92,   14,  129,  194,  129,   55,   15,  129,  #  2850
  2068.       50,   25,  129,   47,   32,  129,   45,   13,   70,   12,  #  2860
  2069.      129,   43,    9,   76,   10,  129,   42,    6,   79,    8,  #  2870
  2070.      129,   41,    5,   81,    7,  129,   40,    4,   84,    6,  #  2880
  2071.      129,   39,    4,   59,   12,   85,    6,  129,   38,    4,  #  2890
  2072.       55,   19,   87,    5,  129,   37,    4,   53,   23,   88,  #  2900
  2073.        4,  129,   36,    4,   51,    8,   71,    6,   89,    4,  #  2910
  2074.      129,   36,    4,   51,    6,   73,    4,   89,    4,  129,  #  2920
  2075.       36,    4,   50,    6,   74,    4,   90,    3,  129,   35,  #  2930
  2076.        4,   50,    5,   75,    3,   90,    4,  129,   35,    4,  #  2940
  2077.       50,    4,   75,    4,   90,    4,  131,   35,    4,   50,  #  2950
  2078.        5,   75,    4,   90,    4,  129,   36,    4,   51,    5,  #  2960
  2079.       75,    4,   90,    4,  129,   36,    4,   51,    6,   75,  #  2970
  2080.        4,   90,    4,  129,   36,    4,   53,   26,   90,    4,  #  2980
  2081.      129,   37,    4,   54,   25,   90,    4,  129,   37,    4,  #  2990
  2082.       52,   27,   90,    3,  129,   38,    4,   52,    4,   89,  #  3000
  2083.        4,  129,   39,    4,   51,    4,   88,    4,  129,   40,  #  3010
  2084.        4,   50,    4,   87,    5,  129,   41,    4,   50,    4,  #  3020
  2085.       86,    5,  129,   42,    4,   50,    4,   85,    5,  129,  #  3030
  2086.       43,    3,   50,    4,   83,    6,  129,   44,    2,   51,  #  3040
  2087.        5,   80,    7,  129,   46,    1,   52,    6,   76,    9,  #  3050
  2088.      129,   54,   28,  129,   56,   23,  129,   60,   16,  129,  #  3060
  2089.      193,  129,   30,    4,  132,   30,    5,  129,   30,    8,  #  3070
  2090.      129,   30,   12,  129,   30,   16,  129,   30,    4,   37,  #  3080
  2091.       12,  129,   30,    4,   41,   12,  129,   30,    4,   44,  #  3090
  2092.       13,  129,   30,    4,   48,   13,  129,   52,   13,  129,  #  3100
  2093.       56,   12,  129,   58,   14,  129,   58,    4,   64,   12,  #  3110
  2094.      129,   58,    4,   68,   12,  129,   58,    4,   72,   12,  #  3120
  2095.      129,   58,    4,   75,   13,  129,   58,    4,   79,   13,  #  3130
  2096.      129,   58,    4,   83,   13,  129,   58,    4,   87,   13,  #  3140
  2097.      129,   58,    4,   91,   12,  129,   58,    4,   95,   12,  #  3150
  2098.      129,   58,    4,   96,   15,  129,   58,    4,   93,   22,  #  3160
  2099.      129,   58,    4,   89,   30,  129,   58,    4,   85,   36,  #  3170
  2100.      129,   58,    4,   81,   38,  129,   58,    4,   77,   38,  #  3180
  2101.      129,   58,    4,   73,   38,  129,   58,    4,   70,   37,  #  3190
  2102.      129,   58,    4,   66,   37,  129,   58,   41,  129,   58,  #  3200
  2103.       37,  129,   54,   38,  129,   30,    4,   50,   38,  129,  #  3210
  2104.       30,    4,   46,   38,  129,   30,    4,   42,   38,  129,  #  3220
  2105.       30,    4,   38,   39,  129,   30,   43,  129,   30,   39,  #  3230
  2106.      129,   30,   35,  129,   30,   31,  129,   30,   27,  129,  #  3240
  2107.       30,   24,  129,   30,   20,  129,   30,   16,  129,   30,  #  3250
  2108.       12,  129,   30,    8,  129,   30,    5,  129,   30,    4,  #  3260
  2109.      132,  193,  129,   30,    4,  117,    4,  132,   30,   91,  #  3270
  2110.      137,   30,    4,   80,    4,  117,    4,  138,   30,    4,  #  3280
  2111.       80,    5,  116,    5,  129,   30,    5,   79,    6,  116,  #  3290
  2112.        5,  130,   30,    6,   78,    8,  115,    6,  129,   31,  #  3300
  2113.        6,   77,    9,  115,    6,  129,   31,    7,   76,   11,  #  3310
  2114.      114,    6,  129,   31,    8,   75,   14,  112,    8,  129,  #  3320
  2115.       32,    8,   74,   16,  111,    9,  129,   32,    9,   73,  #  3330
  2116.       19,  109,   10,  129,   33,   10,   71,   24,  106,   13,  #  3340
  2117.      129,   33,   13,   68,   12,   83,   35,  129,   34,   16,  #  3350
  2118.       64,   15,   84,   33,  129,   35,   43,   85,   31,  129,  #  3360
  2119.       36,   41,   86,   29,  129,   37,   39,   88,   25,  129,  #  3370
  2120.       38,   37,   90,   21,  129,   40,   33,   93,   15,  129,  #  3380
  2121.       42,   29,   96,    9,  129,   45,   24,  129,   49,   16,  #  3390
  2122.      129,  193,  129,   63,   25,  129,   57,   37,  129,   53,  #  3400
  2123.       45,  129,   50,   51,  129,   47,   57,  129,   45,   61,  #  3410
  2124.      129,   43,   65,  129,   41,   69,  129,   39,   73,  129,  #  3420
  2125.       38,   25,   92,   21,  129,   36,   21,   97,   18,  129,  #  3430
  2126.       35,   18,  102,   14,  129,   34,   16,  106,   11,  129,  #  3440
  2127.       33,   14,  108,   10,  129,   32,   12,  111,    8,  129,  #  3450
  2128.       32,   10,  113,    6,  129,   31,   10,  114,    6,  129,  #  3460
  2129.       31,    8,  115,    5,  129,   30,    8,  116,    5,  129,  #  3470
  2130.       30,    7,  116,    5,  129,   30,    6,  117,    4,  130,  #  3480
  2131.       30,    5,  117,    4,  131,   31,    4,  116,    5,  129,  #  3490
  2132.       32,    4,  116,    4,  129,   32,    5,  115,    5,  129,  #  3500
  2133.       33,    4,  114,    5,  129,   34,    4,  112,    6,  129,  #  3510
  2134.       35,    4,  110,    7,  129,   37,    4,  107,    9,  129,  #  3520
  2135.       39,    4,  103,   12,  129,   41,    4,  103,   18,  129,  #  3530
  2136.       43,    4,  103,   18,  129,   45,    5,  103,   18,  129,  #  3540
  2137.       48,    5,  103,   18,  129,   51,    1,  129,  193,  129,  #  3550
  2138.       30,    4,  117,    4,  132,   30,   91,  137,   30,    4,  #  3560
  2139.      117,    4,  135,   30,    5,  116,    5,  130,   30,    6,  #  3570
  2140.      115,    6,  130,   31,    6,  114,    6,  129,   31,    7,  #  3580
  2141.      113,    7,  129,   32,    7,  112,    7,  129,   32,    8,  #  3590
  2142.      111,    8,  129,   33,    9,  109,    9,  129,   33,   12,  #  3600
  2143.      106,   12,  129,   34,   13,  104,   13,  129,   35,   15,  #  3610
  2144.      101,   15,  129,   36,   19,   96,   19,  129,   37,   24,  #  3620
  2145.       90,   24,  129,   39,   73,  129,   40,   71,  129,   42,  #  3630
  2146.       67,  129,   44,   63,  129,   46,   59,  129,   49,   53,  #  3640
  2147.      129,   52,   47,  129,   56,   39,  129,   61,   29,  129,  #  3650
  2148.      193,  129,   30,    4,  117,    4,  132,   30,   91,  137,  #  3660
  2149.       30,    4,   80,    4,  117,    4,  140,   30,    4,   79,  #  3670
  2150.        6,  117,    4,  129,   30,    4,   77,   10,  117,    4,  #  3680
  2151.      129,   30,    4,   73,   18,  117,    4,  132,   30,    4,  #  3690
  2152.      117,    4,  130,   30,    5,  116,    5,  130,   30,    7,  #  3700
  2153.      114,    7,  129,   30,    8,  113,    8,  129,   30,   11,  #  3710
  2154.      110,   11,  129,   30,   18,  103,   18,  132,  193,  129,  #  3720
  2155.       30,    4,  117,    4,  132,   30,   91,  137,   30,    4,  #  3730
  2156.       80,    4,  117,    4,  132,   80,    4,  117,    4,  136,  #  3740
  2157.       79,    6,  117,    4,  129,   77,   10,  117,    4,  129,  #  3750
  2158.       73,   18,  117,    4,  132,  117,    4,  130,  116,    5,  #  3760
  2159.      130,  114,    7,  129,  113,    8,  129,  110,   11,  129,  #  3770
  2160.      103,   18,  132,  193,  129,   63,   25,  129,   57,   37,  #  3780
  2161.      129,   53,   45,  129,   50,   51,  129,   47,   57,  129,  #  3790
  2162.       45,   61,  129,   43,   65,  129,   41,   69,  129,   39,  #  3800
  2163.       73,  129,   38,   25,   92,   21,  129,   36,   21,   97,  #  3810
  2164.       18,  129,   35,   18,  102,   14,  129,   34,   16,  106,  #  3820
  2165.       11,  129,   33,   14,  108,   10,  129,   32,   12,  111,  #  3830
  2166.        8,  129,   32,   10,  113,    6,  129,   31,   10,  114,  #  3840
  2167.        6,  129,   31,    8,  115,    5,  129,   30,    8,  116,  #  3850
  2168.        5,  129,   30,    7,  116,    5,  129,   30,    6,  117,  #  3860
  2169.        4,  130,   30,    5,  117,    4,  131,   30,    5,   75,  #  3870
  2170.        4,  116,    5,  129,   31,    5,   75,    4,  116,    4,  #  3880
  2171.      129,   31,    6,   75,    4,  115,    5,  129,   32,    7,  #  3890
  2172.       75,    4,  114,    5,  129,   32,    9,   75,    4,  112,  #  3900
  2173.        6,  129,   33,   11,   75,    4,  110,    7,  129,   34,  #  3910
  2174.       15,   75,    4,  107,    9,  129,   35,   44,  103,   12,  #  3920
  2175.      129,   36,   43,  103,   18,  129,   38,   41,  103,   18,  #  3930
  2176.      129,   39,   40,  103,   18,  129,   41,   38,  103,   18,  #  3940
  2177.      129,   44,   35,  129,   48,   31,  129,   52,   27,  129,  #  3950
  2178.       61,   18,  129,  193,  129,   30,    4,  117,    4,  132,  #  3960
  2179.       30,   91,  137,   30,    4,   80,    4,  117,    4,  132,  #  3970
  2180.       80,    4,  140,   30,    4,   80,    4,  117,    4,  132,  #  3980
  2181.       30,   91,  137,   30,    4,  117,    4,  132,  193,  129,  #  3990
  2182.       30,    4,  117,    4,  132,   30,   91,  137,   30,    4,  #  4000
  2183.      117,    4,  132,  193,  129,   44,    7,  129,   40,   13,  #  4010
  2184.      129,   37,   17,  129,   35,   20,  129,   34,   22,  129,  #  4020
  2185.       33,   23,  129,   32,   24,  129,   32,   23,  129,   31,  #  4030
  2186.        6,   41,   13,  129,   31,    5,   42,   11,  129,   30,  #  4040
  2187.        5,   44,    7,  129,   30,    4,  132,   30,    5,  130,  #  4050
  2188.       31,    5,  129,   31,    6,  117,    4,  129,   31,    8,  #  4060
  2189.      117,    4,  129,   32,    9,  117,    4,  129,   33,   11,  #  4070
  2190.      117,    4,  129,   34,   87,  129,   35,   86,  129,   36,  #  4080
  2191.       85,  129,   37,   84,  129,   38,   83,  129,   40,   81,  #  4090
  2192.      129,   42,   79,  129,   45,   76,  129,   50,   71,  129,  #  4100
  2193.      117,    4,  132,  193,  129,   30,    4,  117,    4,  132,  #  4110
  2194.       30,   91,  137,   30,    4,   76,    8,  117,    4,  129,  #  4120
  2195.       30,    4,   73,   13,  117,    4,  129,   30,    4,   70,  #  4130
  2196.       18,  117,    4,  129,   30,    4,   67,   23,  117,    4,  #  4140
  2197.      129,   65,   26,  129,   62,   31,  129,   59,   35,  129,  #  4150
  2198.       56,   29,   89,    7,  129,   53,   29,   91,    7,  129,  #  4160
  2199.       50,   29,   93,    7,  129,   47,   29,   95,    6,  129,  #  4170
  2200.       30,    4,   45,   29,   96,    7,  129,   30,    4,   42,  #  4180
  2201.       29,   98,    7,  129,   30,    4,   39,   30,  100,    6,  #  4190
  2202.      129,   30,    4,   36,   30,  101,    7,  129,   30,   33,  #  4200
  2203.      103,    7,  117,    4,  129,   30,   30,  105,    6,  117,  #  4210
  2204.        4,  129,   30,   27,  106,    7,  117,    4,  129,   30,  #  4220
  2205.       25,  108,    7,  117,    4,  129,   30,   22,  110,   11,  #  4230
  2206.      129,   30,   19,  111,   10,  129,   30,   16,  113,    8,  #  4240
  2207.      129,   30,   13,  115,    6,  129,   30,   11,  116,    5,  #  4250
  2208.      129,   30,    8,  117,    4,  129,   30,    5,  117,    4,  #  4260
  2209.      129,   30,    4,  117,    4,  130,   30,    4,  130,  193,  #  4270
  2210.      129,   30,    4,  117,    4,  132,   30,   91,  137,   30,  #  4280
  2211.        4,  117,    4,  132,   30,    4,  144,   30,    5,  130,  #  4290
  2212.       30,    7,  129,   30,    8,  129,   30,   11,  129,   30,  #  4300
  2213.       18,  132,  193,  129,   30,    4,  117,    4,  132,   30,  #  4310
  2214.       91,  132,   30,    4,  103,   18,  129,   30,    4,   97,  #  4320
  2215.       24,  129,   30,    4,   92,   29,  129,   30,    4,   87,  #  4330
  2216.       34,  129,   81,   40,  129,   76,   45,  129,   70,   49,  #  4340
  2217.      129,   65,   49,  129,   60,   49,  129,   55,   49,  129,  #  4350
  2218.       50,   48,  129,   44,   49,  129,   39,   48,  129,   33,  #  4360
  2219.       49,  129,   30,   47,  129,   34,   37,  129,   40,   26,  #  4370
  2220.      129,   46,   19,  129,   52,   19,  129,   58,   19,  129,  #  4380
  2221.       64,   19,  129,   70,   19,  129,   76,   19,  129,   82,  #  4390
  2222.       19,  129,   30,    4,   88,   18,  129,   30,    4,   94,  #  4400
  2223.       18,  129,   30,    4,  100,   18,  129,   30,    4,  106,  #  4410
  2224.       15,  129,   30,   91,  137,   30,    4,  117,    4,  132,  #  4420
  2225.      193,  129,   30,    4,  117,    4,  132,   30,   91,  132,  #  4430
  2226.       30,    4,  107,   14,  129,   30,    4,  104,   17,  129,  #  4440
  2227.       30,    4,  101,   20,  129,   30,    4,   99,   22,  129,  #  4450
  2228.       96,   25,  129,   93,   28,  129,   91,   28,  129,   88,  #  4460
  2229.       29,  129,   85,   29,  129,   82,   29,  129,   79,   29,  #  4470
  2230.      129,   76,   29,  129,   74,   29,  129,   71,   29,  129,  #  4480
  2231.       68,   29,  129,   65,   29,  129,   62,   29,  129,   60,  #  4490
  2232.       29,  129,   57,   29,  129,   54,   29,  129,   51,   29,  #  4500
  2233.      129,   49,   28,  129,   46,   29,  129,   43,   29,  129,  #  4510
  2234.       40,   29,  117,    4,  129,   37,   29,  117,    4,  129,  #  4520
  2235.       35,   29,  117,    4,  129,   32,   29,  117,    4,  129,  #  4530
  2236.       30,   91,  132,  117,    4,  132,  193,  129,   63,   25,  #  4540
  2237.      129,   57,   37,  129,   53,   45,  129,   50,   51,  129,  #  4550
  2238.       47,   57,  129,   45,   61,  129,   43,   65,  129,   41,  #  4560
  2239.       69,  129,   39,   73,  129,   38,   21,   92,   21,  129,  #  4570
  2240.       36,   18,   97,   18,  129,   35,   14,  102,   14,  129,  #  4580
  2241.       34,   11,  106,   11,  129,   33,   10,  108,   10,  129,  #  4590
  2242.       32,    8,  111,    8,  129,   32,    6,  113,    6,  129,  #  4600
  2243.       31,    6,  114,    6,  129,   31,    5,  115,    5,  129,  #  4610
  2244.       30,    5,  116,    5,  130,   30,    4,  117,    4,  132,  #  4620
  2245.       30,    5,  116,    5,  130,   31,    5,  115,    5,  129,  #  4630
  2246.       31,    6,  114,    6,  129,   32,    6,  113,    6,  129,  #  4640
  2247.       32,    8,  111,    8,  129,   33,   10,  108,   10,  129,  #  4650
  2248.       34,   11,  106,   11,  129,   35,   14,  102,   14,  129,  #  4660
  2249.       36,   18,   97,   18,  129,   38,   21,   92,   21,  129,  #  4670
  2250.       39,   73,  129,   41,   69,  129,   43,   65,  129,   45,  #  4680
  2251.       61,  129,   47,   57,  129,   50,   51,  129,   53,   45,  #  4690
  2252.      129,   57,   37,  129,   63,   25,  129,  193,  129,   30,  #  4700
  2253.        4,  117,    4,  132,   30,   91,  137,   30,    4,   80,  #  4710
  2254.        4,  117,    4,  132,   80,    4,  117,    4,  134,   80,  #  4720
  2255.        5,  116,    5,  131,   80,    6,  115,    6,  130,   81,  #  4730
  2256.        6,  114,    6,  129,   81,    8,  112,    8,  129,   81,  #  4740
  2257.        9,  111,    9,  129,   82,   10,  109,   10,  129,   82,  #  4750
  2258.       13,  106,   13,  129,   83,   35,  129,   84,   33,  129,  #  4760
  2259.       85,   31,  129,   86,   29,  129,   88,   25,  129,   90,  #  4770
  2260.       21,  129,   93,   15,  129,   96,    9,  129,  193,  129,  #  4780
  2261.       63,   25,  129,   57,   37,  129,   53,   45,  129,   50,  #  4790
  2262.       51,  129,   47,   57,  129,   45,   61,  129,   43,   65,  #  4800
  2263.      129,   41,   69,  129,   39,   73,  129,   38,   21,   92,  #  4810
  2264.       21,  129,   36,   18,   97,   18,  129,   35,   14,  102,  #  4820
  2265.       14,  129,   34,   11,  106,   11,  129,   33,   10,  108,  #  4830
  2266.       10,  129,   32,    8,  111,    8,  129,   32,    6,  113,  #  4840
  2267.        6,  129,   31,    6,  114,    6,  129,   31,    5,  115,  #  4850
  2268.        5,  129,   30,    5,  116,    5,  130,   30,    4,   39,  #  4860
  2269.        2,  117,    4,  129,   30,    4,   40,    4,  117,    4,  #  4870
  2270.      129,   30,    4,   41,    5,  117,    4,  129,   30,    4,  #  4880
  2271.       41,    6,  117,    4,  129,   30,    5,   40,    8,  116,  #  4890
  2272.        5,  129,   30,    5,   39,   10,  116,    5,  129,   31,  #  4900
  2273.        5,   38,   11,  115,    5,  129,   31,   18,  114,    6,  #  4910
  2274.      129,   32,   17,  113,    6,  129,   32,   16,  111,    8,  #  4920
  2275.      129,   33,   15,  108,   10,  129,   33,   14,  106,   11,  #  4930
  2276.      129,   32,   17,  102,   14,  129,   31,   23,   97,   18,  #  4940
  2277.      129,   31,   28,   92,   21,  129,   30,   82,  129,   30,  #  4950
  2278.       80,  129,   30,   11,   43,   65,  129,   30,   10,   45,  #  4960
  2279.       61,  129,   31,    8,   47,   57,  129,   32,    6,   50,  #  4970
  2280.       51,  129,   33,    5,   53,   45,  129,   35,    4,   57,  #  4980
  2281.       37,  129,   38,    2,   63,   25,  129,  193,  129,   30,  #  4990
  2282.        4,  117,    4,  132,   30,   91,  137,   30,    4,   76,  #  5000
  2283.        8,  117,    4,  129,   30,    4,   73,   11,  117,    4,  #  5010
  2284.      129,   30,    4,   70,   14,  117,    4,  129,   30,    4,  #  5020
  2285.       67,   17,  117,    4,  129,   65,   19,  117,    4,  129,  #  5030
  2286.       62,   22,  117,    4,  129,   59,   25,  117,    4,  129,  #  5040
  2287.       56,   28,  117,    4,  129,   53,   31,  117,    4,  129,  #  5050
  2288.       50,   34,  117,    4,  129,   47,   29,   80,    5,  116,  #  5060
  2289.        5,  129,   30,    4,   45,   29,   80,    5,  116,    5,  #  5070
  2290.      129,   30,    4,   42,   29,   80,    5,  116,    5,  129,  #  5080
  2291.       30,    4,   39,   30,   80,    6,  115,    6,  129,   30,  #  5090
  2292.        4,   36,   30,   80,    6,  115,    6,  129,   30,   33,  #  5100
  2293.       81,    6,  114,    6,  129,   30,   30,   81,    8,  112,  #  5110
  2294.        8,  129,   30,   27,   81,    9,  111,    9,  129,   30,  #  5120
  2295.       25,   82,   10,  109,   10,  129,   30,   22,   82,   13,  #  5130
  2296.      106,   13,  129,   30,   19,   83,   35,  129,   30,   16,  #  5140
  2297.       84,   33,  129,   30,   13,   85,   31,  129,   30,   11,  #  5150
  2298.       86,   29,  129,   30,    8,   88,   25,  129,   30,    5,  #  5160
  2299.       90,   21,  129,   30,    4,   93,   15,  129,   30,    4,  #  5170
  2300.       96,    9,  129,   30,    4,  130,  193,  129,   30,   18,  #  5180
  2301.      130,   30,   18,   89,   15,  129,   30,   18,   85,   23,  #  5190
  2302.      129,   34,   11,   83,   27,  129,   34,    9,   81,   31,  #  5200
  2303.      129,   33,    8,   79,   35,  129,   33,    6,   78,   16,  #  5210
  2304.      106,    9,  129,   32,    6,   77,   15,  109,    7,  129,  #  5220
  2305.       32,    5,   76,   14,  111,    6,  129,   31,    5,   75,  #  5230
  2306.       14,  113,    5,  129,   31,    4,   74,   15,  114,    5,  #  5240
  2307.      129,   31,    4,   74,   14,  115,    4,  129,   30,    4,  #  5250
  2308.       73,   15,  116,    4,  129,   30,    4,   73,   14,  116,  #  5260
  2309.        4,  129,   30,    4,   73,   14,  117,    4,  129,   30,  #  5270
  2310.        4,   72,   15,  117,    4,  130,   30,    4,   71,   15,  #  5280
  2311.      117,    4,  130,   30,    4,   70,   15,  117,    4,  129,  #  5290
  2312.       30,    5,   70,   15,  117,    4,  129,   30,    5,   69,  #  5300
  2313.       15,  116,    5,  129,   30,    6,   68,   16,  115,    5,  #  5310
  2314.      129,   31,    6,   67,   16,  114,    6,  129,   31,    7,  #  5320
  2315.       66,   17,  113,    6,  129,   32,    7,   64,   18,  111,  #  5330
  2316.        8,  129,   32,    8,   62,   19,  109,    9,  129,   33,  #  5340
  2317.        9,   60,   20,  107,   10,  129,   34,   11,   57,   22,  #  5350
  2318.      103,   13,  129,   35,   43,  103,   18,  129,   36,   41,  #  5360
  2319.      103,   18,  129,   38,   38,  103,   18,  129,   39,   35,  #  5370
  2320.      103,   18,  129,   41,   31,  129,   43,   27,  129,   46,  #  5380
  2321.       22,  129,   49,   14,  129,  193,  129,  103,   18,  132,  #  5390
  2322.      110,   11,  129,  113,    8,  129,  114,    7,  129,  116,  #  5400
  2323.        5,  130,  117,    4,  132,   30,    4,  117,    4,  132,  #  5410
  2324.       30,   91,  137,   30,    4,  117,    4,  132,  117,    4,  #  5420
  2325.      132,  116,    5,  130,  114,    7,  129,  113,    8,  129,  #  5430
  2326.      110,   11,  129,  103,   18,  132,  193,  129,  117,    4,  #  5440
  2327.      132,   56,   65,  129,   50,   71,  129,   46,   75,  129,  #  5450
  2328.       44,   77,  129,   42,   79,  129,   40,   81,  129,   38,  #  5460
  2329.       83,  129,   36,   85,  129,   35,   86,  129,   34,   20,  #  5470
  2330.      117,    4,  129,   33,   17,  117,    4,  129,   32,   15,  #  5480
  2331.      117,    4,  129,   32,   13,  117,    4,  129,   31,   12,  #  5490
  2332.      129,   31,   10,  129,   31,    9,  129,   30,    9,  129,  #  5500
  2333.       30,    8,  130,   30,    7,  132,   31,    6,  130,   31,  #  5510
  2334.        7,  129,   32,    6,  129,   32,    7,  129,   33,    7,  #  5520
  2335.      129,   34,    7,  129,   35,    8,  129,   36,    9,  117,  #  5530
  2336.        4,  129,   38,    9,  117,    4,  129,   40,   10,  117,  #  5540
  2337.        4,  129,   42,   12,  117,    4,  129,   44,   77,  129,  #  5550
  2338.       46,   75,  129,   50,   71,  129,   56,   43,  100,   21,  #  5560
  2339.      129,  117,    4,  132,  193,  129,  117,    4,  132,  115,  #  5570
  2340.        6,  129,  110,   11,  129,  105,   16,  129,  101,   20,  #  5580
  2341.      129,   96,   25,  129,   92,   29,  129,   87,   34,  129,  #  5590
  2342.       83,   38,  129,   78,   43,  129,   74,   47,  129,   70,  #  5600
  2343.       42,  117,    4,  129,   65,   42,  117,    4,  129,   60,  #  5610
  2344.       43,  117,    4,  129,   56,   42,  129,   51,   42,  129,  #  5620
  2345.       46,   43,  129,   42,   43,  129,   37,   44,  129,   33,  #  5630
  2346.       43,  129,   30,   42,  129,   33,   34,  129,   38,   25,  #  5640
  2347.      129,   42,   16,  129,   47,   15,  129,   52,   15,  129,  #  5650
  2348.       57,   15,  129,   61,   16,  129,   66,   16,  129,   71,  #  5660
  2349.       16,  129,   76,   16,  129,   80,   16,  129,   85,   16,  #  5670
  2350.      117,    4,  129,   90,   16,  117,    4,  129,   95,   16,  #  5680
  2351.      117,    4,  129,  100,   21,  129,  105,   16,  129,  110,  #  5690
  2352.       11,  129,  114,    7,  129,  117,    4,  132,  193,  129,  #  5700
  2353.      117,    4,  132,  115,    6,  129,  110,   11,  129,  105,  #  5710
  2354.       16,  129,  101,   20,  129,   96,   25,  129,   92,   29,  #  5720
  2355.      129,   87,   34,  129,   83,   38,  129,   78,   43,  129,  #  5730
  2356.       74,   47,  129,   70,   42,  117,    4,  129,   65,   42,  #  5740
  2357.      117,    4,  129,   60,   43,  117,    4,  129,   56,   42,  #  5750
  2358.      129,   51,   42,  129,   46,   43,  129,   42,   43,  129,  #  5760
  2359.       37,   44,  129,   33,   43,  129,   30,   42,  129,   33,  #  5770
  2360.       34,  129,   38,   25,  129,   42,   16,  129,   47,   15,  #  5780
  2361.      129,   52,   15,  129,   57,   15,  129,   61,   16,  129,  #  5790
  2362.       65,   17,  129,   60,   27,  129,   56,   36,  129,   51,  #  5800
  2363.       42,  129,   46,   43,  129,   42,   43,  129,   37,   44,  #  5810
  2364.      129,   33,   43,  129,   30,   42,  129,   33,   34,  129,  #  5820
  2365.       38,   25,  129,   42,   16,  129,   47,   15,  129,   52,  #  5830
  2366.       15,  129,   57,   15,  129,   61,   16,  129,   66,   16,  #  5840
  2367.      129,   71,   16,  129,   76,   16,  129,   80,   16,  129,  #  5850
  2368.       85,   16,  117,    4,  129,   90,   16,  117,    4,  129,  #  5860
  2369.       95,   16,  117,    4,  129,  100,   21,  129,  105,   16,  #  5870
  2370.      129,  110,   11,  129,  114,    7,  129,  117,    4,  132,  #  5880
  2371.      193,  129,   30,    4,  117,    4,  132,   30,    4,  115,  #  5890
  2372.        6,  129,   30,    4,  112,    9,  129,   30,    6,  109,  #  5900
  2373.       12,  129,   30,    9,  106,   15,  129,   30,   11,  103,  #  5910
  2374.       18,  129,   30,   14,  100,   21,  129,   30,    4,   38,  #  5920
  2375.        9,   98,   23,  129,   30,    4,   40,   10,   95,   26,  #  5930
  2376.      129,   30,    4,   43,    9,   92,   29,  129,   46,    9,  #  5940
  2377.       89,   32,  129,   49,    8,   86,   28,  117,    4,  129,  #  5950
  2378.       51,    9,   83,   28,  117,    4,  129,   54,    9,   80,  #  5960
  2379.       28,  117,    4,  129,   57,    8,   77,   28,  117,    4,  #  5970
  2380.      129,   59,    9,   74,   28,  129,   62,   37,  129,   64,  #  5980
  2381.       33,  129,   66,   28,  129,   63,   28,  129,   60,   28,  #  5990
  2382.      129,   57,   28,  129,   54,   33,  129,   51,   39,  129,  #  6000
  2383.       48,   29,   83,    9,  129,   30,    4,   45,   29,   86,  #  6010
  2384.        9,  129,   30,    4,   42,   29,   89,    9,  129,   30,  #  6020
  2385.        4,   39,   29,   92,    8,  129,   30,    4,   36,   29,  #  6030
  2386.       94,    9,  129,   30,   32,   97,    9,  129,   30,   29,  #  6040
  2387.      100,    8,  117,    4,  129,   30,   26,  103,    8,  117,  #  6050
  2388.        4,  129,   30,   23,  105,    9,  117,    4,  129,   30,  #  6060
  2389.       20,  108,   13,  129,   30,   18,  111,   10,  129,   30,  #  6070
  2390.       15,  113,    8,  129,   30,   12,  116,    5,  129,   30,  #  6080
  2391.        9,  117,    4,  129,   30,    6,  117,    4,  129,   30,  #  6090
  2392.        4,  117,    4,  132,  193,  129,  117,    4,  132,  114,  #  6100
  2393.        7,  129,  111,   10,  129,  108,   13,  129,  105,   16,  #  6110
  2394.      129,  102,   19,  129,  100,   21,  129,   96,   25,  129,  #  6120
  2395.       93,   28,  129,   90,   31,  129,   87,   34,  129,   84,  #  6130
  2396.       30,  117,    4,  129,   30,    4,   81,   30,  117,    4,  #  6140
  2397.      129,   30,    4,   78,   30,  117,    4,  129,   30,    4,  #  6150
  2398.       75,   30,  117,    4,  129,   30,    4,   72,   30,  129,  #  6160
  2399.       30,   69,  129,   30,   66,  129,   30,   63,  129,   30,  #  6170
  2400.       60,  129,   30,   57,  129,   30,   54,  129,   30,   51,  #  6180
  2401.      129,   30,   48,  129,   30,   51,  129,   30,    4,   73,  #  6190
  2402.       12,  129,   30,    4,   76,   12,  129,   30,    4,   80,  #  6200
  2403.       12,  129,   30,    4,   83,   12,  129,   87,   12,  129,  #  6210
  2404.       90,   12,  117,    4,  129,   94,   11,  117,    4,  129,  #  6220
  2405.       97,   12,  117,    4,  129,  101,   12,  117,    4,  129,  #  6230
  2406.      104,   17,  129,  108,   13,  129,  111,   10,  129,  115,  #  6240
  2407.        6,  129,  117,    4,  134,  193,  129,   30,    1,  103,  #  6250
  2408.       18,  129,   30,    4,  103,   18,  129,   30,    7,  103,  #  6260
  2409.       18,  129,   30,    9,  103,   18,  129,   30,   12,  110,  #  6270
  2410.       11,  129,   30,   15,  113,    8,  129,   30,   18,  114,  #  6280
  2411.        7,  129,   30,   21,  116,    5,  129,   30,   24,  116,  #  6290
  2412.        5,  129,   30,   27,  117,    4,  129,   30,   30,  117,  #  6300
  2413.        4,  129,   30,   33,  117,    4,  129,   30,    4,   37,  #  6310
  2414.       28,  117,    4,  129,   30,    4,   40,   28,  117,    4,  #  6320
  2415.      129,   30,    4,   42,   29,  117,    4,  129,   30,    4,  #  6330
  2416.       45,   29,  117,    4,  129,   30,    4,   48,   29,  117,  #  6340
  2417.        4,  129,   30,    4,   51,   29,  117,    4,  129,   30,  #  6350
  2418.        4,   54,   29,  117,    4,  129,   30,    4,   57,   29,  #  6360
  2419.      117,    4,  129,   30,    4,   59,   30,  117,    4,  129,  #  6370
  2420.       30,    4,   62,   30,  117,    4,  129,   30,    4,   65,  #  6380
  2421.       30,  117,    4,  129,   30,    4,   68,   30,  117,    4,  #  6390
  2422.      129,   30,    4,   71,   30,  117,    4,  129,   30,    4,  #  6400
  2423.       74,   30,  117,    4,  129,   30,    4,   77,   30,  117,  #  6410
  2424.        4,  129,   30,    4,   80,   30,  117,    4,  129,   30,  #  6420
  2425.        4,   83,   30,  117,    4,  129,   30,    4,   86,   35,  #  6430
  2426.      129,   30,    4,   89,   32,  129,   30,    4,   91,   30,  #  6440
  2427.      129,   30,    4,   94,   27,  129,   30,    5,   97,   24,  #  6450
  2428.      129,   30,    5,  100,   21,  129,   30,    7,  103,   18,  #  6460
  2429.      129,   30,    8,  106,   15,  129,   30,   11,  109,   12,  #  6470
  2430.      129,   30,   18,  112,    9,  129,   30,   18,  115,    6,  #  6480
  2431.      129,   30,   18,  117,    4,  129,   30,   18,  120,    1,  #  6490
  2432.      129,  193,  129,   42,    8,  129,   38,   16,  129,   36,  #  6500
  2433.       20,  129,   34,   24,   71,    5,  129,   33,   26,   69,  #  6510
  2434.       10,  129,   32,   28,   68,   13,  129,   31,   30,   68,  #  6520
  2435.       14,  129,   31,    9,   52,    9,   68,   15,  129,   30,  #  6530
  2436.        8,   54,    8,   69,   14,  129,   30,    7,   55,    7,  #  6540
  2437.       71,    4,   78,    6,  129,   30,    6,   56,    6,   79,  #  6550
  2438.        5,  129,   30,    6,   56,    6,   80,    4,  130,   31,  #  6560
  2439.        5,   56,    5,   80,    4,  129,   31,    5,   56,    5,  #  6570
  2440.       79,    5,  129,   32,    5,   55,    5,   78,    6,  129,  #  6580
  2441.       33,    5,   54,    5,   77,    7,  129,   34,    6,   52,  #  6590
  2442.        6,   74,    9,  129,   35,   48,  129,   33,   49,  129,  #  6600
  2443.       32,   49,  129,   31,   49,  129,   30,   49,  129,   30,  #  6610
  2444.       47,  129,   30,   45,  129,   30,   41,  129,   30,    6,  #  6620
  2445.      129,   30,    4,  129,   30,    3,  129,   30,    2,  129,  #  6630
  2446.      193,  129,   30,    4,  117,    4,  130,   31,   90,  136,  #  6640
  2447.       37,    5,   72,    5,  129,   35,    5,   74,    5,  129,  #  6650
  2448.       33,    5,   76,    5,  129,   32,    5,   77,    5,  129,  #  6660
  2449.       31,    5,   78,    5,  129,   31,    4,   79,    4,  129,  #  6670
  2450.       30,    5,   79,    5,  131,   30,    6,   78,    6,  129,  #  6680
  2451.       30,    7,   77,    7,  129,   31,    8,   75,    8,  129,  #  6690
  2452.       31,   11,   72,   11,  129,   32,   15,   67,   15,  129,  #  6700
  2453.       33,   48,  129,   34,   46,  129,   35,   44,  129,   37,  #  6710
  2454.       40,  129,   39,   36,  129,   42,   30,  129,   46,   22,  #  6720
  2455.      129,  193,  129,   48,   18,  129,   43,   28,  129,   41,  #  6730
  2456.       32,  129,   39,   36,  129,   37,   40,  129,   35,   44,  #  6740
  2457.      129,   34,   46,  129,   33,   13,   68,   13,  129,   32,  #  6750
  2458.        9,   73,    9,  129,   32,    7,   75,    7,  129,   31,  #  6760
  2459.        6,   77,    6,  129,   31,    5,   78,    5,  129,   30,  #  6770
  2460.        5,   79,    5,  129,   30,    4,   80,    4,  133,   31,  #  6780
  2461.        3,   79,    4,  129,   31,    4,   79,    4,  129,   32,  #  6790
  2462.        3,   78,    4,  129,   32,    4,   76,    6,  129,   33,  #  6800
  2463.        4,   74,    7,  129,   34,    4,   72,    8,  129,   35,  #  6810
  2464.        5,   72,    7,  129,   37,    5,   73,    4,  129,   39,  #  6820
  2465.        4,   74,    1,  129,  129,  193,  129,   46,   22,  129,  #  6830
  2466.       42,   30,  129,   39,   36,  129,   37,   40,  129,   35,  #  6840
  2467.       44,  129,   34,   46,  129,   33,   48,  129,   32,   15,  #  6850
  2468.       67,   15,  129,   31,   11,   72,   11,  129,   31,    8,  #  6860
  2469.       75,    8,  129,   30,    7,   77,    7,  129,   30,    6,  #  6870
  2470.       78,    6,  129,   30,    5,   79,    5,  131,   31,    4,  #  6880
  2471.       79,    4,  129,   31,    5,   78,    5,  129,   32,    5,  #  6890
  2472.       77,    5,  129,   33,    5,   76,    5,  129,   35,    5,  #  6900
  2473.       74,    5,  117,    4,  129,   37,    5,   72,    5,  117,  #  6910
  2474.        4,  129,   30,   91,  136,   30,    4,  130,  193,  129,  #  6920
  2475.       48,   18,  129,   43,   28,  129,   41,   32,  129,   39,  #  6930
  2476.       36,  129,   37,   40,  129,   35,   44,  129,   34,   46,  #  6940
  2477.      129,   33,   13,   55,    4,   68,   13,  129,   32,    9,  #  6950
  2478.       55,    4,   73,    9,  129,   32,    7,   55,    4,   75,  #  6960
  2479.        7,  129,   31,    6,   55,    4,   77,    6,  129,   31,  #  6970
  2480.        5,   55,    4,   78,    5,  129,   30,    5,   55,    4,  #  6980
  2481.       79,    5,  129,   30,    4,   55,    4,   80,    4,  132,  #  6990
  2482.       30,    4,   55,    4,   79,    5,  129,   31,    3,   55,  #  7000
  2483.        4,   78,    5,  129,   31,    4,   55,    4,   77,    6,  #  7010
  2484.      129,   32,    3,   55,    4,   75,    7,  129,   32,    4,  #  7020
  2485.       55,    4,   73,    9,  129,   33,    4,   55,    4,   68,  #  7030
  2486.       13,  129,   34,    4,   55,   25,  129,   35,    5,   55,  #  7040
  2487.       24,  129,   37,    5,   55,   22,  129,   39,    4,   55,  #  7050
  2488.       20,  129,   55,   18,  129,   55,   16,  129,   55,   11,  #  7060
  2489.      129,  193,  129,   80,    4,  129,   30,    4,   80,    4,  #  7070
  2490.      130,   30,   78,  129,   30,   82,  129,   30,   85,  129,  #  7080
  2491.       30,   87,  129,   30,   88,  129,   30,   89,  129,   30,  #  7090
  2492.       90,  130,   30,    4,   80,    4,  115,    6,  129,   30,  #  7100
  2493.        4,   80,    4,  117,    4,  129,   80,    4,  105,    6,  #  7110
  2494.      117,    4,  129,   80,    4,  103,   10,  116,    5,  129,  #  7120
  2495.       80,    4,  102,   19,  129,   80,    4,  101,   19,  129,  #  7130
  2496.      101,   19,  129,  101,   18,  129,  102,   16,  129,  103,  #  7140
  2497.       12,  129,  105,    6,  129,  193,  129,   12,   10,   59,  #  7150
  2498.       11,  129,    9,   16,   55,   19,  129,    7,   20,   53,  #  7160
  2499.       23,  129,    6,    7,   23,    5,   32,    6,   51,   27,  #  7170
  2500.      129,    4,    7,   25,   16,   50,   29,  129,    3,    6,  #  7180
  2501.       27,   16,   49,   31,  129,    2,    6,   28,   16,   48,  #  7190
  2502.       33,  129,    1,    6,   27,   18,   47,   35,  129,    1,  #  7200
  2503.        6,   27,   31,   71,   12,  129,    1,    5,   26,   15,  #  7210
  2504.       44,   10,   75,    8,  129,    1,    5,   25,   14,   45,  #  7220
  2505.        7,   77,    7,  129,    1,    5,   25,   13,   45,    5,  #  7230
  2506.       79,    5,  129,    1,    5,   24,   14,   45,    4,   80,  #  7240
  2507.        4,  129,    1,    5,   24,   13,   45,    4,   80,    4,  #  7250
  2508.      129,    1,    5,   23,   14,   45,    4,   80,    4,  129,  #  7260
  2509.        1,    5,   23,   13,   45,    4,   80,    4,  129,    1,  #  7270
  2510.        6,   22,   13,   45,    5,   79,    5,  129,    1,    6,  #  7280
  2511.       21,   14,   45,    7,   77,    7,  129,    1,    7,   21,  #  7290
  2512.       13,   46,    8,   75,    8,  129,    1,    8,   20,   13,  #  7300
  2513.       46,   12,   71,   12,  129,    1,   10,   18,   15,   47,  #  7310
  2514.       35,  129,    2,   30,   48,   33,  129,    3,   29,   49,  #  7320
  2515.       32,  129,    4,   27,   50,   31,  129,    5,   25,   51,  #  7330
  2516.       27,   80,    2,   86,    4,  129,    7,   21,   53,   23,  #  7340
  2517.       80,    3,   85,    6,  129,    9,   17,   55,   19,   80,  #  7350
  2518.       12,  129,   12,   12,   59,   11,   81,   11,  129,   82,  #  7360
  2519.       10,  129,   84,    7,  129,   86,    4,  129,  193,  129,  #  7370
  2520.       30,    4,  117,    4,  130,   30,   91,  136,   30,    4,  #  7380
  2521.       72,    5,  129,   30,    4,   74,    5,  129,   75,    5,  #  7390
  2522.      129,   76,    5,  129,   76,    6,  129,   77,    6,  130,  #  7400
  2523.       77,    7,  130,   76,    8,  129,   30,    4,   75,    9,  #  7410
  2524.      129,   30,    4,   72,   12,  129,   30,   54,  129,   30,  #  7420
  2525.       53,  130,   30,   52,  129,   30,   51,  129,   30,   49,  #  7430
  2526.      129,   30,   46,  129,   30,   42,  129,   30,    4,  130,  #  7440
  2527.      193,  129,   30,    4,   80,    4,  129,   30,    4,   80,  #  7450
  2528.        4,  100,    6,  129,   30,   54,   98,   10,  129,   30,  #  7460
  2529.       54,   97,   12,  129,   30,   54,   96,   14,  131,   30,  #  7470
  2530.       54,   97,   12,  129,   30,   54,   98,   10,  129,   30,  #  7480
  2531.       54,  100,    6,  129,   30,    4,  130,  193,  129,    7,  #  7490
  2532.        6,  129,    4,   11,  129,    3,   13,  129,    2,   14,  #  7500
  2533.      129,    1,   15,  130,    1,    3,    6,    9,  129,    1,  #  7510
  2534.        3,    7,    6,  129,    1,    3,  130,    1,    4,  129,  #  7520
  2535.        1,    5,   80,    4,  129,    1,    7,   80,    4,  100,  #  7530
  2536.        6,  129,    2,   82,   98,   10,  129,    3,   81,   97,  #  7540
  2537.       12,  129,    4,   80,   96,   14,  129,    5,   79,   96,  #  7550
  2538.       14,  129,    7,   77,   96,   14,  129,   10,   74,   97,  #  7560
  2539.       12,  129,   14,   70,   98,   10,  129,   19,   65,  100,  #  7570
  2540.        6,  129,  193,  129,   30,    4,  117,    4,  130,   30,  #  7580
  2541.       91,  136,   30,    4,   57,    9,  129,   30,    4,   55,  #  7590
  2542.       12,  129,   52,   17,  129,   50,   20,  129,   48,   24,  #  7600
  2543.      129,   46,   27,  129,   44,   21,   69,    6,  129,   41,  #  7610
  2544.       22,   70,    6,   80,    4,  129,   30,    4,   39,   21,  #  7620
  2545.       72,    6,   80,    4,  129,   30,    4,   36,   22,   73,  #  7630
  2546.       11,  129,   30,   26,   75,    9,  129,   30,   23,   76,  #  7640
  2547.        8,  129,   30,   21,   78,    6,  129,   30,   19,   79,  #  7650
  2548.        5,  129,   30,   16,   80,    4,  129,   30,   14,   80,  #  7660
  2549.        4,  129,   30,   12,  129,   30,   10,  129,   30,    7,  #  7670
  2550.      129,   30,    5,  129,   30,    4,  130,  193,  129,   30,  #  7680
  2551.        4,  117,    4,  130,   30,   91,  136,   30,    4,  130,  #  7690
  2552.      193,  129,   30,    4,   80,    4,  130,   30,   54,  136,  #  7700
  2553.       30,    4,   72,    5,  129,   30,    4,   74,    5,  129,  #  7710
  2554.       75,    5,  129,   76,    5,  129,   30,    4,   75,    7,  #  7720
  2555.      129,   30,    4,   74,    9,  129,   30,   54,  132,   30,  #  7730
  2556.       53,  129,   30,   52,  129,   30,   51,  129,   30,   48,  #  7740
  2557.      129,   30,    4,   72,    5,  129,   30,    4,   74,    5,  #  7750
  2558.      129,   75,    5,  129,   76,    5,  129,   30,    4,   75,  #  7760
  2559.        7,  129,   30,    4,   74,    9,  129,   30,   54,  132,  #  7770
  2560.       30,   53,  129,   30,   52,  129,   30,   51,  129,   30,  #  7780
  2561.       48,  129,   30,    4,  130,  193,  129,   30,    4,   80,  #  7790
  2562.        4,  130,   30,   54,  136,   30,    4,   72,    5,  129,  #  7800
  2563.       30,    4,   74,    5,  129,   75,    5,  129,   76,    5,  #  7810
  2564.      129,   76,    6,  129,   77,    6,  130,   77,    7,  130,  #  7820
  2565.       76,    8,  129,   30,    4,   75,    9,  129,   30,    4,  #  7830
  2566.       72,   12,  129,   30,   54,  129,   30,   53,  130,   30,  #  7840
  2567.       52,  129,   30,   51,  129,   30,   49,  129,   30,   46,  #  7850
  2568.      129,   30,   42,  129,   30,    4,  130,  193,  129,   48,  #  7860
  2569.       18,  129,   43,   28,  129,   41,   32,  129,   39,   36,  #  7870
  2570.      129,   37,   40,  129,   35,   44,  129,   34,   46,  129,  #  7880
  2571.       33,   13,   68,   13,  129,   32,    9,   73,    9,  129,  #  7890
  2572.       32,    7,   75,    7,  129,   31,    6,   77,    6,  129,  #  7900
  2573.       31,    5,   78,    5,  129,   30,    5,   79,    5,  129,  #  7910
  2574.       30,    4,   80,    4,  132,   30,    5,   79,    5,  130,  #  7920
  2575.       31,    5,   78,    5,  129,   31,    6,   77,    6,  129,  #  7930
  2576.       32,    7,   75,    7,  129,   32,    9,   73,    9,  129,  #  7940
  2577.       33,   13,   68,   13,  129,   34,   46,  129,   35,   44,  #  7950
  2578.      129,   37,   40,  129,   39,   36,  129,   41,   32,  129,  #  7960
  2579.       43,   28,  129,   48,   18,  129,  193,  129,    1,    3,  #  7970
  2580.       80,    4,  130,    1,   83,  137,   37,    5,   72,    5,  #  7980
  2581.      129,   35,    5,   74,    5,  129,   33,    5,   76,    5,  #  7990
  2582.      129,   32,    5,   77,    5,  129,   31,    5,   78,    5,  #  8000
  2583.      129,   31,    4,   79,    4,  129,   30,    5,   79,    5,  #  8010
  2584.      131,   30,    6,   78,    6,  129,   30,    7,   77,    7,  #  8020
  2585.      129,   31,    8,   75,    8,  129,   31,   11,   72,   11,  #  8030
  2586.      129,   32,   15,   67,   15,  129,   33,   48,  129,   34,  #  8040
  2587.       46,  129,   35,   44,  129,   37,   40,  129,   39,   36,  #  8050
  2588.      129,   42,   30,  129,   46,   22,  129,  193,  129,   46,  #  8060
  2589.       22,  129,   42,   30,  129,   39,   36,  129,   37,   40,  #  8070
  2590.      129,   35,   44,  129,   34,   46,  129,   33,   48,  129,  #  8080
  2591.       32,   15,   67,   15,  129,   31,   11,   72,   11,  129,  #  8090
  2592.       31,    8,   75,    8,  129,   30,    7,   77,    7,  129,  #  8100
  2593.       30,    6,   78,    6,  129,   30,    5,   79,    5,  131,  #  8110
  2594.       31,    4,   79,    4,  129,   31,    5,   78,    5,  129,  #  8120
  2595.       32,    5,   77,    5,  129,   33,    5,   76,    5,  129,  #  8130
  2596.       35,    5,   74,    5,  129,   37,    5,   72,    5,  129,  #  8140
  2597.        1,   83,  136,    1,    3,   80,    4,  130,  193,  129,  #  8150
  2598.       30,    4,   80,    4,  130,   30,   54,  136,   30,    4,  #  8160
  2599.       68,    6,  129,   30,    4,   70,    6,  129,   71,    7,  #  8170
  2600.      129,   72,    7,  129,   73,    7,  129,   74,    7,  129,  #  8180
  2601.       74,    8,  129,   75,    8,  130,   69,   15,  129,   67,  #  8190
  2602.       17,  129,   66,   18,  129,   65,   19,  130,   65,   18,  #  8200
  2603.      130,   66,   16,  129,   67,   13,  129,   69,    8,  129,  #  8210
  2604.      193,  129,   30,   13,   64,    8,  129,   30,   13,   61,  #  8220
  2605.       14,  129,   30,   13,   59,   18,  129,   30,   13,   57,  #  8230
  2606.       22,  129,   33,    8,   56,   24,  129,   32,    7,   55,  #  8240
  2607.       26,  129,   32,    6,   54,   28,  129,   31,    6,   53,  #  8250
  2608.       16,   77,    6,  129,   31,    5,   53,   14,   79,    4,  #  8260
  2609.      129,   30,    5,   52,   14,   80,    4,  129,   30,    5,  #  8270
  2610.       52,   13,   80,    4,  129,   30,    4,   52,   13,   80,  #  8280
  2611.        4,  129,   30,    4,   52,   12,   80,    4,  129,   30,  #  8290
  2612.        4,   51,   13,   80,    4,  130,   30,    4,   50,   13,  #  8300
  2613.       79,    5,  129,   30,    4,   50,   13,   78,    5,  129,  #  8310
  2614.       30,    5,   49,   14,   77,    6,  129,   31,    4,   49,  #  8320
  2615.       13,   76,    6,  129,   31,    5,   48,   14,   75,    7,  #  8330
  2616.      129,   32,    5,   47,   14,   73,    8,  129,   32,    6,  #  8340
  2617.       45,   16,   71,   13,  129,   33,   27,   71,   13,  129,  #  8350
  2618.       34,   26,   71,   13,  129,   35,   24,   71,   13,  129,  #  8360
  2619.       37,   20,  129,   39,   16,  129,   43,    9,  129,  193,  #  8370
  2620.      129,   80,    4,  131,   41,   56,  129,   37,   60,  129,  #  8380
  2621.       35,   62,  129,   33,   64,  129,   32,   65,  129,   31,  #  8390
  2622.       66,  129,   30,   67,  130,   30,   11,   80,    4,  129,  #  8400
  2623.       30,    9,   80,    4,  129,   30,    8,   80,    4,  129,  #  8410
  2624.       31,    7,   80,    4,  129,   31,    6,  129,   32,    5,  #  8420
  2625.      129,   33,    5,  129,   35,    4,  129,   38,    3,  129,  #  8430
  2626.      193,  129,   80,    4,  130,   42,   42,  129,   38,   46,  #  8440
  2627.      129,   35,   49,  129,   33,   51,  129,   32,   52,  129,  #  8450
  2628.       31,   53,  130,   30,   54,  129,   30,   12,  129,   30,  #  8460
  2629.        9,  129,   30,    8,  129,   30,    7,  130,   31,    6,  #  8470
  2630.      130,   32,    6,  129,   33,    5,  129,   34,    5,  129,  #  8480
  2631.       35,    5,   80,    4,  129,   37,    5,   80,    4,  129,  #  8490
  2632.       30,   54,  136,   30,    4,  130,  193,  129,   80,    4,  #  8500
  2633.      130,   77,    7,  129,   74,   10,  129,   70,   14,  129,  #  8510
  2634.       66,   18,  129,   62,   22,  129,   59,   25,  129,   55,  #  8520
  2635.       29,  129,   51,   33,  129,   47,   37,  129,   44,   32,  #  8530
  2636.       80,    4,  129,   40,   32,   80,    4,  129,   36,   32,  #  8540
  2637.      129,   32,   33,  129,   30,   31,  129,   33,   24,  129,  #  8550
  2638.       36,   17,  129,   40,   12,  129,   44,   12,  129,   48,  #  8560
  2639.       12,  129,   51,   13,  129,   55,   13,  129,   59,   13,  #  8570
  2640.       80,    4,  129,   63,   13,   80,    4,  129,   67,   17,  #  8580
  2641.      129,   71,   13,  129,   74,   10,  129,   78,    6,  129,  #  8590
  2642.       80,    4,  131,  193,  129,   80,    4,  130,   77,    7,  #  8600
  2643.      129,   74,   10,  129,   70,   14,  129,   66,   18,  129,  #  8610
  2644.       62,   22,  129,   59,   25,  129,   55,   29,  129,   51,  #  8620
  2645.       33,  129,   47,   37,  129,   44,   32,   80,    4,  129,  #  8630
  2646.       40,   32,   80,    4,  129,   36,   32,  129,   32,   33,  #  8640
  2647.      129,   30,   31,  129,   33,   24,  129,   36,   17,  129,  #  8650
  2648.       40,   12,  129,   44,   12,  129,   47,   13,  129,   44,  #  8660
  2649.       20,  129,   40,   28,  129,   36,   31,  129,   32,   32,  #  8670
  2650.      129,   30,   30,  129,   33,   24,  129,   36,   17,  129,  #  8680
  2651.       40,   12,  129,   44,   12,  129,   48,   12,  129,   51,  #  8690
  2652.       13,  129,   55,   13,  129,   59,   13,   80,    4,  129,  #  8700
  2653.       63,   13,   80,    4,  129,   67,   17,  129,   71,   13,  #  8710
  2654.      129,   74,   10,  129,   78,    6,  129,   80,    4,  131,  #  8720
  2655.      193,  129,   30,    4,   80,    4,  130,   30,    4,   79,  #  8730
  2656.        5,  129,   30,    5,   77,    7,  129,   30,    6,   74,  #  8740
  2657.       10,  129,   30,    8,   72,   12,  129,   30,   11,   69,  #  8750
  2658.       15,  129,   30,   13,   67,   17,  129,   30,    4,   37,  #  8760
  2659.        8,   64,   20,  129,   30,    4,   39,    8,   62,   22,  #  8770
  2660.      129,   41,    8,   59,   25,  129,   43,    8,   57,   27,  #  8780
  2661.      129,   45,    8,   55,   22,   80,    4,  129,   47,   27,  #  8790
  2662.       80,    4,  129,   49,   23,  129,   47,   22,  129,   44,  #  8800
  2663.       23,  129,   42,   22,  129,   30,    4,   39,   27,  129,  #  8810
  2664.       30,    4,   37,   31,  129,   30,   27,   62,    8,  129,  #  8820
  2665.       30,   25,   64,    8,  129,   30,   22,   66,    8,   80,  #  8830
  2666.        4,  129,   30,   20,   68,    8,   80,    4,  129,   30,  #  8840
  2667.       17,   70,    8,   80,    4,  129,   30,   15,   73,   11,  #  8850
  2668.      129,   30,   12,   75,    9,  129,   30,   10,   77,    7,  #  8860
  2669.      129,   30,    7,   79,    5,  129,   30,    5,   80,    4,  #  8870
  2670.      129,   30,    4,   80,    4,  130,  193,  129,    4,    5,  #  8880
  2671.       80,    4,  129,    2,    9,   80,    4,  129,    1,   11,  #  8890
  2672.       77,    7,  129,    1,   12,   74,   10,  129,    1,   12,  #  8900
  2673.       70,   14,  129,    1,   12,   66,   18,  129,    1,   11,  #  8910
  2674.       62,   22,  129,    2,    9,   59,   25,  129,    4,   11,  #  8920
  2675.       55,   29,  129,    7,   12,   51,   33,  129,   10,   12,  #  8930
  2676.       47,   37,  129,   14,   12,   44,   32,   80,    4,  129,  #  8940
  2677.       17,   13,   40,   32,   80,    4,  129,   21,   13,   36,  #  8950
  2678.       32,  129,   25,   40,  129,   29,   32,  129,   33,   24,  #  8960
  2679.      129,   36,   17,  129,   40,   12,  129,   44,   12,  129,  #  8970
  2680.       48,   12,  129,   51,   13,  129,   55,   13,  129,   59,  #  8980
  2681.       13,   80,    4,  129,   63,   13,   80,    4,  129,   67,  #  8990
  2682.       17,  129,   71,   13,  129,   74,   10,  129,   78,    6,  #  9000
  2683.      129,   80,    4,  131,  193,  129,   30,    1,   71,   13,  #  9010
  2684.      129,   30,    3,   71,   13,  129,   30,    6,   71,   13,  #  9020
  2685.      129,   30,    9,   75,    9,  129,   30,   11,   77,    7,  #  9030
  2686.      129,   30,   14,   79,    5,  129,   30,   17,   79,    5,  #  9040
  2687.      129,   30,   19,   80,    4,  129,   30,   22,   80,    4,  #  9050
  2688.      129,   30,   25,   80,    4,  129,   30,   27,   80,    4,  #  9060
  2689.      129,   30,    4,   36,   24,   80,    4,  129,   30,    4,  #  9070
  2690.       38,   25,   80,    4,  129,   30,    4,   41,   24,   80,  #  9080
  2691.        4,  129,   30,    4,   44,   24,   80,    4,  129,   30,  #  9090
  2692.        4,   46,   25,   80,    4,  129,   30,    4,   49,   25,  #  9100
  2693.       80,    4,  129,   30,    4,   52,   24,   80,    4,  129,  #  9110
  2694.       30,    4,   54,   30,  129,   30,    4,   57,   27,  129,  #  9120
  2695.       30,    4,   59,   25,  129,   30,    4,   62,   22,  129,  #  9130
  2696.       30,    4,   65,   19,  129,   30,    5,   67,   17,  129,  #  9140
  2697.       30,    5,   70,   14,  129,   30,    7,   73,   11,  129,  #  9150
  2698.       30,    9,   76,    8,  129,   30,   13,   78,    6,  129,  #  9160
  2699.       30,   13,   81,    3,  129,   30,   13,  129,  193,    2,  #  9170
  2700.        9,   59,   25,  129,    4,   11,   55,   29,  129,    7,  #  9180
  2701.       12,   51,   33,  129,   10,   12,   47,   37,  129,   14,  #  9190
  2702.       12,   44,   32,   80,    4,  129,   17,   13,   40,   32,  #  9200
  2703.       80,    4,  129,   21,   13,   36,   32,  129,   25,   40,  #  9210
  2704.      129,   29,   32,  129,   33,   24,  129,   36,   17,  129,  #  9220
  2705.       40,   12,  129,   44,   12,  129,   48,   12,  129,   51,  #  9230
  2706.       13,  129,   55,   13,  129,   59,   13,   80,    4,  129,  #  9240
  2707.       63,   13,   80,    4,  129,   67,   17,  129,   71,   13,  #  9250
  2708.      129,   74,   10,  129,   78,    6,  129,   80,    4,  131,  #  9260
  2709.      193,  129,   65,   21,  129,   64,   23,  129,   63,   25,  #  9270
  2710.      129,   62,   27,  129,   61,   29,  129,   60,   31,  129,  #  9280
  2711.       59,   16,   76,   16,  129,   58,   16,   77,   16,  129,  #  9290
  2712.       57,   16,   78,   16,  129,   56,   16,   78,   16,  129,  #  9300
  2713.       55,   16,   79,   16,  129,   54,   16,   80,   16,  129,  #  9310
  2714.       53,   16,   81,   16,  129,   52,   16,   82,   16,  129,  #  9320
  2715.       51,   16,   83,   16,  129,   50,   16,   84,   16,  129,  #  9330
  2716.       49,   16,   85,   16,  129,   48,   16,   86,   16,  129,  #  9340
  2717.       47,   16,   87,   16,  129,   46,   16,   88,   16,  129,  #  9350
  2718.       45,   16,   89,   16,  129,   46,   14,   90,   14,  129,  #  9360
  2719.      193,   129,  46,   14,   90,   14,  129,   45,   16,   89,  #  9370
  2720.       16,   129,  46,   16,   88,   16,  129,   47,   16,   87,  #  9380
  2721.       16,   129,  48,   16,   86,   16,  129,   49,   16,   85,  #  9390
  2722.       16,   129,  50,   16,   84,   16,  129,   51,   16,   83,  #  9400
  2723.       16,   129,  52,   16,   82,   16,  129,   53,   16,   81,  #  9410
  2724.       16,   129,  54,   16,   80,   16,  129,   55,   16,   79,  #  9420
  2725.       16,   129,  56,   16,   78,   16,  129,   57,   16,   78,  #  9430
  2726.       16,   129,  58,   16,   77,   16,  129,   59,   16,   76,  #  9440
  2727.       16,   129,  60,   31,  129,   61,   29,  129,   62,   27,  #  9450
  2728.      129,    63,  25,  129,   64,   23,  129,   65,   21,  129,  #  9460
  2729.      193                                                         #  9470
  2730. );
  2731.  
  2732. sub perlBanner {
  2733.     my $message = shift;
  2734.     return if (!defined $message);
  2735.  
  2736.     my $width = 50;
  2737.  
  2738.     my $output;
  2739.  
  2740.     my @print;
  2741.     for (my $i = 0; $i < $width; $i++) {
  2742.         my $j = $i * 132 / $width;
  2743.         $print[$j] = 1;
  2744.     }
  2745.  
  2746.     # Have now read in the data. Next get the message to be printed.
  2747.     my @message;
  2748.     {
  2749.         $message =~ s/\n//g;
  2750.         @message = split(//, $message);
  2751.     }
  2752.  
  2753.     # check message to make sure it's legal
  2754.     for (my $i = 0; $i < @message; $i++) {
  2755.         my $chr = $message[$i];
  2756.         my $asc = ord($chr);
  2757.         if ($asc >= $NCHARS || $asc_ptr[$asc] == 0) {
  2758.             cprint("the character '$chr' is not in my character set");
  2759.             return undef;
  2760.         }
  2761.     }
  2762.  
  2763.     # Now have message. Print it one character at a time.
  2764.     my @line;
  2765.     for (my $i = 0; $i < @message; $i++) {
  2766.         for (my $j = 0; $j < $DWIDTH; $j++) {
  2767.             $line[$j] = ' ';
  2768.         }
  2769.  
  2770.         my $chr = $message[$i];
  2771.         my $asc = ord($chr);
  2772.  
  2773.         my $pc = $asc_ptr[$asc];
  2774.         my $term = 0;
  2775.         my $max = 0;
  2776.         my $linen = 0;
  2777.  
  2778.         while (!$term) {
  2779.             if ($pc < 0 || $pc > $NBYTES) {
  2780.                 cprint("I'm somewhere where I don't know where I am! banner array position: $pc (lol)");
  2781.                 return undef;
  2782.             }
  2783.  
  2784.             my $x = $data_table[$pc] & 0377;
  2785.             if ($x >= 128) {
  2786.                 if ($x > 192) {
  2787.                     $term++;
  2788.                 }
  2789.  
  2790.                 $x = $x & 63;
  2791.                 while ($x--) {
  2792.                     if ($print[$linen++]) {
  2793.                         for (my $j = 0; $j <= $max; $j++) {
  2794.                             if ($print[$j])  {
  2795.                                 $output .= $line[$j];
  2796.                             }
  2797.                         }
  2798.  
  2799.                         $output .= "\n";
  2800.                     }
  2801.                 }
  2802.  
  2803.                 for (my $j = 0; $j < $DWIDTH; $j++) {
  2804.                     $line[$j] = ' ';
  2805.                 }
  2806.  
  2807.                 $pc++;
  2808.             } else {
  2809.                 my $y = $data_table[$pc + 1];
  2810.                 $max = $x + $y;
  2811.                 while ($x < $max) {
  2812.                     $line[$x++] = '#';
  2813.                 }
  2814.                 $pc += 2;
  2815.             }
  2816.         }
  2817.     }
  2818.  
  2819.     return $output;
  2820. }
  2821.  
  2822. sub chalkboard {
  2823.     my $message = shift;
  2824. #######looks like shit on all fonts
  2825.  
  2826.     my $boardTemplate = <<CHALKBOARD;
  2827.  _____________________________________________________________
  2828. | \$text1    ^^^^^^^^\\ |
  2829. | \$text2    |       | |
  2830. | \$text3    |_ __   | |
  2831. | \$text4    (.(. )  | |
  2832. | \$partial _       (_      ) |
  2833. |                                           \\\\      /___/' /  |
  2834. |                                           _\\\\_      \\    |  |
  2835. |                                          ((   )     /====|  |
  2836. |                                           \\  <.__._-      \\ |
  2837. |___________________________________________ <//___.         ||
  2838. CHALKBOARD
  2839.  
  2840.     my @message;
  2841.     for (my $i = 1; $i <= (int(225 / (length($message) + 1)) + 1); $i++) {
  2842.         push(@message, uc($message));
  2843.     }
  2844.     $message = substr(join(' ', @message), 0, 225);
  2845.     my $text = {};
  2846.     for (my $i = 1; $i <= 5; $i++) {
  2847.         $text->{$i} = substr($message, (($i - 1) * 46), 46);
  2848.     }
  2849.  
  2850.  
  2851.     my $output = $boardTemplate;
  2852.     $message = uc($message) . (' ' x (46 - length($message)));
  2853.     my $partial = substr($message, 0, 41);
  2854.     $partial = uc($partial) . (' ' x (41 - length($partial)));
  2855.     $output =~ s/\$text([1-4])/$text->{$1}/g;
  2856.     $output =~ s/\$partial/$partial/g;
  2857.  
  2858.     return $output;
  2859. }
  2860.  
  2861.  
  2862. # run a command and return output
  2863. sub run {
  2864.     my %params = @_;
  2865.  
  2866.     my $command = $params{command};
  2867.     my $args    = $params{args};
  2868.     my $stdin   = $params{stdin};
  2869.  
  2870.     # see if we can find the program
  2871.     $command = whereis($command);
  2872.  
  2873.     if (!-x $command) {
  2874.         cprint("$command not found or not executable!");
  2875.         return;
  2876.     }
  2877.  
  2878.     #my $pid = open3(\*WRITE, \*READ, \*ERR, "$command $args");
  2879.  
  2880.     #if ($stdin) { print WRITE $stdin }
  2881.     #close WRITE;
  2882.  
  2883.     #my $output = join('', <READ>);
  2884.     #close READ;
  2885.  
  2886.     # check for errors
  2887.     #while (my $line = <ERR>) {
  2888.     #   next if $line eq "Message: "; # hack for banner :(
  2889.     #   cprint_lines($line);
  2890.     #}
  2891.     #close ERR;
  2892.  
  2893.     #waitpid($pid, 0);
  2894. my $output = ` $command $args $stdin `;
  2895.  
  2896.     return $output;
  2897. }
  2898.  
  2899. sub strip {
  2900.     my $text = shift;
  2901.     return if (!defined $text);
  2902.  
  2903.     my $output;
  2904.     foreach my $line (split(/\r?\n/, $text)) {
  2905.         $output .= "$line\n" unless ($line =~ /^\s*$/);
  2906.     }
  2907.  
  2908.     return $output;
  2909. }
  2910.  
  2911. sub whereis {
  2912.     # evaluate $PATH, since this doesn't seem to be inherited
  2913.     # in sh subproccess in irssi.. odd
  2914.     my $cmd = shift;
  2915.     my $path;
  2916.    
  2917.     # generate a lot of possible locations for cowsay path
  2918.     $path .= $ENV{PATH};
  2919.     $path .= ":/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin";
  2920.     $path .= ":/usr/local/cowsay/bin:/opt/cowsay/bin";
  2921.  
  2922.     foreach my $path (split(/:/, $path)) {
  2923.         next unless $path;
  2924.         if (-x "$path/$cmd") {
  2925.             return "$path/$cmd";
  2926.         }
  2927.     }
  2928. }
  2929.  
  2930.  
  2931. sub execute {
  2932.     # execute command and return output
  2933.     my $text = shift;
  2934.     return if (!defined $text);
  2935.  
  2936.     #my $pid = open3(
  2937.     #   \*WRITE, \*READ, \*ERR,
  2938.     #   $text
  2939.     #);
  2940.  
  2941.     #close WRITE;
  2942.  
  2943.     #$text = join('', <READ>);
  2944.     #close READ;
  2945.    
  2946.     # check for errors
  2947.     #cprint_lines(join('', <ERR>));
  2948.     #close ERR;
  2949.  
  2950.     #waitpid($pid, 0);
  2951. my $output = ` $text `;
  2952.     return $output;
  2953. }
  2954.  
  2955. sub smiley {
  2956. my $smilefile = shift;
  2957.  
  2958. $smilefile .= ".txt" unless ($smilefile =~ /\.txt$/);
  2959. #should i bother to find any apth, or let the user specify?
  2960. my $path = "~/.xchat2/smilies/";
  2961. my $full = $path . $smilefile;
  2962.  
  2963. #unless (-f $full) {
  2964. #       cprint("could not find smilefile: $full");
  2965. #       return;
  2966. #   }
  2967.  
  2968. #all xchat2 should support exec, so it's a nice shirtcut for us
  2969. IRC::command("/exec -o  cat $full");
  2970.  
  2971.  
  2972. #must actally exit now, for now, we return empty string
  2973. return " ";
  2974. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement