Well:
   FB  =: (": [^:([EMAIL PROTECTED]@]) Fizz,Buzz)"0
   FB1 =: (": (] , [EMAIL PROTECTED] }. [) Fizz,Buzz)"0

   (FB -: FB1) >: i.100
1
   # ;: 5!:5 <'FB'
19
   # ;: 5!:5 <'FB1'
17

I could also move the "0 from the definition
to the expression  FB"0 >:i.100 .  That'd get
rid of the overall parens.



----- Original Message -----
From: Raul Miller <[EMAIL PROTECTED]>
Date: Tuesday, March 6, 2007 2:54 pm
Subject: Re: [Jprogramming] FizzBuzz

> On 3/6/07, Roger Hui <[EMAIL PROTECTED]> wrote:
> > Fizz=: 'Fizz' #~ 0 = 3&|
> > Buzz=: 'Buzz' #~ 0 = 5&|
> > FB  =: (": [^:(0&[EMAIL PROTECTED]@]) Fizz,Buzz)"0
> > FB >: i.100
> 
> That's shorter than what I was going to do.
> 
> That said, FB could be
> 
> FB=: (": [^:([EMAIL PROTECTED]) Fizz,Buzz)"0
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to