Here is a buggy first draft attempt implementation for
http://rosettacode.org/wiki/Man_or_boy_test

(where the big problem is figuring out what the specification
is saying.)

A=:1 :0
  '`x1 x2 x3 x4 x4'=.m
  k=.y
  B=. ". bind 'B`x1`x2`x3`x4 A k'@(".bind 'k=.k-1')
  if.k<:0 do.(x4+x5)'' else. B''end.
)

smoutput 1:`_1:`_1:`1:`0: A 10

When run, J spins and ignores jbreak.

(If x4 x4 is replaced with x4 x5 we
instead get a stack error.)

FYI,

-- 
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to