PWC124 - Happy Women Day

TL;DR

Here we are with TASK #1 from The Weekly Challenge #124. Enjoy!

The challenge

Write a script to print the Venus Symbol, international gender symbol for women. Please feel free to use any character.

   ^^^^^
  ^     ^
 ^       ^
^         ^
^         ^
^         ^
^         ^
^         ^
 ^       ^
  ^     ^
   ^^^^^
     ^
     ^
     ^
   ^^^^^
     ^
     ^

The questions

This is the most open challenge I saw so far here, so I guess that asking questions is neglecting the underlying challenge to be creative.

As a meta-question, I thought that Women’s Day was on March 8th, did I miss anything?

The solution

I’ll only comment on the Perl solution here, because… I’m a little late with my post 🙄

Long story short, here’s the code:

eval eval '"'.


             ('`'|'/').('['^
          '+').('`'|'%').('`'|
        '.').'\\'.'$'.('`'|'&').
       ','."'".'<'."'"."\,".'\\'.
     '$'.('^'^('`'|'.'))."\;".'\\'.
    '$'.('['^'#').'='.'<'.'\\'.'$'.(
   '`'|'&').'>'.('`'|'&').('`'|'/').(
  '['^')').('{'^        '[').('^'^('`'
  |'/')).','.              ('^'^(('`')|
 ',')).';'.(                '['^"\+").(
'['^"\)").(                  '`'|"\)").(
'`'|'.').(                    '['^'/').(
'{'^'[').(                    '['^"\(").
'\\'."\{".                    '\\'.'\\'.
('{'^'(').                    '\\'."\}".
'\\'."\{".                    "\#".'\\'.
'}'.("\`"|                    "'").('['^
')').("\{"^                   '[').('['^
',').("\`"|                  '(').('`'|
 ')').(('`')|               ',').("\`"|
  '%').'<'.''.             '\\'."\$".(
   '`'|'&').('>').     ';'.('['^'+').(
   '['^')').('`'|')').('`'|'.').('['^
    '/').'\\'.'"'.'\\'.'\\'.('`'|'.'
      ).'\\'.'"'.('!'^'+').'"';$:=
       '.'^'~';$~='@'|'(';$^=')'^
         '[';$/='`'|'.';$,='('^
            '}';$\='`'|"\!";
               $:=')'^'}'
               ;$~=('*')|
               '`';$^='+'
               ^('_');$/=
               '&'|'@';$,
               ='['&"\~";
               $\=','^'|'
               ;$:=('.')^
     '~';$~='@'|'(';$^=')'^"\[";$/=
     '`'|'.';$,='('^'}';$\='`'|'!';
     $:=')'^'}';$~='*'|'`';$^="\+"^
     '_';$/='&'|'@';$,='['&"\~";$\=
     ','^'|';$:='.'^'~';$~='@'|'(';
     $^=')'^'[';$/='`'|'.';$,="\("^
               '}';$\='`'
               |('!');$:=
               ')'^'}';$~
               ='*'|"\`";
               $^='+'^'_'
               ;$/=('&');

This comes from using Inkscape to generate the symbol, Gimp to resize it and give some touches, imagetoascii to convert the image into a shape, and Acme::EyeDrops to generate the final mess above.

The input program is this:

open$f,'<',$0;$x=<$f>for 1,2;print s{\S}{#}gr while<$f>;print"\n"

that does this:

# Open "this" program as a file
open $f, '<', $0;

# Remove the first two lines, i.e. the one with eval...
$x = <$f> for 1, 2;

# Read the rest, transforming lines on the fly to turn non-spacing
# characters into `#`
print s{\S}{#}gr while<$f>;

# Pring a final newline, for better clarity
print"\n"

Well… just not to leave the Raku side out, let’s cheat a bit:

#!/usr/bin/env raku
use v6;
put "♀"

And this is all, folks!


Comments? Octodon, , GitHub, Reddit, or drop me a line!