Looking at the AOC rules, once the leaderboards are full it's ok to
post the code for that part.
So... for part 1 of day 3 of AOC, no user defined adverbs were
necessary, as you could do this:
(*&#. -.)(0.5 < +/%#)sample
198
sample
0 0 1 0 0
1 1 1 1 0
1 0 1 1 0
1 0 1 1 1
1 0 1 0 1
0 1 1 1 1
0 0 1 1 1
1 1 1 0 0
1 0 0 0 0
1 1 0 0 1
0 0 0 1 0
0 1 0 1 0
For part two, though... I guess we should wait before going into
working implementations. (But, {{u Adv vrb v Adv}} seems like it would
be an ok approach to me, if there were some way of writing Adv that
was relevant. That said, the part of the rules which were sort of like
special case handling of a median (or mode) tie would seem to conflict
with that approach.)
FYI,
--
Raul
On Fri, Dec 3, 2021 at 7:36 PM Elijah Stone <[email protected]> wrote:
>
> Current behaviour derives from 'V A' rule, which has been around a long
> time and is unlikely to go anywhere. Adding an 'A V A' rule with higher
> precedence would be confusing and inconsistent.
>
> Solving your problem does not require any new rules, only new
> primitives. Arbitrary monadic forks can be constructed using hook (rh;
> u rh v ←→ u v), and 'left hook' (lh; u lh v ←→ (u~ v)~). (In fact, a
> related pair of primitives would probably be more useful, but hooks are
> easier to define using extant primitives and rules.)
>
> Then your (Adv vrb Adv) can be written as: vrb lh Adv rh Adv.
>
> More interesting would be to find a way to avoid writing 'Adv' twice. We
> have a way to avoid writing nouns twice, that is the fork; we have a way
> to avoid writing verbs twice, that is the modifier; but there is no way to
> write a higher-order modifier, so I would be surprised if it were
> possible to do so tacitly.
>
> -E
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm