Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

executable file 112 lines (103 sloc) 5.576 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
#!/usr/bin/perl

my @lines = <DATA>;

for my $line ( @lines ) {
    chomp $line;
    print encode_line( $line ), "\n";
}

sub encode_line {
    my $s = shift;

    my $out = '';

    while ( $s =~ /(.)\1*/g ) {
        $out .= $1 . chr(32+length($&));
    }

    return $out;
}

__DATA__
                      ?IIIIIII7II?????+
                   ~III777II777I?+==++==+:
                  ???I7I???I7II++=====++===
                 ??+??????????+===~~=+++??==+
                ??+??II??????+==~=~~=+++++==++
               I+?????????+?+====~=~==+==++?==?
              ?????II?????+++++=======?===~~~~==
            ,?????II????????++++====~===::~~~~:~
            I?I??II?+++??+?+++==~~~~:~:~:,:,,:::~
           I??????+==+???++++=~~:~:~:,:::,:,,,,,::
          +I?++++=+=+????+++=~~:~~:::,,,,::,,,:,:
          I??+?+====+???+++===~~::::,::,:,,,,,,::
         I????=~===++?+=+=~==~:~~:,,,,,,,.,,,,,:~
        =??+?=~~~~??+?+===~~==,==~~~~,,,,..,,,.:=
        II++==~~=++++++=~~=~,~+=?+?=I?++=..,.,,:
     IIII?+?=====+~+++~=~~~:::=~+~===:,,,,,.,.::
    I?=?I+??+=~=~?I?=+=~~~::,~~=~::~=::,,,,,,:: ---------------
    ?+I??++=++~,::+++~~~:::,,=~~=,~,..,::.: / It's a grep! /
    ++=+?++~=:~::I+,~=:~,:,,,,:~~......::~,,, ---------------
     ~=~=:.++~:,.,~=::::.,,:,.:~,:=...==~,:: /
     =~?++??+=~~,.:?~.:,:,,,.,::,,~:=~=::,~ /
     ++~~:~===~:~,.~::,~=~.:,..,:,,:==:.,:7 /
     ~~,::...:=:,::+:~:.,~,...,.,,,,::~,,::~= /
      =~===+=~~,.::,,,:::,..,,,,,,,,,,,:,..,=+?
      ~=~=~::~~~::,.,,,~:.+,..,,,,..,,,,...,+I?
      ~==~:~~:~~,~=~~:,:~,:,,,,,,....,,,..+?I?I
      ~=~=+,:~:=,:~~~~~~::::,.,,.,,.,,,..~+????I
      ~=~==~=:~~:,~~~~~:::,::,.,,,..,,,I77I?+??II
      +I7:::~~=~:,::~~~~.=.,~,,,,...,~7III?+??II7
     777?+~:=~=~~:,::~~:::.,,,,,,,,,777II??I777777
     777I==:=~::~~~~::~:::,:,:~:::,777I???777777777
    7777+,~===~:~:~~~~:::,.~:=,,:777II???77777777777=?
    777I~,~~~=~::~:,:,,,:=~~,,:7777I???I7777777777+=++
  I7777I,,:,.==::::,:,,,,::::7777I+??I77777777777??I7I7,
 ,77777I::,..~~:,,,,,,.,:~I7777I+??I777777777777?I7777777,
 77777777,...~~:,,,,,.,77777I7???II777777777777+?7777777777
