http://qs321.pair.com?node_id=145092


in reply to Re: Re: YAGG (Yet Another Golf Game)
in thread YAGG (Yet Another Golf Game)

This introduces a different error: if the last coin flip is a head, it doesn't get substituted, because it's not followed by a space. So, change the + to a *:
#!/usr/bin/perl $s.=rand()<.5?H:$"for+a..gr; $_=$s; s/(H+) */"|".length$1/ge; print"$s\n$_|\n$c\n"