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

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.