77777777777:,~~~,,=7777777I???II777777777777777+77777777777
77777777777777777777777I+7?7II77777777777777777+777777777777

                                    ,,,?~+++????
                              ?IIIIIIIIIIIII????+?++
                           IIII777II?I7777I?+===+++===+
                        ?I??I77IIII?I777II+?++========~=+
                       ?????IIII????IIII??++=~====+++====++
                      ??++++?I??????????+=+~=~~=~=+?++?I+==+
                     ???++++??I???I??+?+==~~~~==~=+?+++++==?+
                     ??+??????I?I???+++=~=====~~===++++++++=~+
                    I?+?????III???++?+++====~~======+====+~===?
                   ??????IIII????+?++++++==========?====~~~~~~==
                 ?I??????III??+???+++?++++==+===~~=~~=~~~~~~~:~~=
                II??I???III?+++?++++?++++++====~~~~~:::::::::::~~,
                ?I?I????I?+++++?++?+++++=~~~~~~~::~:::::,:::,:::~+
               I??I?????+===+?+??????+=~~=~:~~~~:,,:,:,,:,,,,,,,:~
              I??I?++?+====+?????+?++==~~~:~~~~::,,,,,,,:,,,,,,::~
             :I?I+??+++===++?++??+++===~~~~:::::::,,,:,,,,,,,,,::~
             ?I?????+=====+++??++++~===~~~:::::::,,:,,,,,,,,,,,::~
            II??+?+=~~=~=+++?+++?+==~==~~:~:::::,,,.,,,,,,,,,,,:~=
           =???+?+=~~~~~+?+++?+====~~===:,===~~~~:,,.,,..,,,,,,:~
           ???++?+==~~==++????==~~~~==~,:+~=++?I?=?+~.:,,....,,:~
         ?I?I?+?=~=====+++++++==~=~~,:::+=?=?+~I+?+==~~:.,..,,,:+
       I?=?II++++=====++~?+===~+==,~:~::+=+=~=~:=:,,::,,...,,,,:
      I+?+II++??++====,????=++=:::~:==::==~=~=:=:=~::,::,,,,:::
      ??+I??+++++++~~:+=+?+====~:~:::=,~:~~~~,=:,..,:::,:...,
      ++??+?+++=++~:~=~::~~=~:~=,:,::~,~~~~:=:......::::,
      +?~=?++++~~,.~:,:~I~,~~:~~,::,:,,.:~,~........::~:,,,,
       ~+~==:.:+?~:::..,~~~::::::,,,,,,.::~,~+.....=~=~,:,,
       :~:+?I?+?+==:~,..,~=~,::::,,,,:,.,::::,,..:~=~::,::
       =~=+?===?++=~:~:..~?:~,,:~~,,,,.,.,:,,,::=~~~:,.:=
       =?=~,,,:~===~::::..=:=,,~==,.,,,,,.,::,.,==~,.:::+??,
       ~,.::,,...,~=::,::,::==...~:,.,,.,,.,,,,,::~~,,::,~==
       ++=~===~~=~:..,::,,,,,,::::~.,.,,...,,,:,,,,,,,,,.,:~=+
        ==~~=~=~:::~::,..::::::::,:.,.,,,..,..,,,::,.,....:=+?
        =~=~~~::::~~:~~~:::.......,~:,,,.,,,,,...,,,,....,+?III
        =~==~~:~,,~~:~:~===~::::::::,,,,,,,,.....,,,,,..~?IIIII
        ,=~~~,,,:=~:+,:~~==~~~~~~:::,,,,....,.,,.,,,...~++?????7
        +~==~:~~:==~=~~:::~~~~~~~~::::,,.,,.,.,,.,,,,:III??+???I=
        ,?=+~~=~=::~~:,,:~~~:~:::~:.,:,,,,,,,,,.,,,,77III??+??II7=
        ,??7=~~~:~:~~~,,:::~~~~~~,~.,:,,,,,,,...,:III7I??+??IIII77
       ~I7I++~::~+~=~~::,::::~~:~,~.::,:,,,,,,,,+777III???I7777777I
      :777?7??=:=+~:~=~~:~::::,:~::.,~.:::,~~,:I777II????77777777777
      77777I===:~=~:~~~~:~~:~~~:~::~,~,:~:,:,:7777II????7777777777777?
      7777I+::~====~~:~:::~~~::::,,.,,,=,:::7777II????I77777777777777++?
     ~7777I~,:~=~+==~~~~:::,,,,,:=~~~~::,:77777I?I???777777777777777~+~+?
    777777?:,:::+~+~:::::,,:,:::::,,::::7777III????I77777777777777+???=:I
   7777777+:,:~,..==~,::,:,,,:~:,,,::?77777II+I??I777777777777777+?I777777=,
  77777777I:::,..:~~:,,,:,,,,,..::+777777II+????7777777777777777+?7777777777I
 7777777777I,,...~~~:,,,..,,,,.~777777II??I??I77777777777777777??7777777777777
=777777777777+..,~=~:,,,,,:?7777777III+???IIII77777777777777777+I77777777777777
777777777777777777777777777777777II+I??I77777777777777777777777+7777777777777777
Something went wrong with that request. Please try again.