Data update

This commit is contained in:
Ingy döt Net 2024-10-16 18:07:41 -07:00
parent 81fd053722
commit 52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions

View file

@ -1,13 +1,11 @@
'X Y L H M'=. i.5 NB. Setting mnemonics for boxes
f=. &({::) NB. Fetching the contents of a box
o=. @: NB. Composing verbs (functions)
'`X Y L H M'=. ,{{y&{::`''}}&>i.5 NB. Setting mnemonics for boxes (e.g. X=.0&{::)
'l h m' =. 2 3 4 NB. more box mnemonics (used for e.g. m})
boxes=. ; , a: $~ 3: NB. Appending 3 (empty) boxes to the inputs
LowHigh=. (0 ; # o (X f)) (L,H)} ] NB. Setting the low and high bounds
midpoint=. < o (<. o (2 %~ L f + H f)) M} ] NB. Updating the midpoint
case=. >: o * o (Y f - M f { X f) NB. Less=0, equal=1, or greater=2
boxes =. ;,a:$~3: NB. Appending 3 (empty) boxes to the inputs
LowHigh =. (0;#@X) (l,h)} ] NB. Setting the low and high bounds
midpoint=. <@(<.@(2%~L+H)) m} ] NB. Updating the midpoint
case =. >:@:*@(Y-M{X) NB. Less=0, equal=1, or greater=2
squeeze=. (< o (_1 + M f) H} ])`(< o _: L} ])`(< o (1 + M f) L} ])@.case
return=. (M f) o ((<@:('Not Found'"_) M} ]) ^: (_ ~: L f))
bs=. return o (squeeze o midpoint ^: (L f <: H f) ^:_) o LowHigh o boxes
squeeze =. (<@(_1+M) h} ])`(<@_ l} ])`(<@(1+M) l} ])@.case
return =. [: M (<@'Not Found' m} ])^:(_~:L)
bs =. return@(squeeze@midpoint^:(L<:H)^:_)@LowHigh@boxes

View file

@ -1,11 +1,10 @@
'X Y L H M'=. i.5 NB. Setting mnemonics for boxes
f=. &({::) NB. Fetching the contents of a box
o=. @: NB. Composing verbs (functions)
'`X Y L H M'=. ,{{y&{::`''}}&>i.5 NB. Setting mnemonics for boxes (e.g. X=.0&{::)
'l h m' =. 2 3 4 NB. more box mnemonics (used for e.g. m})
boxes=. a: ,~ ; NB. Appending 1 (empty) box to the inputs
midpoint=. < o (<. o (2 %~ L f + H f)) M} ] NB. Updating the midpoint
case=. >: o * o (Y f - M f { X f) NB. Less=0, equal=1, or greater=2
boxes =. a:,~; NB. Appending 3 (empty) boxes to the inputs
LowHigh =. (0;#@X) (l,h)} ] NB. Setting the low and high bounds
midpoint=. <@(<.@(2%~L+H)) m} ] NB. Updating the midpoint
case =. >:@:*@(Y-M{X) NB. Less=0, equal=1, or greater=2
recur=. (X f bs Y f ; L f ; (_1 + M f))`(M f)`(X f bs Y f ; (1 + M f) ; H f)@.case
bs=. (recur o midpoint`('Not Found'"_) @. (H f < L f) o boxes) :: ([ bs ] ; 0 ; (<: o # o [))
recur =. (X bs Y;L;(_1+M))`M`(X bs Y;(1+M);H)@.case
bs =. recur@midpoint`('Not Found'"_)@.(H<L)@boxes :: ([ bs ]; 0; <:@#@[)