I took this as the definition of "raul" :

raul =: 13 : ';"1('' - '',&.>'' o+|''){~(+3*_1 1&E.)"1&.|:(*>./\.@:*)0,~2:`(}.@((i:,.]-1:) ~.))`((1,~]#_1:)"0)}~y'

I copied this from his email of 7/Aug/20 timed (here) at 23:21 . There was a line break at *>./\.@: which

might have messed up the definition.  I doubled up the quotes bracketing the character strings to make the

13 : ' ... ' definition work.

I hope I haven't inadvertently changed it!

Thanks,

Mike



On 17/08/2020 16:00, Hauke Rehr wrote:
… the last version (meant to be raul’s) doesn’t quite look right …
can’t verify right now

Am 17.08.20 um 16:49 schrieb 'Michael Day' via Programming:
Late to the party - I had a look at the problem after the correspondence closed,  and have only
just got home to my own wifi.
I developed a few functions, tpxxxmd,  not pretty in themselves, which attempt a number of variations,
some using box characters,  19 22 25 26 { a.
Unfortunately,  I noticed that Raul's one-liner can show some vertical connectors which aren't there.
"xash's" function is ok for the same example:

    (tpmd; tplbmd; tpboxmd; tpboxmdb; pt; raul) 0 1 2 3 3 1 NB. display is ok at send time!
+-------+-------+-------+----+-------+--------+
|o      |o      |o      |o   |o      |-o      |
||-o    |+-o    |├─o    |├o  ||-o    | |-o    |
|| |-o  || +-o  |│ └─o  |│└o || +-o  | | +-o  |
||   |-o||   +-o|│   ├─o|│ ├o||   |-o| | | |-o|
||   |-o||   +-o|│   └─o|│ └o||   +-o| | + +-o|
||-o    |+-o    |└─o    |└o  |+-o    | +-o    |
|       |       |       |    |       |        |
+-------+-------+-------+----+-------+--------+

tplbmd (lb = "elbow"!) renders all bends/elbows as "+" which seems reasonable,  but perhaps it is better to stick to "|" when there are further daughters at that level,  as Raul and xash do.
Anyway,  I did distinguish these cases with the box character versions.

Cheers,

Mike


On 07/08/2020 23:21, Raul Miller wrote:
Alternative (slightly more compact) implementation of tv:

    tv=: (0 = {.) *./@, (0 < {:), 1 >: +/\inv

Meanwhile, this is probably a bit long (almost 100 characters) to be
called a one line implementation, but it seems to be in the right
ballpark:

    ;"1(' -  ',&.>' o+|'){~(+3*_1 1&E.)"1&.|:(*
./\.@:*)0,~2:`(}.@((i:,.]-1:) ~.))`((1,~]#_1:)"0)}~d
-o
  |-o
  | |-o
  | +-o
  |-o
  +-o
    |-o
    +-o
      +-o


I hope this helps,




--
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

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

Reply via email to