Your (] ,(f {:))/ is equivalent to ([:f/\ |.)
(] ,(+ {:))/ [EMAIL PROTECTED]
4 4 11 11 20 24 26 35 40 46
([:+/\ |.) [EMAIL PROTECTED]
4 4 11 11 20 24 26 35 40 46
Since |. is used twice, I came up with f/\.&.|.
R.E. Boss
-----Oorspronkelijk bericht-----
Van: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Namens Steven Phillips
Verzonden: vrijdag 12 mei 2006 13:28
Aan: Programming forum
Onderwerp: Re: [Jprogramming] 2 f 3 f 4 f m
Sorry, I should have read the specs more carefully.
Here is another attempt:
seq =: <"_1@|[EMAIL PROTECTED] , <@]
update =: (] ,(+&.> {:))/
a [EMAIL PROTECTED] m
----T---T---T-----T-----T-----┐
│0 1│2 3│6 7│12 13│20 21│30 31│
│2 3│4 5│8 9│14 15│22 23│32 33│
L---+---+---+-----+-----+------
Steve
R.E. Boss wrote:
> Notice
> ;/ 2 4 6 8 10 + recf i. 2 2 NB. ;/ is added for space reasons
> +---+---+---+-----+-----+-----+
> |0 1|2 3|6 7|12 13|20 21|30 31|
> |2 3|4 5|8 9|14 15|22 23|32 33|
> +---+---+---+-----+-----+-----+
>
> whereas Phillips' (f/"1 @ ,.) does not meet the specs:
>
> (<"_1[2 4 6 8 10) (+&.>/"1 @ ,.) <i. 2 2
> +---+---+---+-----+-----+
> |2 3|4 5|6 7| 8 9|10 11|
> |4 5|6 7|8 9|10 11|12 13|
> +---+---+---+-----+-----+
>
> I would suggest
> a ([:> [: f&.>/\.&.|. <@],<"[EMAIL PROTECTED]) m
> so
> ;/ 2 4 6 8 10 ([:> [:+&.>/\.&.|. <@],<"[EMAIL PROTECTED]) i. 2 2 NB. ;/
> is
> extra
> +---+---+---+-----+-----+-----+
> |0 1|2 3|6 7|12 13|20 21|30 31|
> |2 3|4 5|8 9|14 15|22 23|32 33|
> +---+---+---+-----+-----+-----+
>
>
> R.E. Boss
>
(....)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm