Skip to main content
Don't need to explicitly match _ space and L when adding $b to $a.
Source Link

Perl, 6565 58 bytes

map{map{$b^=2*y,/\\L,,;$a+=y,/\\V,,+$b*y,_ L,,||$b}split//}<>;print$a
  • Toggle $b between 0 and 2 upon seeing / \ or L.
  • Add 1 to $a upon seeing / \ or V.
  • Add $b to $a upon seeing _ space or Lanything else.

Perl, 65 bytes

map{map{$b^=2*y,/\\L,,;$a+=y,/\\V,,+$b*y,_ L,,}split//}<>;print$a
  • Toggle $b between 0 and 2 upon seeing / \ or L.
  • Add 1 to $a upon seeing / \ or V.
  • Add $b to $a upon seeing _ space or L.

Perl, 65 58 bytes

map{map{$b^=2*y,/\\L,,;$a+=y,/\\V,,||$b}split//}<>;print$a
  • Toggle $b between 0 and 2 upon seeing / \ or L.
  • Add 1 to $a upon seeing / \ or V.
  • Add $b to $a upon seeing anything else.
Source Link

Perl, 65 bytes

map{map{$b^=2*y,/\\L,,;$a+=y,/\\V,,+$b*y,_ L,,}split//}<>;print$a
  • Toggle $b between 0 and 2 upon seeing / \ or L.
  • Add 1 to $a upon seeing / \ or V.
  • Add $b to $a upon seeing _ space or L.