I'm having difficulty understanding the following verb:
{~^:a:~
from the following bowling-score verb:
framex =: 10 {. 0 {~^:a:~ _1 _1 ,~ i...@# >:@:+ 10&~:
I understand several aspects of what it does. I know it's drawing the
head element, I know it's doing this repeatedly until stable, and I
know it's returning the accumulated result of all iterations. I know
that it's qualifying 10s that have the right remainder-of-two to count
as a strike in context. What I'm not comprehending is how it produces
more than the first element of the right-hand argument.
Thank you.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm