Take and Drop

The basic idea of Take (`β`) is to get the first few elements of a list, while Drop (`β`) removes those and returns the rest. Then they are extended in like a billion ways.

• `π©` can be an atom, or array of any rank (the result will be an array).
• `π¨` can be negative to take or drop from the end instead of the beginning.
• For Take, if `π¨` is larger than the length of `π©`, then fills are added.
• `π¨` can have multiple numbers corresponding to leading axes of `π©`.
• `π¨` is allowed to be longer than the rank of `π©`; `π©` will be extended to fit.

These extensions can be combined as well, so there are a lot of possibilities. A good picture to have in mind is cutting out a corner of the array `π©`. This is because the result `π¨βπ©` or `π¨βπ©` always aligns with one side of `π©` along each axis, so it also aligns with the corner where those sides meet.

The result `dβπ©` is always the same as `tβπ©` for some other argument `t`, but computing `t` wouldn't be too convenient. The reverse isn't true: only Take can insert fills, so results that include them can't come from Drop.

One axis

Let's start with a natural number `π¨`. Take gives the first `π¨` major cells of `π©` (or elements of a list), while Drop gives all but the first `π¨`.

βοΈ
```    4 β "take and drop"
"take"

4 β "take and drop"
" and drop"

1 β >"maj"βΏ"orc"βΏ"ell"
ββ
β΅"orc
ell"
β
```

If `π¨` is too large it's usually not a problem. For Take, fill elements are added to the end to bring `π©` up to the required lengthβalthough this will fail if `π©` has no fill element. For Drop, the result is an empty array.

βοΈ
```    β6
β¨ 0 1 2 3 4 5 β©

10 β β6
β¨ 0 1 2 3 4 5 0 0 0 0 β©

10 β β6

β’ 5 β β3βΏ9βΏ2
```

If `π©` is an atom or unit array, it's converted to a list first. For Take this is useful to make an array of mostly fills; for Drop it's pretty much useless.

βοΈ
```    10 β 9
β¨ 9 0 0 0 0 0 0 0 0 0 β©

3 β <"element"
```

Negative argument

If `π¨` is negative, it wraps around the other side to take or drop from the end of `π©`. It's a lot like negative indices in Select (`β`), but while negative indices are asymmetricβ`0` is the first entry but `Β―1` is the lastβthis case is symmetric. It's because the place to cut is always before the index `π¨`, cancelling out the negative index asymmetry.

βοΈ
```    3 β "abcdeEDCBA"
"abc"

Β―3 β "abcdeEDCBA"  # Last three
"CBA"

Β―3 β "abcdeEDCBA"  # All but the last three
"abcdeED"
```

What about `0`? It behaves like it's both positive and negative. For Take, the first 0 and last 0 cells are indistinguishable, because they're both empty. For Drop, if you remove 0 cells it doesn't matter whether you start at the front or the back, because you're not going to do anything either way.

βοΈ
```    0 β 4βΏ3βΏ2  # Nothing

0 β 4βΏ3βΏ2  # Everything
```

If `|π¨` is too large, then Take will insert fills at the beginning to keep the result aligned with `π©` at the end. Drop returns an empty array as in the positive case. So unlike Rotate (`β½`), which is completely cyclical, Take and Drop look cyclic only around 0.

βοΈ
```    Β―6 β "xy"
"    xy"
```

Multiple axes

In the general case `π¨` is a list of integers. They're matched with the leading axes of `π©`, so that each affects one axis independently from the others.

βοΈ
```    β’ m β (10Γβ5) +β β7
ββ
β΅  0  1  2  3  4  5  6
10 11 12 13 14 15 16
20 21 22 23 24 25 26
30 31 32 33 34 35 36
40 41 42 43 44 45 46
β

Β―4βΏ2 β m  # Last four rows; first two columns
ββ
β΅ 10 11
20 21
30 31
40 41
β

Β―4βΏ2 β m
ββ
β΅ 2 3 4 5 6
β
```

Now Take and Drop taken together don't include the whole array. Take includes the elements that are selected on every axis, while Drop excludes the ones selected on any axis. They are opposite corners that meet at some point in the middle of the array (here, at the spot between `2` and `11`).

Any integer values at all can be used, in any combination. Here one axis is shortened and the other's padded with fills. The result of Take has shape `|π¨`, maybe plus some trailing axes from `π©`. Of course, if that's too big for your available memory, your BQN implementation probably can't compute it for you!

βοΈ
```    3βΏΒ―12 β m
ββ
β΅ 0 0 0 0 0  0  1  2  3  4  5  6
0 0 0 0 0 10 11 12 13 14 15 16
0 0 0 0 0 20 21 22 23 24 25 26
β

β’ 9βΏΒ―4 β β7βΏ6βΏ5  # Trailing shape example
```

If the rank of `π©` is smaller than the length of `π¨`, then length-1 axes are added to the beginning until it's equal. Mostly this will be used with Take when `π©` is a unit, producing an array that contains `π©` and a lot of fills.

βοΈ
```    3βΏ4 β <1βΏ1
ββ
β
```

This property also enables a nice little trick with Drop. If `π¨` is a list of zeros, Drop won't do anythingβexcept extend the rank of `π©`. So `(rβ₯0)βa`, or `r β₯β0βΈβ a`, ensures `a` is an array with rank at least `r` but doesn't change any of the elements. As a special case, `β¨β©βv` Encloses an atom argument but otherwise has no effect.

βοΈ
```    β’ (3β₯0) β 3