I think this will finally work... It solves both problems.
h=: 13 :'((<:+/\x*#y)I.i.#y)mailto:[email protected]] On Behalf
Of Linda Alvord
Sent: Sunday, December 17, 2017 2:31 AM
To: [email protected]
Subject: Re: [Jprogramming] Splitting an Array into several array
Ric, I missed this message yesterday, but this works:
X=:0.5 0.25 0.25
x h 23?54
┌─┬┬┐
│27 47 3 19 25 28 10 1 39 6 46│35 0 45 11 40 48│41 16 29 42 7 21│
└─┴┴┘
Linda
R
--
This step counting verb uses lengths of equilateral hexagonal grid,
taking that step or apparently quantum tunneling pair of optimal steps.
I have not tried to understand it, but it works.
DIRS=:;:a=:'ne n nw sw s se'
('a'~)=. 1ad30 1ad90 1ad150 1ad210 1ad270 1ad330
count_steps=: 3 :0
posit
If I read this right it works like this:
(a) Use complex numbers to represent x,y coordinates
(b) Find the location of the end of the path
(c) Trace a path from the start to that location, by repeatedly
picking a step that gets closer to that location.
This works great for part 1, but is ineffici
Cannot set global names x and y in different locale from that in which
the verb is defined. Explain please? Thank you.
coname''
┌┐
│base│
└┘
run=: 3 :0
coerase<'r'
coclass'r'
".((,~,&(,Alpha_j_,.' '))),'=: 0' NB. reset the registers
coname'base'
program=. y
)
run''
You can set them, but you must use a locative to do so (i. e. x_r_ =:
5). It is a domain error to make a public assignment to a simple name
that is privately defined, and y(x etc.) are privately defined at the
beginning of execution of an explicit definition.
Henry Rich
On 12/18/2017 11:31 A
Try erase the definitions first, eg
erase 'x y'
On Dec 19, 2017 12:54 AM, "Henry Rich" wrote:
> You can set them, but you must use a locative to do so (i. e. x_r_ =: 5).
> It is a domain error to make a public assignment to a simple name that is
> privately defined, and y(x etc.) are privately d