From cf65cfb32f34b7c9fed4614479d8242c51321bac Mon Sep 17 00:00:00 2001 From: razetime Date: Wed, 19 Jan 2022 10:14:32 +0530 Subject: primitive function and modifier help pages --- help/!assert assertwithmsg.md | 31 ++++++++++++++ help/+conjugate add.md | 22 ++++++++++ help/-negate subtract.md | 28 ++++++++++++ help/merge great.md | 38 ++++++++++++++++ help/`scan.md | 29 +++++++++++++ help/sindices replicate.md | 23 ++++++++++ help/template.md.tmp | 47 ++++++++++++++++++++ help/|abs modulus.md | 25 +++++++++++ "help/\302\250each.md" | 15 +++++++ "help/\302\253shiftbefore.md" | 37 ++++++++++++++++ "help/\302\254not span.md" | 25 +++++++++++ "help/\302\264fold.md" | 28 ++++++++++++ "help/\302\273shiftafter.md" | 37 ++++++++++++++++ "help/\303\227sign multiply.md" | 26 +++++++++++ "help/\303\267reciprocal divide.md" | 20 +++++++++ "help/\313\230cells.md" | 26 +++++++++++ "help/\313\231constant.md" | 11 +++++ "help/\313\234self swap.md" | 21 +++++++++ "help/\342\201\274undo.md" | 20 +++++++++ "help/\342\206\221prefixes take.md" | 62 +++++++++++++++++++++++++++ "help/\342\206\223suffixes drop.md" | 51 ++++++++++++++++++++++ "help/\342\206\225range windows.md" | 51 ++++++++++++++++++++++ "help/\342\210\212markfirst memberof.md" | 37 ++++++++++++++++ "help/\342\210\230atop.md" | 27 ++++++++++++ "help/\342\210\232squareroot root.md" | 21 +++++++++ "help/\342\210\247sortup and.md" | 21 +++++++++ "help/\342\210\250sortdown or.md" | 23 ++++++++++ "help/\342\210\276join jointo.md" | 60 ++++++++++++++++++++++++++ "help/\342\211\215solo couple.md" | 42 ++++++++++++++++++ "help/\342\211\240length notequal.md" | 30 +++++++++++++ "help/\342\211\241depth match.md" | 23 ++++++++++ "help/\342\211\242shape notmatch.md" | 23 ++++++++++ "help/\342\211\244lessequal.md" | 13 ++++++ "help/\342\211\245greatequal.md" | 13 ++++++ "help/\342\212\217firstcell select.md" | 38 ++++++++++++++++ "help/\342\212\220classify indexof.md" | 37 ++++++++++++++++ "help/\342\212\221first pick.md" | 33 ++++++++++++++ "help/\342\212\222occcount progindex.md" | 24 +++++++++++ "help/\342\212\224groupindices group.md" | 32 ++++++++++++++ "help/\342\212\230valences.md" | 21 +++++++++ "help/\342\212\242identity right.md" | 19 ++++++++ "help/\342\212\243identity left.md" | 19 ++++++++ "help/\342\212\270before bindleft.md" | 41 ++++++++++++++++++ "help/\342\213\206exponential power.md" | 25 +++++++++++ "help/\342\213\210enlist pair.md" | 36 ++++++++++++++++ "help/\342\214\210ceiling maximum.md" | 23 ++++++++++ "help/\342\214\212floor minimum.md" | 23 ++++++++++ "help/\342\214\234table.md" | 20 +++++++++ "help/\342\214\275reverse rotate.md" | 41 ++++++++++++++++++ "help/\342\214\276under.md" | 20 +++++++++ "help/\342\215\211transpose dyadtranspose.md" | 36 ++++++++++++++++ "help/\342\215\213gradeup binsup.md" | 28 ++++++++++++ "help/\342\215\222gradedown binsdown.md" | 29 +++++++++++++ "help/\342\215\237repeat.md" | 15 +++++++ "help/\342\215\267deduplicate find.md" | 56 ++++++++++++++++++++++++ "help/\342\216\211rank.md" | 36 ++++++++++++++++ "help/\342\216\212catch.md" | 15 +++++++ "help/\342\227\213over.md" | 27 ++++++++++++ "help/\342\227\266choose.md" | 17 ++++++++ "help/\342\232\207depth.md" | 12 ++++++ "help/\342\237\234after bindright.md" | 41 ++++++++++++++++++ "help/\342\245\212deshape reshape.md" | 41 ++++++++++++++++++ 64 files changed, 1866 insertions(+) create mode 100644 help/!assert assertwithmsg.md create mode 100644 help/+conjugate add.md create mode 100644 help/-negate subtract.md create mode 100644 help/merge great.md create mode 100644 help/`scan.md create mode 100644 help/sindices replicate.md create mode 100644 help/template.md.tmp create mode 100644 help/|abs modulus.md create mode 100644 "help/\302\250each.md" create mode 100644 "help/\302\253shiftbefore.md" create mode 100644 "help/\302\254not span.md" create mode 100644 "help/\302\264fold.md" create mode 100644 "help/\302\273shiftafter.md" create mode 100644 "help/\303\227sign multiply.md" create mode 100644 "help/\303\267reciprocal divide.md" create mode 100644 "help/\313\230cells.md" create mode 100644 "help/\313\231constant.md" create mode 100644 "help/\313\234self swap.md" create mode 100644 "help/\342\201\274undo.md" create mode 100644 "help/\342\206\221prefixes take.md" create mode 100644 "help/\342\206\223suffixes drop.md" create mode 100644 "help/\342\206\225range windows.md" create mode 100644 "help/\342\210\212markfirst memberof.md" create mode 100644 "help/\342\210\230atop.md" create mode 100644 "help/\342\210\232squareroot root.md" create mode 100644 "help/\342\210\247sortup and.md" create mode 100644 "help/\342\210\250sortdown or.md" create mode 100644 "help/\342\210\276join jointo.md" create mode 100644 "help/\342\211\215solo couple.md" create mode 100644 "help/\342\211\240length notequal.md" create mode 100644 "help/\342\211\241depth match.md" create mode 100644 "help/\342\211\242shape notmatch.md" create mode 100644 "help/\342\211\244lessequal.md" create mode 100644 "help/\342\211\245greatequal.md" create mode 100644 "help/\342\212\217firstcell select.md" create mode 100644 "help/\342\212\220classify indexof.md" create mode 100644 "help/\342\212\221first pick.md" create mode 100644 "help/\342\212\222occcount progindex.md" create mode 100644 "help/\342\212\224groupindices group.md" create mode 100644 "help/\342\212\230valences.md" create mode 100644 "help/\342\212\242identity right.md" create mode 100644 "help/\342\212\243identity left.md" create mode 100644 "help/\342\212\270before bindleft.md" create mode 100644 "help/\342\213\206exponential power.md" create mode 100644 "help/\342\213\210enlist pair.md" create mode 100644 "help/\342\214\210ceiling maximum.md" create mode 100644 "help/\342\214\212floor minimum.md" create mode 100644 "help/\342\214\234table.md" create mode 100644 "help/\342\214\275reverse rotate.md" create mode 100644 "help/\342\214\276under.md" create mode 100644 "help/\342\215\211transpose dyadtranspose.md" create mode 100644 "help/\342\215\213gradeup binsup.md" create mode 100644 "help/\342\215\222gradedown binsdown.md" create mode 100644 "help/\342\215\237repeat.md" create mode 100644 "help/\342\215\267deduplicate find.md" create mode 100644 "help/\342\216\211rank.md" create mode 100644 "help/\342\216\212catch.md" create mode 100644 "help/\342\227\213over.md" create mode 100644 "help/\342\227\266choose.md" create mode 100644 "help/\342\232\207depth.md" create mode 100644 "help/\342\237\234after bindright.md" create mode 100644 "help/\342\245\212deshape reshape.md" (limited to 'help') diff --git a/help/!assert assertwithmsg.md b/help/!assert assertwithmsg.md new file mode 100644 index 00000000..4e823a1e --- /dev/null +++ b/help/!assert assertwithmsg.md @@ -0,0 +1,31 @@ +Exclamation Mark (`!`) + +`! 𝕩`: Assert + +Throw an error if `𝕩` is not 1. +``` + ! 1 +1 + ! 2 +Error: Assertion error +at ! 2 + ^ + ! "hello" +Error: hello +at ! "hello" +``` + +`𝕨 ! 𝕩`: Dyad + +Throw an error with message `𝕨` if `𝕩` is not 1. +``` + "hi" ! 1 +1 + "two" ! 2 +Error: two +at "two" ! 2 + ^ + "hello error" ! "hello" +Error: hello error +at "hello error" ! "hello" +``` \ No newline at end of file diff --git a/help/+conjugate add.md b/help/+conjugate add.md new file mode 100644 index 00000000..dc8a0467 --- /dev/null +++ b/help/+conjugate add.md @@ -0,0 +1,22 @@ +Plus (`+`) + +`+ 𝕩`: Conjugate +``` + + 1 +1 + + Β―1 +Β―1 +``` +`𝕨 + 𝕩`: Add + +`𝕨` added to `𝕩`. Either `𝕨` or `𝕩` can be a character, and if so, the other has to be a number. + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) +``` + 1 + 2 +3 + 1 + 2β€Ώ3β€Ώ4 +⟨ 3 4 5 ⟩ + 'a' + 4 +'e' +``` diff --git a/help/-negate subtract.md b/help/-negate subtract.md new file mode 100644 index 00000000..df2cc167 --- /dev/null +++ b/help/-negate subtract.md @@ -0,0 +1,28 @@ +Minus (`-`) + +`- 𝕩`: Negate + +Additive Inverse of `𝕩`. + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) +``` + - 1 +Β―1 + - Β―1 +1 +``` +`𝕨 - 𝕩`: Subtract + +Subtract `𝕩` from `𝕨`. `𝕨` and `𝕩` can be characters or numbers. + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) +``` + 1 - 2 +Β―1 + 1 - 2β€Ώ3β€Ώ4 +⟨ Β―1 Β―2 Β―3 ⟩ + 'a' - 4 +']' + 'b' - 'a' +1 +``` diff --git a/help/merge great.md b/help/>merge great.md new file mode 100644 index 00000000..913a2b6c --- /dev/null +++ b/help/>merge great.md @@ -0,0 +1,38 @@ +Greater Than (`>`) + +`> 𝕩`: Merge + +Add the rank of an element of `𝕩` to the rank of `𝕩`. + +All elements must have the same rank. + +Returns atomic values as is. + +``` + a ← ⟨⟨1, 2⟩, ⟨3, 4⟩⟩ +⟨ ⟨ 1 2 ⟩ ⟨ 3 4 ⟩ ⟩ + >a +β”Œβ”€ +β•΅ 1 2 + 3 4 + β”˜ + β‰’a +⟨ 2 ⟩ + β‰’>a +⟨ 2 2 ⟩ + +``` + +`𝕨 > 𝕩`: Greater Than + +`𝕨` and `𝕩` can both be either numbers or characters. + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) +``` + 1 > 3 +0 + 2β€Ώ3β€Ώ0 > 3β€Ώ1β€Ώ0 +⟨ 0 1 0 ⟩ + 'a' > 'b' +1 +``` \ No newline at end of file diff --git a/help/`scan.md b/help/`scan.md new file mode 100644 index 00000000..dc4013b9 --- /dev/null +++ b/help/`scan.md @@ -0,0 +1,29 @@ +Acute Accent (`` ` ``) + +`𝔽` 𝕩`: Fold + +Scan over `𝕩` with `𝔽` from left to right, producing intermediate values. + +``` + +` 1β€Ώ2β€Ώ3 +⟨ 1 3 6 ⟩ + ⟨1, 1+2, (1+2)+3⟩ +⟨ 1 3 6 ⟩ + -` 1β€Ώ2β€Ώ3 +⟨ 1 Β―1 Β―4 ⟩ + ⟨1, 1-2, (1-2)-3⟩ +⟨ 1 Β―1 Β―4 ⟩ +``` +`𝕨 𝔽` 𝕩`: Scan With initial + +Monadic scan, but use `𝕨` as initial left argument. +``` + 5 +` 1β€Ώ2β€Ώ3 +⟨ 6 8 11 ⟩ + ⟨5+1, (5+1)+2, ((5+1)+2)+3⟩ +⟨ 6 8 11 ⟩ + 5 -` 1β€Ώ2β€Ώ3 +⟨ 4 2 Β―1 ⟩ + ⟨5-1, (5-1)-2, ((5-1)-2)-3⟩ +⟨ 4 2 Β―1 ⟩ +``` \ No newline at end of file diff --git a/help/sindices replicate.md b/help/sindices replicate.md new file mode 100644 index 00000000..852570d1 --- /dev/null +++ b/help/sindices replicate.md @@ -0,0 +1,23 @@ +Solidus (`/`) + +`/ 𝕩`: Indices + +Repeat the index of each element in `𝕩` by the element's value. `𝕩` must be rank 1. +``` + / 1β€Ώ2β€Ώ3 +⟨ 0 1 1 2 2 2 ⟩ + / 1β€Ώ0β€Ώ1 +⟨ 0 2 ⟩ +``` + +`𝕨 / 𝕩`: Replicate + +Repeat each major cell in `𝕩` by the corresponding element in `𝕨`. + +Atomic `𝕨` applies to all elements. +``` + 3 / "copy" +"cccooopppyyy" + 1β€Ώ0β€Ώ1 / 1β€Ώ2β€Ώ3 +⟨ 1 3 ⟩ +``` \ No newline at end of file diff --git a/help/template.md.tmp b/help/template.md.tmp new file mode 100644 index 00000000..5b994159 --- /dev/null +++ b/help/template.md.tmp @@ -0,0 +1,47 @@ +SymN (`S`) + +`S 𝕩`: Monad + +Description +``` +Ex +``` + +`𝕨 S 𝕩`: Dyad + +Description +``` +Ex +``` + +SymN (`S`) + +`𝔽 S 𝕩`: 1mod + +Description +``` +Ex +``` +`𝕨 𝔽 S 𝕩`: 1mod + +Description +``` +Ex +``` + + +SymN (`S`) + +`𝔽 S 𝔾 𝕩`: 2mod + +Description +``` +Ex +``` + +`𝕨 𝔽 S 𝔾 𝕩`: 2mod + +Description +``` +Ex +``` \ No newline at end of file diff --git a/help/|abs modulus.md b/help/|abs modulus.md new file mode 100644 index 00000000..533ab6b4 --- /dev/null +++ b/help/|abs modulus.md @@ -0,0 +1,25 @@ +Pipe (`|`) + +`| 𝕩`: Absolute Value + +Absolute Value of `𝕩`. + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) +``` + | Β―2 +2 + | 1β€Ώ3β€ΏΒ―4β€Ώ3 +⟨ 1 3 4 3 ⟩ +``` + +`𝕨 | 𝕩`: Modulus + +Remainder of `𝕩` divided by `𝕨`. + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) +``` + 1 | 3 +0 + 2 | 3β€Ώ4β€Ώ5 +⟨ 1 0 1 ⟩ +``` \ No newline at end of file diff --git "a/help/\302\250each.md" "b/help/\302\250each.md" new file mode 100644 index 00000000..2a387b97 --- /dev/null +++ "b/help/\302\250each.md" @@ -0,0 +1,15 @@ +Diaresis (`Β¨`) + +`𝔽¨ 𝕩`, `𝕨 𝔽¨ 𝕩`: Each + +Apply `𝔽` to/between the major elements of the arguments. (`π”½βš‡Β―1`) +``` + <Β¨ 1β€Ώ2β€Ώ3 +β”Œβ”€ +Β· β”ŒΒ· β”ŒΒ· β”ŒΒ· + Β· 1 Β· 2 Β· 3 + β”˜ β”˜ β”˜ + β”˜ + 4β€Ώ5β€Ώ6 ∾¨ 1β€Ώ2β€Ώ3 +⟨ ⟨ 4 1 ⟩ ⟨ 5 2 ⟩ ⟨ 6 3 ⟩ ⟩ +``` \ No newline at end of file diff --git "a/help/\302\253shiftbefore.md" "b/help/\302\253shiftbefore.md" new file mode 100644 index 00000000..926dcefb --- /dev/null +++ "b/help/\302\253shiftbefore.md" @@ -0,0 +1,37 @@ +Left Pointing Double Angle Quotation (`Β«`) + +`Β« 𝕩`: Shift Before + +Remove the first element of `𝕩`, add a cell of fill values to the end of the first axis of `𝕩`. +``` + 78 Β« 1β€Ώ2β€Ώ3 +⟨ 1 2 78 ⟩ + Β« 1β€Ώ2β€Ώ3 +⟨ 2 3 0 ⟩ + Β« 3β€Ώ3 β₯Š 9 +β”Œβ”€ +β•΅ 9 9 9 + 9 9 9 + 0 0 0 + β”˜ +``` + +`𝕨 Β« 𝕩`: Shift Before + +Remove the first `≠𝕨` (length) major cells from `𝕩`, join `𝕨` to the end of `𝕩`. Ranks must match. +``` + 8β€Ώ5 Β« 1β€Ώ2β€Ώ3 +⟨ 3 8 5 ⟩ + a ← 3β€Ώ3 β₯Š 9 +β”Œβ”€ +β•΅ 9 9 9 + 9 9 9 + 9 9 9 + β”˜ + 1β€Ώ2β€Ώ3 Β« a +β”Œβ”€ +β•΅ 9 9 9 + 9 9 9 + 1 2 3 + β”˜ +``` \ No newline at end of file diff --git "a/help/\302\254not span.md" "b/help/\302\254not span.md" new file mode 100644 index 00000000..5649410e --- /dev/null +++ "b/help/\302\254not span.md" @@ -0,0 +1,25 @@ +Not (`Β¬`) + +`Β¬ 𝕩`: Logical Not + +Logical Not of `𝕩`. + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) +``` + Β¬ 0 +1 + Β¬ 1β€Ώ0 +⟨ 0 1 ⟩ +``` + +`𝕨 Β¬ 𝕩`: Span + +Count of numbers in the inclusive range from `𝕩` to `𝕨`. + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) +``` + 3 Β¬ 1 +3 + 3β€Ώ4 Β¬ 0β€Ώ2 +⟨ 4 3 ⟩ +``` \ No newline at end of file diff --git "a/help/\302\264fold.md" "b/help/\302\264fold.md" new file mode 100644 index 00000000..0f3d2a69 --- /dev/null +++ "b/help/\302\264fold.md" @@ -0,0 +1,28 @@ +Acute Accent (`Β΄`) + +`𝔽´ 𝕩`: Fold + +Fold over `𝕩` with `𝔽` from right to left i.e. Insert `𝔽` between the elements of `𝕩`. +``` + +Β΄ 1β€Ώ2β€Ώ3 +6 + 1+2+3 +6 + -Β΄ 1β€Ώ2β€Ώ3 +2 + 1-2-3 +2 +``` +`𝕨 𝔽´ 𝕩`: Fold With initial + +Monadic fold, but use `𝕨` as initial right argument. +``` + 5 +Β΄ 1β€Ώ2β€Ώ3 +11 + 1+2+3+5 +11 + 5 -Β΄ 1β€Ώ2β€Ώ3 +Β―3 + 1-2-3-5 +Β―3 +``` \ No newline at end of file diff --git "a/help/\302\273shiftafter.md" "b/help/\302\273shiftafter.md" new file mode 100644 index 00000000..af8a6bb1 --- /dev/null +++ "b/help/\302\273shiftafter.md" @@ -0,0 +1,37 @@ +Right Pointing Double Angle Quotation (`Β»`) + +`Β» 𝕩`: Shift After + +Remove the last element of `𝕩`, add a cell of fill values to the start of the first axis of `𝕩`. +``` + Β» 1β€Ώ2β€Ώ3 +⟨ 0 1 2 ⟩ + Β» 3β€Ώ3 β₯Š 9 +β”Œβ”€ +β•΅ 0 0 0 + 9 9 9 + 9 9 9 + β”˜ +``` + +`𝕨 Β» 𝕩`: Shift After + +Remove the last `≠𝕨` (length) major cells from `𝕩`, join `𝕨` to the start of `𝕩`. Ranks must match. +``` + 78 Β» 1β€Ώ2β€Ώ3 +⟨ 78 1 2 ⟩ + 1β€Ώ2 Β» 1β€Ώ2β€Ώ3 +⟨ 1 2 1 ⟩ + a ← 3β€Ώ3 β₯Š 9 +β”Œβ”€ +β•΅ 9 9 9 + 9 9 9 + 9 9 9 + β”˜ + 1β€Ώ2β€Ώ3 Β» a +β”Œβ”€ +β•΅ 1 2 3 + 9 9 9 + 9 9 9 + β”˜ +``` \ No newline at end of file diff --git "a/help/\303\227sign multiply.md" "b/help/\303\227sign multiply.md" new file mode 100644 index 00000000..465d5023 --- /dev/null +++ "b/help/\303\227sign multiply.md" @@ -0,0 +1,26 @@ +Times (`Γ—`) + +`Γ— 𝕩`: Sign + +Sign of `𝕩`. +- `Β―1` if `𝕩 < 0` +- `0` if `𝕩 = 0` +- `1` if `𝕩 > 0` + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) +``` + Γ— Β―5β€Ώ0β€Ώ5β€Ώ1 +⟨ Β―1 0 1 1 ⟩ +``` + +`𝕨 Γ— 𝕩`: Multiply + +`𝕨` multiplied by `𝕩`. + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) +``` + 1 Γ— 2 +2 + 2 Γ— 2β€Ώ3β€Ώ4 +⟨ 4 6 8 ⟩ +``` \ No newline at end of file diff --git "a/help/\303\267reciprocal divide.md" "b/help/\303\267reciprocal divide.md" new file mode 100644 index 00000000..b43b5a76 --- /dev/null +++ "b/help/\303\267reciprocal divide.md" @@ -0,0 +1,20 @@ +Divide (`Γ·`) + +`Γ· 𝕩`: Reciprocal + +Gives `1 Γ· 𝕩`. + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) +``` + Γ· 5 +0.2 +``` + +`𝕨 Γ· 𝕩`: Divide + +`𝕨` divided by `𝕩`. + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) +``` +ExamplesIfAny +``` \ No newline at end of file diff --git "a/help/\313\230cells.md" "b/help/\313\230cells.md" new file mode 100644 index 00000000..4f5a3751 --- /dev/null +++ "b/help/\313\230cells.md" @@ -0,0 +1,26 @@ +Breve (`˘`) + +`π”½Λ˜ 𝕩`, `𝕨 π”½Λ˜ 𝕩`: Cells + +Apply `𝔽` to/between the major cells of the arguments. (`π”½βŽ‰Β―1`) +``` + a ← 3β€Ώ3 β₯Š ↕9 +β”Œβ”€ +β•΅ 0 1 2 + 3 4 5 + 6 7 8 + β”˜ + <˘ a +⟨ ⟨ 0 1 2 ⟩ ⟨ 3 4 5 ⟩ ⟨ 6 7 8 ⟩ ⟩ + a β‰Λ˜ a +β”Œβ”€ +β•Ž 0 1 2 + 0 1 2 + + 3 4 5 + 3 4 5 + + 6 7 8 + 6 7 8 + β”˜ +``` \ No newline at end of file diff --git "a/help/\313\231constant.md" "b/help/\313\231constant.md" new file mode 100644 index 00000000..c7025d3e --- /dev/null +++ "b/help/\313\231constant.md" @@ -0,0 +1,11 @@ +Dot Above (`Λ™`) + +`𝔽˙ 𝕩`, `𝕨 𝔽˙ 𝕩`: Constant + +Returns a function that will always return `𝕗`. +``` + "hello" (1 Λ™) 2 +1 + "hello" ({𝕨+𝕩} Λ™) 2 +(function block) +``` \ No newline at end of file diff --git "a/help/\313\234self swap.md" "b/help/\313\234self swap.md" new file mode 100644 index 00000000..d50ddc9f --- /dev/null +++ "b/help/\313\234self swap.md" @@ -0,0 +1,21 @@ +Small Tilde (`˜`) + +`π”½Λœ 𝕩`: Self + +Supplies `𝕩` as a left argument to `𝔽` (`𝕩 𝔽 𝕩`). +``` + 1 + 1 +2 + +˜ 1 +2 +``` + +`𝕨 π”½Λœ 𝕩`: Swap + +Swaps the arguments of `𝔽` (`𝕩 𝔽 𝕨`). +``` + 1 - 2 +Β―1 + 1 -˜ 2 +1 +``` \ No newline at end of file diff --git "a/help/\342\201\274undo.md" "b/help/\342\201\274undo.md" new file mode 100644 index 00000000..cac9cf46 --- /dev/null +++ "b/help/\342\201\274undo.md" @@ -0,0 +1,20 @@ +Superscript Equals Sign (`⁼`) + +`𝔽⁼ 𝕩`, `𝕨 𝔽⁼ 𝕩`: Undo + +Invert the function `𝔽`, or use its defined inverse. Not all functions have inverses. + +``` + 1 - 2 +Β―1 + 1 -⁼ 2 +Β―1 + √ 16 +4 + √⁼ 4 +16 + ⋆ 1 +2.718281828459045 + ⋆⁼ 2.718281828459045 +1 +``` \ No newline at end of file diff --git "a/help/\342\206\221prefixes take.md" "b/help/\342\206\221prefixes take.md" new file mode 100644 index 00000000..139ebda4 --- /dev/null +++ "b/help/\342\206\221prefixes take.md" @@ -0,0 +1,62 @@ +Up Arrow (`↑`) + +`↑ 𝕩`: Prefixes + +Prefixes of array `𝕩` along its first axis. +``` + ↑ 1β€Ώ2β€Ώ3β€Ώ4 +⟨ ⟨⟩ ⟨ 1 ⟩ ⟨ 1 2 ⟩ ⟨ 1 2 3 ⟩ ⟨ 1 2 3 4 ⟩ ⟩ + a ← 3β€Ώ3 β₯Š ↕9 +β”Œβ”€ +β•΅ 0 1 2 + 3 4 5 + 6 7 8 + β”˜ + ↑ a +β”Œβ”€ +Β· ↕0β€Ώ3 β”Œβ”€ β”Œβ”€ β”Œβ”€ + β•΅ 0 1 2 β•΅ 0 1 2 β•΅ 0 1 2 + β”˜ 3 4 5 3 4 5 + β”˜ 6 7 8 + β”˜ + β”˜ +``` + +`𝕨 ↑ 𝕩`: Take + +For each integer in `𝕨`, take that many elements from each dimension of `𝕩`. + +Negative numbers take from the end. + +If any of the elements in `𝕨` are greater than the length of their respective dimension, the dimension is extended with a fill value. +``` + 3 ↑ 1β€Ώ3β€Ώ5β€Ώ67 +⟨ 1 3 5 ⟩ + a ← 4β€Ώ4 β₯Š ↕16 +β”Œβ”€ +β•΅ 0 1 2 3 + 4 5 6 7 + 8 9 10 11 + 12 13 14 15 + β”˜ + 3β€Ώ3 ↑ a +β”Œβ”€ +β•΅ 0 1 2 + 4 5 6 + 8 9 10 + β”˜ + 5β€Ώ5 ↑ a +β”Œβ”€ +β•΅ 0 1 2 3 0 + 4 5 6 7 0 + 8 9 10 11 0 + 12 13 14 15 0 + 0 0 0 0 0 + β”˜ + 3β€ΏΒ―3 ↑ a +β”Œβ”€ +β•΅ 1 2 3 + 5 6 7 + 9 10 11 + β”˜ +``` \ No newline at end of file diff --git "a/help/\342\206\223suffixes drop.md" "b/help/\342\206\223suffixes drop.md" new file mode 100644 index 00000000..a1a0c346 --- /dev/null +++ "b/help/\342\206\223suffixes drop.md" @@ -0,0 +1,51 @@ +Down Arrow (`↓`) + +`↓ 𝕩`: Suffixes + +Suffixes of array `𝕩` along its first axis. +``` + ↓ 1β€Ώ2β€Ώ3β€Ώ4 +⟨ ⟨ 1 2 3 4 ⟩ ⟨ 2 3 4 ⟩ ⟨ 3 4 ⟩ ⟨ 4 ⟩ ⟨⟩ ⟩ + a ← 3β€Ώ3 β₯Š ↕9 +β”Œβ”€ +β•΅ 0 1 2 + 3 4 5 + 6 7 8 + β”˜ + ↓ a +β”Œβ”€ +Β· β”Œβ”€ β”Œβ”€ β”Œβ”€ ↕0β€Ώ3 + β•΅ 0 1 2 β•΅ 3 4 5 β•΅ 6 7 8 + 3 4 5 6 7 8 β”˜ + 6 7 8 β”˜ + β”˜ + β”˜ +``` + +`𝕨 ↓ 𝕩`: Drop + +For each integer in `𝕨`, drop that many elements from the beginning of each dimension of `𝕩`. + +Negative numbers drop from the end. +``` + 3 ↓ 1β€Ώ3β€Ώ5β€Ώ67 +⟨ 67 ⟩ + a ← 4β€Ώ4 β₯Š ↕16 +β”Œβ”€ +β•΅ 0 1 2 3 + 4 5 6 7 + 8 9 10 11 + 12 13 14 15 + β”˜ + 3β€Ώ3 ↓ a +β”Œβ”€ +β•΅ 15 + β”˜ + 5β€Ώ5 ↓ a +β”Œβ” +β””β”˜ + 3β€ΏΒ―3 ↓ a +β”Œβ”€ +β•΅ 12 + β”˜ +``` \ No newline at end of file diff --git "a/help/\342\206\225range windows.md" "b/help/\342\206\225range windows.md" new file mode 100644 index 00000000..3cb886e5 --- /dev/null +++ "b/help/\342\206\225range windows.md" @@ -0,0 +1,51 @@ +Up Down Arrow (`↕`) + +`↕ 𝕩`: Range + +Return all indices to index into an array of shape `𝕩`, in the shape described by `𝕩`. + +When given a single number, range from 0 to `𝕩-1`. +``` + ↕ 4 +⟨ 0 1 2 3 ⟩ + ↕ 4β€Ώ5 +β”Œβ”€ +β•΅ ⟨ 0 0 ⟩ ⟨ 0 1 ⟩ ⟨ 0 2 ⟩ ⟨ 0 3 ⟩ ⟨ 0 4 ⟩ + ⟨ 1 0 ⟩ ⟨ 1 1 ⟩ ⟨ 1 2 ⟩ ⟨ 1 3 ⟩ ⟨ 1 4 ⟩ + ⟨ 2 0 ⟩ ⟨ 2 1 ⟩ ⟨ 2 2 ⟩ ⟨ 2 3 ⟩ ⟨ 2 4 ⟩ + ⟨ 3 0 ⟩ ⟨ 3 1 ⟩ ⟨ 3 2 ⟩ ⟨ 3 3 ⟩ ⟨ 3 4 ⟩ + β”˜ +``` + +`𝕨 ↕ 𝕩`: Windows + +Overlapping slices of `𝕩` which are of shape `𝕨`. +``` + 5 ↕ "abcdefg" +β”Œβ”€ +β•΅"abcde + bcdef + cdefg" + β”˜ + a ← 3β€Ώ3β₯Šβ†•9 +β”Œβ”€ +β•΅ 0 1 2 + 3 4 5 + 6 7 8 + β”˜ + 2β€Ώ2 ↕ a +β”Œβ”€ +┆ 0 1 + 3 4 + + 1 2 + 4 5 + + + 3 4 + 6 7 + + 4 5 + 7 8 + β”˜ +``` \ No newline at end of file diff --git "a/help/\342\210\212markfirst memberof.md" "b/help/\342\210\212markfirst memberof.md" new file mode 100644 index 00000000..05e7ce28 --- /dev/null +++ "b/help/\342\210\212markfirst memberof.md" @@ -0,0 +1,37 @@ +Element Of (`∊`) + +`∊ 𝕩`: Unique Mask + +Mark the first occurrence of each major cell in `𝕩` with a 1, and all other occurrences with a 0. +``` + ∊ 4β€Ώ5β€Ώ6β€Ώ6β€Ώ4β€Ώ7β€Ώ5 +⟨ 1 1 1 0 0 1 0 ⟩ + a ← 3β€Ώ3 β₯Š ↕9 +β”Œβ”€ +β•΅ 0 1 2 + 3 4 5 + 6 7 8 + β”˜ + ∊ a +⟨ 1 1 1 ⟩ +``` + +`𝕨 ∊ 𝕩`: Member Of + +Is each element in `𝕨` a major cell of `𝕩`? +``` + ⟨1⟩ ∊ ↕9 +⟨ 1 ⟩ + a ← 3β€Ώ3 β₯Š ↕9 +β”Œβ”€ +β•΅ 0 1 2 + 3 4 5 + 6 7 8 + β”˜ + ⟨0β€Ώ1β€Ώ2⟩ ∊ a +β”ŒΒ· +Β· 0 + β”˜ + ⟨1β€Ώ3 β₯Š 0β€Ώ1β€Ώ2⟩ ∊ a +⟨ 1 ⟩ +``` \ No newline at end of file diff --git "a/help/\342\210\230atop.md" "b/help/\342\210\230atop.md" new file mode 100644 index 00000000..b1bcd796 --- /dev/null +++ "b/help/\342\210\230atop.md" @@ -0,0 +1,27 @@ +Ring Operator (`∘`) + +`π”½βˆ˜π”Ύ 𝕩`: Atop + +Apply `𝔾` to `𝕩`, then apply `𝔽` (`𝔽 𝔾 𝕩`). + +`𝔽` and `𝔾` must be monadic. +``` + -∘- 5 +5 + - - 5 +5 +``` + +`𝕨 π”½βˆ˜π”Ύ 𝕩`: Dyadic Atop + +Apply `𝔾` to `𝕨` and `𝕩`, then apply `𝔽` (`𝔽 (𝕨 𝔾 𝕩)`). + +`𝔽` must be monadic, and `𝔾` must be dyadic. +``` + 1 -∘+ 2 +Β―3 + 1 - + 2 +Β―1 + - 1 + 2 +Β―3 +``` \ No newline at end of file diff --git "a/help/\342\210\232squareroot root.md" "b/help/\342\210\232squareroot root.md" new file mode 100644 index 00000000..8e14ff8f --- /dev/null +++ "b/help/\342\210\232squareroot root.md" @@ -0,0 +1,21 @@ +Root (`√`) + +`√ 𝕩`: Square root + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) +``` + √ 2 +1.4142135623730951 +``` + +`𝕨 √ 𝕩`: Root + +`𝕨`th root of `𝕩`. + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) +``` + 2 √ 2 +1.4142135623730951 + 1β€Ώ2β€Ώ3β€Ώ4 √ 4 +⟨ 4 2 1.5874010519681994 1.414213562373095 ⟩ +``` \ No newline at end of file diff --git "a/help/\342\210\247sortup and.md" "b/help/\342\210\247sortup and.md" new file mode 100644 index 00000000..dd53aee3 --- /dev/null +++ "b/help/\342\210\247sortup and.md" @@ -0,0 +1,21 @@ +Logical And (`∧`) + +`∧ 𝕩`: Sort Up + +Sort array `𝕩` in ascending order. +``` + ∧ 3β€Ώ1β€Ώ4β€Ώ1β€Ώ5 +⟨ 1 1 3 4 5 ⟩ +``` + +`𝕨 ∧ 𝕩`: Logical And + +Logical And of `𝕨` and `𝕩`. + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) +``` + 1 ∧ 1 +1 + 1β€Ώ0 ∧ 1β€Ώ1 +⟨ 1 0 ⟩ +``` \ No newline at end of file diff --git "a/help/\342\210\250sortdown or.md" "b/help/\342\210\250sortdown or.md" new file mode 100644 index 00000000..6e8d27b7 --- /dev/null +++ "b/help/\342\210\250sortdown or.md" @@ -0,0 +1,23 @@ +Logical Or (`∨`) + +`∨ 𝕩`: Sort Down + +Sort array `𝕩` in descending order. +``` + ∨ 3β€Ώ1β€Ώ4β€Ώ1β€Ώ5 +⟨ 5 4 3 1 1 ⟩ +``` + +`𝕨 ∨ 𝕩`: Logical Or + +Logical Or of `𝕨` and `𝕩`. + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) +``` + 1 ∨ 0 +1 + 1β€Ώ0 ∨ 1β€Ώ1 +⟨ 1 1 ⟩ + 0 ∨ 0 +0 +``` \ No newline at end of file diff --git "a/help/\342\210\276join jointo.md" "b/help/\342\210\276join jointo.md" new file mode 100644 index 00000000..028ea885 --- /dev/null +++ "b/help/\342\210\276join jointo.md" @@ -0,0 +1,60 @@ +Lazy S (`∾`) + +`∾ 𝕩`: Join + +Join all elements of `𝕩` together. + +Element ranks must be compatible. +``` + ∾ ⟨1β€Ώ2, 3, 4β€Ώ5⟩ +⟨ 1 2 3 4 5 ⟩ + m ← (3β€Ώ1β‰βŒœ4β€Ώ2β€Ώ5) β₯ŠΒ¨ 2β€Ώ3β₯Šβ†•6 +β”Œβ”€ +β•΅ β”Œβ”€ β”Œβ”€ β”Œβ”€ + β•΅ 0 0 0 0 β•΅ 1 1 β•΅ 2 2 2 2 2 + 0 0 0 0 1 1 2 2 2 2 2 + 0 0 0 0 1 1 2 2 2 2 2 + β”˜ β”˜ β”˜ + β”Œβ”€ β”Œβ”€ β”Œβ”€ + β•΅ 3 3 3 3 β•΅ 4 4 β•΅ 5 5 5 5 5 + β”˜ β”˜ β”˜ + β”˜ + ∾ m +β”Œβ”€ +β•΅ 0 0 0 0 1 1 2 2 2 2 2 + 0 0 0 0 1 1 2 2 2 2 2 + 0 0 0 0 1 1 2 2 2 2 2 + 3 3 3 3 4 4 5 5 5 5 5 + β”˜ +``` + +`𝕨 ∾ 𝕩`: Join + +Join `𝕨` to `𝕩` along the first axis. +``` + "abcd" ∾ "EFG" +"abcdEFG" + a ← 3β€Ώ3 β₯Š ↕9 +β”Œβ”€ +β•΅ 0 1 2 + 3 4 5 + 6 7 8 + β”˜ + c ← 4β€Ώ3 β₯Š ↕12 +β”Œβ”€ +β•΅ 0 1 2 + 3 4 5 + 6 7 8 + 9 10 11 + β”˜ + a∾c +β”Œβ”€ +β•΅ 0 1 2 + 3 4 5 + 6 7 8 + 0 1 2 + 3 4 5 + 6 7 8 + 9 10 11 + β”˜ +``` \ No newline at end of file diff --git "a/help/\342\211\215solo couple.md" "b/help/\342\211\215solo couple.md" new file mode 100644 index 00000000..9ce6366a --- /dev/null +++ "b/help/\342\211\215solo couple.md" @@ -0,0 +1,42 @@ +Tape (`≍`) + +`≍ 𝕩`: Solo + +Add a dimension to `𝕩`. +``` + ≍ 1 +⟨ 1 ⟩ + + ≍≍ 1 +β”Œβ”€ +β•΅ 1 + β”˜ + + ≍≍≍ 1 +β”Œβ”€ +β•Ž 1 + β”˜ + + ≍≍ 1β€Ώ2β€Ώ3β€Ώ4 +β”Œβ”€ +β•΅ 1 2 3 4 + β”˜ + + ≍≍≍ 1β€Ώ2β€Ώ3β€Ώ4 +β”Œβ”€ +β•Ž 1 2 3 4 + β”˜ +``` + +`𝕨 ≍ 𝕩`: Couple + +Join `𝕨` and `𝕩` along a newly created axis. +``` + 1 ≍ 3 +⟨ 1 3 ⟩ + 1β€Ώ2 ≍ 2β€Ώ3 +β”Œβ”€ +β•΅ 1 2 + 2 3 + β”˜ +``` \ No newline at end of file diff --git "a/help/\342\211\240length notequal.md" "b/help/\342\211\240length notequal.md" new file mode 100644 index 00000000..770530e6 --- /dev/null +++ "b/help/\342\211\240length notequal.md" @@ -0,0 +1,30 @@ +Not Equal (`β‰ `) + +`β‰  𝕩`: Length + +Length of the first dimension of `𝕩`. + +``` + β‰  3 +1 + β‰  ⟨1, 2, 3⟩ +3 + β‰  3β€Ώ4β€Ώ5β₯Š0 +3 + β‰  1β€Ώ4β€Ώ5β₯Š0 +1 + β‰  4β€Ώ4β€Ώ5β₯Š0 +4 +``` + +`𝕨 β‰  𝕩`: Not Equal To + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) +``` + 1 β‰  3 +1 + 2β€Ώ3β€Ώ0 β‰  3β€Ώ1β€Ώ0 +⟨ 1 1 0 ⟩ + 'a' β‰  'a' +0 +``` \ No newline at end of file diff --git "a/help/\342\211\241depth match.md" "b/help/\342\211\241depth match.md" new file mode 100644 index 00000000..0575adef --- /dev/null +++ "b/help/\342\211\241depth match.md" @@ -0,0 +1,23 @@ +Identical To (`≑`) + +`≑ 𝕩`: Depth + +Highest level of nesting in `𝕩`. +``` + ≑ 2β€Ώ3β€Ώ4 +1 + ≑ ⟨2,<3,4,<<<5⟩ +4 + ≑ 9 +0 +``` + +`𝕨 ≑ 𝕩`: Match + +Does `𝕨` exactly match `𝕩`? +``` + 1 ≑ ⟨1⟩ +0 + ⟨1⟩ ≑ ⟨1⟩ +1 +``` \ No newline at end of file diff --git "a/help/\342\211\242shape notmatch.md" "b/help/\342\211\242shape notmatch.md" new file mode 100644 index 00000000..50e18f9e --- /dev/null +++ "b/help/\342\211\242shape notmatch.md" @@ -0,0 +1,23 @@ +Not Identical To (`β‰’`) + +`β‰’ 𝕩`: Shape + +Length of each dimension of x. +``` + β‰’ 1 +⟨⟩ + β‰’ 1β€Ώ2 +⟨ 2 ⟩ + β‰’ 1β€Ώ2 ≍ 3β€Ώ4 +⟨ 2 2 ⟩ +``` + +`𝕨 β‰’ 𝕩`: Not Match + +Does `𝕨` not exactly match `𝕩`? +``` + 1 β‰’ ⟨1⟩ +1 + ⟨1⟩ β‰’ ⟨1⟩ +0 +``` \ No newline at end of file diff --git "a/help/\342\211\244lessequal.md" "b/help/\342\211\244lessequal.md" new file mode 100644 index 00000000..8005681b --- /dev/null +++ "b/help/\342\211\244lessequal.md" @@ -0,0 +1,13 @@ +Lesser Than or Equal To (`≀`) + +`𝕨 ≀ 𝕩`: Lesser Than or Equal To + +`𝕨` and `𝕩` can both be either numbers or characters. + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) +``` + 1 ≀ 3 +1 + 2β€Ώ3β€Ώ0 ≀ 3β€Ώ1β€Ώ0 +⟨ 1 0 1 ⟩ +``` \ No newline at end of file diff --git "a/help/\342\211\245greatequal.md" "b/help/\342\211\245greatequal.md" new file mode 100644 index 00000000..3b4e9cf9 --- /dev/null +++ "b/help/\342\211\245greatequal.md" @@ -0,0 +1,13 @@ +Greater Than or Equal To (`β‰₯`) + +`𝕨 β‰₯ 𝕩`: Greater Than or Equal To + +`𝕨` and `𝕩` can both be either numbers or characters. + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) +``` + 1 β‰₯ 3 +0 + 2β€Ώ3β€Ώ0 β‰₯ 3β€Ώ1β€Ώ0 +⟨ 0 1 1 ⟩ +``` \ No newline at end of file diff --git "a/help/\342\212\217firstcell select.md" "b/help/\342\212\217firstcell select.md" new file mode 100644 index 00000000..33d0d2f6 --- /dev/null +++ "b/help/\342\212\217firstcell select.md" @@ -0,0 +1,38 @@ +Square Image Of (`⊏`) + +`⊏ 𝕩`: First Cell + +First major cell of `𝕩`. +``` + ⊏ ⟨1, 2, 3⟩ +β”ŒΒ· +Β· 1 + β”˜ + a ← 3β€Ώ3 β₯Š ↕9 +β”Œβ”€ +β•΅ 0 1 2 + 3 4 5 + 6 7 8 + β”˜ + ⊏ a +⟨ 0 1 2 ⟩ +``` + +`𝕨 ⊏ 𝕩`: Select + +Select the major cells of `𝕨` at the indices in `𝕩`. +``` + 2β€Ώ0 ⊏ ⟨1, 2, 3⟩ +⟨ 3 1 ⟩ + a ← 3β€Ώ3 β₯Š ↕9 +β”Œβ”€ +β•΅ 0 1 2 + 3 4 5 + 6 7 8 + β”˜ + 2β€Ώ0 ⊏ a +β”Œβ”€ +β•΅ 6 7 8 + 0 1 2 + β”˜ +``` \ No newline at end of file diff --git "a/help/\342\212\220classify indexof.md" "b/help/\342\212\220classify indexof.md" new file mode 100644 index 00000000..b4605a59 --- /dev/null +++ "b/help/\342\212\220classify indexof.md" @@ -0,0 +1,37 @@ +Square Original Of (`⊐`) + +`⊐ 𝕩`: Classify + +First index of each major cell of `𝕩` in `𝕩`. +``` + ⊐ 5β€Ώ6β€Ώ2β€Ώ2β€Ώ5β€Ώ1 +⟨ 0 1 2 2 0 3 ⟩ + a ← 3β€Ώ3 β₯Š 0β€Ώ1β€Ώ2β€Ώ9β€Ώ0β€Ώ9β€Ώ0β€Ώ1β€Ώ2 +β”Œβ”€ +β•΅ 0 1 2 + 9 0 9 + 0 1 2 + β”˜ + ⊐ a +⟨ 0 1 0 ⟩ +``` + +`𝕨 ⊐ 𝕩`: Index Of + +First index of each major cell of `𝕩` in `𝕨`. Rank of `𝕩` must be at least cell rank of 𝕨`. + +If a cell is not found in `𝕨`, that position will contain the length of `𝕨` (`≠𝕨`). +``` + 5β€Ώ6β€Ώ2β€Ώ2β€Ώ5β€Ώ1 ⊐ 5β€Ώ2β€Ώ1β€Ώ6 +⟨ 0 2 5 1 ⟩ + a ← 3β€Ώ3 β₯Š 0β€Ώ1β€Ώ2β€Ώ9β€Ώ0β€Ώ9β€Ώ0β€Ώ1β€Ώ2 +β”Œβ”€ +β•΅ 0 1 2 + 9 0 9 + 0 1 2 + β”˜ + a ⊐ ⟨9β€Ώ0β€Ώ9⟩ +β”ŒΒ· +Β· 3 + β”˜ +``` \ No newline at end of file diff --git "a/help/\342\212\221first pick.md" "b/help/\342\212\221first pick.md" new file mode 100644 index 00000000..0a4232fa --- /dev/null +++ "b/help/\342\212\221first pick.md" @@ -0,0 +1,33 @@ +Square Image Of Or Equal To (`βŠ‘`) + +`βŠ‘ 𝕩`: First + +First element of `𝕩`. +``` + βŠ‘ ⟨1, 2, 3⟩ +1 + a ← 3β€Ώ3 β₯Š ↕9 +β”Œβ”€ +β•΅ 0 1 2 + 3 4 5 + 6 7 8 + β”˜ + βŠ‘ a +0 +``` + +`𝕨 βŠ‘ 𝕩`: Pick + +Pick the element of `𝕨` at index `𝕩`. +``` + 2 βŠ‘ ⟨1, 2, 3⟩ +3 + a ← 3β€Ώ3 β₯Š ↕9 +β”Œβ”€ +β•΅ 0 1 2 + 3 4 5 + 6 7 8 + β”˜ + 2β€Ώ0 βŠ‘ a +6 +``` \ No newline at end of file diff --git "a/help/\342\212\222occcount progindex.md" "b/help/\342\212\222occcount progindex.md" new file mode 100644 index 00000000..277fd6ac --- /dev/null +++ "b/help/\342\212\222occcount progindex.md" @@ -0,0 +1,24 @@ +Square Original Of or Equal To (`βŠ’`) + +`βŠ’ 𝕩`: Occurrence Count + +Number of times each major cell of `𝕩` appears before itself. +``` + βŠ’ 2β€Ώ7β€Ώ1β€Ώ8β€Ώ1β€Ώ7β€Ώ1β€Ώ8β€Ώ2β€Ώ8β€Ώ4 +⟨ 0 0 0 0 1 1 2 1 1 2 0 ⟩ + β‰βŸœβŠ’ 2β€Ώ7β€Ώ1β€Ώ8β€Ώ1β€Ώ7β€Ώ1β€Ώ8β€Ώ2β€Ώ8β€Ώ4 +β”Œβ”€ +β•΅ 2 7 1 8 1 7 1 8 2 8 4 + 0 0 0 0 1 1 2 1 1 2 0 + β”˜ +``` + +`𝕨 βŠ’ 𝕩`: Progressive Index Of + +Index of the first unused match of each major cell of `𝕩` in `𝕨`. If there are no more matches left, length of `𝕨` is placed in that position. +``` + "aaa" βŠ’ "aaaaa" +⟨ 0 1 2 3 3 ⟩ + "aaabb" βŠ’ "ababababab" +⟨ 0 3 1 4 2 5 5 5 5 5 ⟩ +``` \ No newline at end of file diff --git "a/help/\342\212\224groupindices group.md" "b/help/\342\212\224groupindices group.md" new file mode 100644 index 00000000..172fe0f5 --- /dev/null +++ "b/help/\342\212\224groupindices group.md" @@ -0,0 +1,32 @@ +Square Cup (`βŠ”`) + +`βŠ” 𝕩`: Group Indices + +Group the indices of the major cells of `𝕩` by their respective values. + +`𝕩` must consist of integers. Groups start from 0. +``` + βŠ” 4β€Ώ5β€Ώ6β€Ώ6β€Ώ4β€Ώ7β€Ώ5 +⟨ ⟨⟩ ⟨⟩ ⟨⟩ ⟨⟩ ⟨ 0 4 ⟩ ⟨ 1 6 ⟩ ⟨ 2 3 ⟩ ⟨ 5 ⟩ ⟩ + (↕8) ≍ βŠ” 4β€Ώ5β€Ώ6β€Ώ6β€Ώ4β€Ώ7β€Ώ5 +β”Œβ”€ +β•΅ 0 1 2 3 4 5 6 7 + ⟨⟩ ⟨⟩ ⟨⟩ ⟨⟩ ⟨ 0 4 ⟩ ⟨ 1 6 ⟩ ⟨ 2 3 ⟩ ⟨ 5 ⟩ + β”˜ +``` + +`𝕨 βŠ” 𝕩`: Group + +Group the major cells of `𝕩` by their respective indices in `𝕨`. + +If an element corresponds to `Β―1`, it is excluded from grouping. + +An extra element can be added to the end of `𝕨` to specify length of the result. +``` + 1β€Ώ0β€Ώ1β€Ώ2β€Ώ2β€Ώ3β€Ώ3 βŠ” 4β€Ώ5β€Ώ6β€Ώ6β€Ώ4β€Ώ7β€Ώ5 +⟨ ⟨ 5 ⟩ ⟨ 4 6 ⟩ ⟨ 6 4 ⟩ ⟨ 7 5 ⟩ ⟩ + 1β€Ώ0β€Ώ1β€ΏΒ―1β€ΏΒ―1β€Ώ3β€Ώ3 βŠ” 4β€Ώ5β€Ώ6β€Ώ6β€Ώ4β€Ώ7β€Ώ5 +⟨ ⟨ 5 ⟩ ⟨ 4 6 ⟩ ⟨⟩ ⟨ 7 5 ⟩ ⟩ + 1β€Ώ0β€Ώ1β€ΏΒ―1β€ΏΒ―1β€Ώ3β€Ώ3β€Ώ10 βŠ” 4β€Ώ5β€Ώ6β€Ώ6β€Ώ4β€Ώ7β€Ώ5 +⟨ ⟨ 5 ⟩ ⟨ 4 6 ⟩ ⟨⟩ ⟨ 7 5 ⟩ ⟨⟩ ⟨⟩ ⟨⟩ ⟨⟩ ⟨⟩ ⟨⟩ ⟩ +``` \ No newline at end of file diff --git "a/help/\342\212\230valences.md" "b/help/\342\212\230valences.md" new file mode 100644 index 00000000..3caca9a6 --- /dev/null +++ "b/help/\342\212\230valences.md" @@ -0,0 +1,21 @@ +Circled Division Slash (`⊘`) + +`π”½βŠ˜π”Ύ 𝕩`: Valences + +Apply `𝔽` to `𝕩`. +``` + +⊘- 5 +5 + -⊘+ 5 +Β―5 +``` + +`𝕨 π”½βŠ˜π”Ύ 𝕩`: Valences + +Apply `𝔾` to `𝕨` and `𝕩`. +``` + 4 +⊘- 5 +Β―1 + 4 -⊘+ 5 +9 +``` \ No newline at end of file diff --git "a/help/\342\212\242identity right.md" "b/help/\342\212\242identity right.md" new file mode 100644 index 00000000..4870b9eb --- /dev/null +++ "b/help/\342\212\242identity right.md" @@ -0,0 +1,19 @@ +Right Tack (`⊒`) + +`⊒ 𝕩`: + +Return `𝕩`. +``` + ⊒ 5 +5 +``` + +`𝕨 ⊒ 𝕩`: Right + +Return `𝕩`. +``` + 5 ⊒ 8 +8 + 'a' ⊒ 1β€Ώ2β€Ώ3 +⟨ 1 2 3 ⟩ +``` \ No newline at end of file diff --git "a/help/\342\212\243identity left.md" "b/help/\342\212\243identity left.md" new file mode 100644 index 00000000..614c4f2a --- /dev/null +++ "b/help/\342\212\243identity left.md" @@ -0,0 +1,19 @@ +Left Tack (`⊣`) + +`⊣ 𝕩`: + +Return `𝕩`. +``` + ⊣ 5 +5 +``` + +`𝕨 ⊣ 𝕩`: Left + +Return `𝕨`. +``` + 5 ⊣ 8 +5 + 'a' ⊣ 1β€Ώ2β€Ώ3 +'a' +``` \ No newline at end of file diff --git "a/help/\342\212\270before bindleft.md" "b/help/\342\212\270before bindleft.md" new file mode 100644 index 00000000..461c0167 --- /dev/null +++ "b/help/\342\212\270before bindleft.md" @@ -0,0 +1,41 @@ +Multimap (`⊸`) + +`π•—βŠΈπ”Ύ 𝕩`: Bind Left + +Supply `𝕗` as a left argument to `𝔾` (`𝕗 𝔾 𝕩`). + +`𝕗` must be a value, `𝔾` must be dyadic. +``` + 3⊸- 9 +Β―6 + 3 - 9 +Β―6 +``` + +`π”½βŠΈπ”Ύ 𝕩`: Before + +Apply `𝔽` to `𝕩`, and supply it as a left argument to `𝔾` (`(𝔽 𝕩) 𝔾 𝕩`). + +`𝔽` must be monadic, `𝔾` must be dyadic. +``` + -⊸+ 9 +0 + - + 9 +Β―9 + (- 9) + 9 +0 +``` + +`𝕨 π”½βŠΈπ”Ύ 𝕩`: Dyadic Before + +Apply `𝔽` to `𝕨`, and supply it as a left argument to `𝔾` (`(𝔽 𝕨) 𝔾 𝕩`). + +`𝔽` must be monadic, `𝔾` must be dyadic. +``` + 2 -⊸+ 1 +Β―1 + 2 - + 1 +1 + (- 2) + 1 +Β―1 +``` \ No newline at end of file diff --git "a/help/\342\213\206exponential power.md" "b/help/\342\213\206exponential power.md" new file mode 100644 index 00000000..9420bcbf --- /dev/null +++ "b/help/\342\213\206exponential power.md" @@ -0,0 +1,25 @@ +Star (`⋆`) + +`⋆ 𝕩`: Exponential + +`e` (Euler's constant) to the power of `𝕩`. + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) +``` + ⋆ 0β€Ώ1β€Ώ2β€Ώ3 +⟨ 1 2.718281828459045 7.38905609893065 20.085536923187668 ⟩ +``` + +`𝕨 ⋆ 𝕩`: Power + +`𝕨` to the power of `𝕩`. + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) +``` + 2 ⋆ 5 +32 + 8β€Ώ5β€Ώ9 ⋆ 2 +⟨ 64 25 81 ⟩ + 2β€Ώ3 ⋆ 3β€ΏΒ―4 +⟨ 8 0.012345679012345678 ⟩ +``` \ No newline at end of file diff --git "a/help/\342\213\210enlist pair.md" "b/help/\342\213\210enlist pair.md" new file mode 100644 index 00000000..98407d47 --- /dev/null +++ "b/help/\342\213\210enlist pair.md" @@ -0,0 +1,36 @@ +Bow Tie (`β‹ˆ`) + +`β‹ˆ 𝕩`: Enlist + +Put `𝕩` in a single element list. (`βŸ¨π•©βŸ©`) +``` + β‹ˆ 1 +⟨ 1 ⟩ + β‹ˆ 4β€Ώ4 β₯Š 3β€Ώ67β€Ώ8β€Ώ0 +β”Œβ”€ +Β· β”Œβ”€ + β•΅ 3 67 8 0 + 3 67 8 0 + 3 67 8 0 + 3 67 8 0 + β”˜ + β”˜ +``` + +`𝕨 β‹ˆ 𝕩`: Pair + +Put `𝕨` and `𝕩` in a two element list. (`βŸ¨π•¨, π•©βŸ©`) +``` + 1 β‹ˆ 2 +⟨ 1 2 ⟩ + 1 β‹ˆ "dsdasdas" +⟨ 1 "dsdasdas" ⟩ + (3β€Ώ3 β₯Š 3) β‹ˆ 67β€Ώ'a'β€Ώ"example" +β”Œβ”€ +Β· β”Œβ”€ ⟨ 67 'a' "example" ⟩ + β•΅ 3 3 3 + 3 3 3 + 3 3 3 + β”˜ + β”˜ +``` \ No newline at end of file diff --git "a/help/\342\214\210ceiling maximum.md" "b/help/\342\214\210ceiling maximum.md" new file mode 100644 index 00000000..3b956e9d --- /dev/null +++ "b/help/\342\214\210ceiling maximum.md" @@ -0,0 +1,23 @@ +Left Ceiling (`⌈`) + +`⌈ 𝕩`: Ceiling + +Round `𝕩` up. + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) +``` + ⌈ 1.2β€ΏΟ€β€Ώ3β€Ώ7.89 +⟨ 2 4 3 8 ⟩ +``` + +`𝕨 ⌈ 𝕩`: Maximum + +Maximum of `𝕨` and `𝕩`. + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) +``` + 1 ⌈ 2 +2 + 2β€Ώ3 ⌈ 4β€Ώ2 +⟨ 4 3 ⟩ +``` \ No newline at end of file diff --git "a/help/\342\214\212floor minimum.md" "b/help/\342\214\212floor minimum.md" new file mode 100644 index 00000000..a08d2da4 --- /dev/null +++ "b/help/\342\214\212floor minimum.md" @@ -0,0 +1,23 @@ +Left Floor (`⌊`) + +`⌊ 𝕩`: Floor + +Round `𝕩` down. + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) +``` + ⌊ 1.2β€ΏΟ€β€Ώ3β€Ώ7.89 +⟨ 1 3 3 7 ⟩ +``` + +`𝕨 ⌊ 𝕩`: Minimum + +Minimum of `𝕨` and `𝕩`. + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) +``` + 1 ⌊ 2 +1 + 2β€Ώ3 ⌊ 4β€Ώ2 +⟨ 2 2 ⟩ +``` \ No newline at end of file diff --git "a/help/\342\214\234table.md" "b/help/\342\214\234table.md" new file mode 100644 index 00000000..65ebe6c8 --- /dev/null +++ "b/help/\342\214\234table.md" @@ -0,0 +1,20 @@ +Top Left Corner (`⌜`) + +`𝕨 π”½βŒœ 𝕩`: Each + +Apply `𝔽` between every possible pair of the elements of the arguments. +``` + 1β€Ώ2β€Ώ3β€Ώ4 +⌜ 4β€Ώ5β€Ώ6β€Ώ7 +β”Œβ”€ +β•΅ 5 6 7 8 + 6 7 8 9 + 7 8 9 10 + 8 9 10 11 + β”˜ + "abc" ∾⌜ "xyz" +β”Œβ”€ +β•΅ "ax" "ay" "az" + "bx" "by" "bz" + "cx" "cy" "cz" + β”˜ +``` \ No newline at end of file diff --git "a/help/\342\214\275reverse rotate.md" "b/help/\342\214\275reverse rotate.md" new file mode 100644 index 00000000..f8ed52d0 --- /dev/null +++ "b/help/\342\214\275reverse rotate.md" @@ -0,0 +1,41 @@ +Circle Stile (`⌽`) + +`⌽ 𝕩`: Reverse + +Reverse the first axis of `𝕩`. +``` + ⌽ 1β€Ώ2β€Ώ3 +⟨ 3 2 1 ⟩ + a ← 3β€Ώ3 β₯Š ↕9 +β”Œβ”€ +β•΅ 0 1 2 + 3 4 5 + 6 7 8 + β”˜ + ⌽ a +β”Œβ”€ +β•΅ 6 7 8 + 3 4 5 + 0 1 2 + β”˜ +``` + +`𝕨 ⌽ 𝕩`: Dyad + +Move the first `𝕨` elements of `𝕩` to its end. Negative `𝕨` reverses the direction of rotation. +``` + 2 ⌽ 1β€Ώ2β€Ώ3 +⟨ 3 1 2 ⟩ + a ← 3β€Ώ3 β₯Š ↕9 +β”Œβ”€ +β•΅ 0 1 2 + 3 4 5 + 6 7 8 + β”˜ + 2 ⌽ a +β”Œβ”€ +β•΅ 6 7 8 + 0 1 2 + 3 4 5 + β”˜ +``` \ No newline at end of file diff --git "a/help/\342\214\276under.md" "b/help/\342\214\276under.md" new file mode 100644 index 00000000..c7678087 --- /dev/null +++ "b/help/\342\214\276under.md" @@ -0,0 +1,20 @@ +Circle Jot (`⌾`) + +`π”½βŒΎπ”Ύ 𝕩`, `𝕨 π”½βŒΎπ”Ύ 𝕩`: Under + +- Apply transformation `𝔾` to all arguments +- Apply `𝔽` to the transformed arguments +- Undo transformation `𝔾` + +Where `𝔾` must be + +1. A function invertible by `⁼` (Undo) +2. A structural modification +``` + 9⌾(1βŠΈβŠ‘) 1β€Ώ2β€Ώ3 +⟨ 1 9 3 ⟩ + √⁼ (√1) + (√9) +16 + 1 +⌾√ 9 +16 +``` \ No newline at end of file diff --git "a/help/\342\215\211transpose dyadtranspose.md" "b/help/\342\215\211transpose dyadtranspose.md" new file mode 100644 index 00000000..da7f058f --- /dev/null +++ "b/help/\342\215\211transpose dyadtranspose.md" @@ -0,0 +1,36 @@ +Circle Backslash (`⍉`) + +`⍉ 𝕩`: Transpose + +Move the first axis of `𝕩` to the end. +``` + a ← 3β€Ώ3 β₯Š ↕9 +β”Œβ”€ +β•΅ 0 1 2 + 3 4 5 + 6 7 8 + β”˜ + ⍉ a +β”Œβ”€ +β•΅ 0 3 6 + 1 4 7 + 2 5 8 + β”˜ + b ← 1β€Ώ2β€Ώ3 β₯Š ↕6 +β”Œβ”€ +β•Ž 0 1 2 + 3 4 5 + β”˜ + ≒⍉ b +⟨ 2 3 1 ⟩ +``` + +`𝕨 ⍉ 𝕩`: Dyad + +Rearrange the axes of `𝕩` as per the axis indices in `𝕨`. +``` + β‰’ a ← 2β€Ώ3β€Ώ4β€Ώ5β€Ώ6 β₯Š1 +⟨ 2 3 4 5 6 ⟩ + β‰’ 1β€Ώ3β€Ώ2β€Ώ0β€Ώ4 ⍉ a +⟨ 5 2 4 3 6 ⟩ +``` \ No newline at end of file diff --git "a/help/\342\215\213gradeup binsup.md" "b/help/\342\215\213gradeup binsup.md" new file mode 100644 index 00000000..1aee7730 --- /dev/null +++ "b/help/\342\215\213gradeup binsup.md" @@ -0,0 +1,28 @@ +Delta Stile (`⍋`) + +`⍋ 𝕩`: Grade Up + +Indices of `𝕩` that would sort its major cells in ascending order. +``` + a ← 3β€Ώ2β€Ώ1 +⟨ 3 2 1 ⟩ + ⍋ a +⟨ 2 1 0 ⟩ + (⍋a) ⊏ a +⟨ 1 2 3 ⟩ + +``` + +`𝕨 ⍋ 𝕩`: Bins Up + +Binary search for each element of `𝕩` in `𝕨`, and return the index found, if any. + +`𝕨` must be sorted in ascending order. +``` + 3β€Ώ4β€Ώ5β€Ώ7 ⍋ 2 +β”ŒΒ· +Β· 0 + β”˜ + 3β€Ώ4β€Ώ5β€Ώ7 ⍋ 2β€Ώ6 +⟨ 0 3 ⟩ +``` \ No newline at end of file diff --git "a/help/\342\215\222gradedown binsdown.md" "b/help/\342\215\222gradedown binsdown.md" new file mode 100644 index 00000000..ed03f6f4 --- /dev/null +++ "b/help/\342\215\222gradedown binsdown.md" @@ -0,0 +1,29 @@ +Del Stile (`⍒`) + +`⍒ 𝕩`: Grade Down + +Indices of `𝕩` that would sort its major cells in descending order. +``` + a ← 1β€Ώ2β€Ώ3 +⟨ 1 2 3 ⟩ + ⍒ a +⟨ 2 1 0 ⟩ + (⍒a) ⊏ a +⟨ 3 2 1 ⟩ +``` + +`𝕨 ⍒ 𝕩`: Bins Down + +Binary search for each element of `𝕩` in `𝕨`, and return the index found, if any. + +`𝕨` must be sorted in descending order. + +[Right Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) +``` + 7β€Ώ5β€Ώ4β€Ώ3 ⍒ 2 +β”ŒΒ· +Β· 4 + β”˜ + 7β€Ώ5β€Ώ4β€Ώ3 ⍒ 2β€Ώ6 +⟨ 4 1 ⟩ +``` \ No newline at end of file diff --git "a/help/\342\215\237repeat.md" "b/help/\342\215\237repeat.md" new file mode 100644 index 00000000..922e57a2 --- /dev/null +++ "b/help/\342\215\237repeat.md" @@ -0,0 +1,15 @@ +Circle Star (`⍟`) + +`π”½βŸπ”Ύ 𝕩`, `𝕨 π”½βŸπ”Ύ 𝕩`: Repeat + +Apply `𝔾` to `𝕨` and `𝕩` and apply `𝔽` to `𝕩` that may times. If `𝕨` is given, keep it as a constant left argument. + +If `𝔾` returns an array, give `π”½βŸπ•©` for each element. +``` + 1 +⍟⊒ 4 +8 + 1 +⍟1β€Ώ2β€Ώ3 4 +⟨ 5 6 7 ⟩ + 3 ∾⍟{≠𝕩} ⟨4,5,6⟩ +⟨ 3 3 3 4 5 6 ⟩ +``` \ No newline at end of file diff --git "a/help/\342\215\267deduplicate find.md" "b/help/\342\215\267deduplicate find.md" new file mode 100644 index 00000000..ae314268 --- /dev/null +++ "b/help/\342\215\267deduplicate find.md" @@ -0,0 +1,56 @@ +Epsilon Underbar (`⍷`) + +`⍷ 𝕩`: Deduplicate + +Unique major cells of `𝕩`. +``` + ⍷ 4β€Ώ5β€Ώ6β€Ώ6β€Ώ4β€Ώ7β€Ώ5 +⟨ 4 5 6 7 ⟩ + a ← 3β€Ώ3 β₯Š ↕6 +β”Œβ”€ +β•΅ 0 1 2 + 3 4 5 + 0 1 2 + β”˜ + ⍷ a +β”Œβ”€ +β•΅ 0 1 2 + 3 4 5 + β”˜ +``` + +`𝕨 ⍷ 𝕩`: Find + +Mark the top left location of the occurrences of `𝕨` in `𝕩` with a 1, and other locations with 0. + +Result is the same shape as `(≒𝕨)↕x`. +``` + "string" ⍷ "substring" +⟨ 0 0 0 1 ⟩ + "loooooong" ⍷ "short" +⟨⟩ + a ← 7 (4|β‹†Λœ)βŒœβ—‹β†• 9 +β”Œβ”€ +β•΅ 1 1 1 1 1 1 1 1 1 + 0 1 2 3 0 1 2 3 0 + 0 1 0 1 0 1 0 1 0 + 0 1 0 3 0 1 0 3 0 + 0 1 0 1 0 1 0 1 0 + 0 1 0 3 0 1 0 3 0 + 0 1 0 1 0 1 0 1 0 + β”˜ + b ← (0β€Ώ3β€Ώ0≍0β€Ώ1β€Ώ0) +β”Œβ”€ +β•΅ 0 3 0 + 0 1 0 + β”˜ + b ⍷ a +β”Œβ”€ +β•΅ 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 + 0 0 1 0 0 0 1 + 0 0 0 0 0 0 0 + 0 0 1 0 0 0 1 + β”˜ +``` \ No newline at end of file diff --git "a/help/\342\216\211rank.md" "b/help/\342\216\211rank.md" new file mode 100644 index 00000000..645b0aaf --- /dev/null +++ "b/help/\342\216\211rank.md" @@ -0,0 +1,36 @@ +Circled Horizontal Bar With Notch (`βŽ‰`) + +`π”½βŽ‰π•˜ 𝕩`, `𝕨 π”½βŽ‰π•˜ 𝕩`: Rank + +Apply `𝔽` to cells at ranks given in `π•˜`. + +The ranks applied are given by the following: + +- `βŽ‰ c` Rank-c cells of `𝕩` (monadic) or both arguments (dyadic) +- `βŽ‰ bβ€Ώc` ⍝ Rank-b cells of `𝕨` and rank-c cells of `𝕩` (dyadic) +- `βŽ‰ aβ€Ώbβ€Ώc` ⍝ Rank-a cells of `𝕩` (monadic), b-cells of `𝕨` and c-cells of `𝕩` (dyadic) + +``` + a ← 3β€Ώ2β€Ώ4β₯Š"ABCDEFGHIJKLMNOPQRSTUVWXYZ" +β”Œβ”€ +β•Ž"ABCD + EFGH + + Β·IJKL + MNOP + + Β·QRST + UVWX" + β”˜ + βŒ½βŽ‰2 a +β”Œβ”€ +β•Ž"EFGH + ABCD + + Β·MNOP + IJKL + + Β·UVWX + QRST" + β”˜ +``` \ No newline at end of file diff --git "a/help/\342\216\212catch.md" "b/help/\342\216\212catch.md" new file mode 100644 index 00000000..8f7c680f --- /dev/null +++ "b/help/\342\216\212catch.md" @@ -0,0 +1,15 @@ +Circled Triangle Down (`⎊`) + +`π”½βŽŠπ”Ύ 𝕩`, `𝕨 π”½βŽŠπ”Ύ 𝕩`: Catch + +Apply `𝔽` to the arguments. + +If an error happens when `𝔽` is applied, cancel its execution, apply `𝔾` to the arguments and return the results. + +Otherwise, return the results of `𝔽`. +``` + ∾⎊{"error occurred with argument: "βˆΎβ€’Fmt 𝕩} 1 +"error occurred with argument: 1" + ∾⎊{"error occurred with argument: "βˆΎβ€’Fmt 𝕩} ⟨⟨1,2⟩, ⟨3,4⟩⟩ +⟨ 1 2 3 4 ⟩ +``` \ No newline at end of file diff --git "a/help/\342\227\213over.md" "b/help/\342\227\213over.md" new file mode 100644 index 00000000..98082965 --- /dev/null +++ "b/help/\342\227\213over.md" @@ -0,0 +1,27 @@ +Circle (`β—‹`) + +`𝔽○𝔾 𝕩`: Atop + +Apply `𝔾` to `𝕩`, then apply `𝔽` (`𝔽 𝔾 𝕩`). + +`𝔽` and `𝔾` must be monadic. +``` + -β—‹- 5 +5 + - - 5 +5 +``` + +`𝕨 𝔽○𝔾 𝕩`: Over + +Apply `𝔾` to `𝕨` and `𝕩`, then apply `𝔽` to them (`(𝔾 𝕨) 𝔽 (𝔾 𝕩)`). + +`𝔽` must be dyadic, `𝔾` must be monadic. +``` + 1 +β—‹- 2 +Β―3 + 1 + - 2 +Β―1 + (- 1) + (- 2) +Β―3 +``` \ No newline at end of file diff --git "a/help/\342\227\266choose.md" "b/help/\342\227\266choose.md" new file mode 100644 index 00000000..1b7d81f5 --- /dev/null +++ "b/help/\342\227\266choose.md" @@ -0,0 +1,17 @@ +Circle with Lower Right Quadrant (`β—Ά`) + +`π”½β—Άπ•˜ 𝕩`, `𝕨 π”½β—Άπ•˜ 𝕩`: Choose + +Apply `𝔽` to the arguments and pick a function from list `π•˜`. Apply the picked function to the arguments. +``` + F ← βŠ’β—Ά+β€Ώ-β€ΏΓ·β€ΏΓ— +βŠ’β—ΆβŸ¨ + - Γ· Γ— ⟩ + F 0 +0 + F 1 +Β―1 + F 2 +0.5 + F 3 +1 +``` \ No newline at end of file diff --git "a/help/\342\232\207depth.md" "b/help/\342\232\207depth.md" new file mode 100644 index 00000000..14352bd4 --- /dev/null +++ "b/help/\342\232\207depth.md" @@ -0,0 +1,12 @@ +Circle With Two Dots (`βš‡`) + +`π”½βš‡π•˜ 𝕩`, `𝕨 π”½βš‡π•˜ 𝕩`: Depth + +Apply `𝔽` to the cells of the arguments at depth given in `π•˜`. + +``` + 1βŠΈβ†“βš‡1 ⟨⟨1,2,3⟩, ⟨4,5,6⟩⟩ +⟨ ⟨ 2 3 ⟩ ⟨ 5 6 ⟩ ⟩ + 1 β†“βš‡1 ⟨⟨1,2,3⟩, ⟨4,5,6⟩⟩ +⟨ ⟨ 2 3 ⟩ ⟨ 5 6 ⟩ ⟩ +``` \ No newline at end of file diff --git "a/help/\342\237\234after bindright.md" "b/help/\342\237\234after bindright.md" new file mode 100644 index 00000000..b1fa1aa5 --- /dev/null +++ "b/help/\342\237\234after bindright.md" @@ -0,0 +1,41 @@ +Left Multimap (`⟜`) + +`π”½βŸœπ•˜ 𝕩`: Bind + +Supply `π•˜` as a right argument to `𝔽` (`𝕩 𝔽 π•˜`). + +`π•˜` must be a value, `F` must be dyadic. +``` + -⟜3 9 +6 + - 3 9 +Error + 9 - 3 +6 +``` + +`π”½βŸœπ”Ύ 𝕩`: After + +Apply `𝔾` to `𝕩`, and supply it as a right argument to `𝔽` (`𝕩 𝔽 (𝔾 𝕩)`). + +`𝔽` must be dyadic, `𝔾` must be monadic. +``` + Γ—βŸœ- 9 +Β―81 + Γ— - 9 +Β―1 + 9 Γ— (- 9) +Β―81 +``` + +`𝕨 π”½βŸœπ”Ύ 𝕩`: Dyadic After + +Apply `𝔾` to `𝕩`, and supply it as a right argument to `𝔽` (`𝕨 𝔽 (𝔾 𝕩)`). + +`𝔽` must be dyadic, `𝔾` must be monadic. +``` + 2 Γ—βŸœ- 1 +Β―2 + 2 Γ— (- 1) +Β―2 +``` \ No newline at end of file diff --git "a/help/\342\245\212deshape reshape.md" "b/help/\342\245\212deshape reshape.md" new file mode 100644 index 00000000..f9b4967f --- /dev/null +++ "b/help/\342\245\212deshape reshape.md" @@ -0,0 +1,41 @@ +Barb (`β₯Š`) + +`β₯Š 𝕩`: Deshape + +Put all elements of `𝕩` in a rank 1 array, converting to array if necessary. +``` + β₯Š 1 +⟨ 1 ⟩ + β₯Š 1β€Ώ2 ≍ 3β€Ώ4 +⟨ 1 2 3 4 ⟩ +``` + +`𝕨 β₯Š 𝕩`: Reshape + +Put all elements of `𝕩` in an array of shape `𝕨`, adding or removing elements if necessary. + +A single element in `𝕩` can be a function, which will be replaced with an appropriate length: +- `∘` Exact fit +- `⌊` Round length down, discarding elements +- `⌽` Round length up +- `↑` Round length up, and use element fill to add extra elements. +``` + 3β€Ώ3 β₯Š 3 +β”Œβ”€ +β•΅ 3 3 3 + 3 3 3 + 3 3 3 + β”˜ + 2β€ΏβŒ½β€Ώ2 β₯Š 1β€Ώ2β€Ώ3 +β”Œβ”€ +β•Ž 1 2 + + 3 1 + β”˜ + 2‿↑‿2 β₯Š 1β€Ώ2β€Ώ3 +β”Œβ”€ +β•Ž 1 2 + + 3 0 + β”˜ +``` \ No newline at end of file -- cgit v1.2.3 From 6c111f1e71e945f66977aecc3322318aa21beacc Mon Sep 17 00:00:00 2001 From: razetime Date: Wed, 19 Jan 2022 21:21:13 +0530 Subject: Primitive Symbol help pages generated --- help/!assert assertwithmsg.md | 48 ++++++------ help/+conjugate add.md | 32 ++++---- help/-negate subtract.md | 36 ++++----- help/merge great.md | 48 ++++++------ help/`scan.md | 48 ++++++------ help/sindices replicate.md | 28 +++---- help/|abs modulus.md | 28 +++---- "help/\302\250each.md" | 24 +++--- "help/\302\253shiftbefore.md" | 60 +++++++-------- "help/\302\254not span.md" | 28 +++---- "help/\302\264fold.md" | 44 +++++------ "help/\302\273shiftafter.md" | 60 +++++++-------- "help/\303\227sign multiply.md" | 24 +++--- "help/\303\267reciprocal divide.md" | 18 +++-- "help/\313\230cells.md" | 46 ++++++------ "help/\313\231constant.md" | 16 ++-- "help/\313\234self swap.md" | 28 +++---- "help/\342\201\274undo.md" | 32 ++++---- "help/\342\206\221prefixes take.md" | 100 ++++++++++++------------- "help/\342\206\223suffixes drop.md" | 84 ++++++++++----------- "help/\342\206\225range windows.md" | 84 ++++++++++----------- "help/\342\210\212markfirst memberof.md" | 58 ++++++++------- "help/\342\210\230atop.md" | 32 ++++---- "help/\342\210\232squareroot root.md" | 24 +++--- "help/\342\210\247sortup and.md" | 24 +++--- "help/\342\210\250sortdown or.md" | 28 +++---- "help/\342\210\276join jointo.md" | 102 +++++++++++++------------- "help/\342\211\215solo couple.md" | 70 +++++++++--------- "help/\342\211\240length notequal.md" | 44 +++++------ "help/\342\211\241depth match.md" | 32 ++++---- "help/\342\211\242shape notmatch.md" | 32 ++++---- "help/\342\211\244lessequal.md" | 16 ++-- "help/\342\211\245greatequal.md" | 16 ++-- "help/\342\212\217firstcell select.md" | 60 +++++++-------- "help/\342\212\220classify indexof.md" | 54 +++++++------- "help/\342\212\221first pick.md" | 52 ++++++------- "help/\342\212\222occcount progindex.md" | 34 +++++---- "help/\342\212\224groupindices group.md" | 38 +++++----- "help/\342\212\230valences.md" | 28 +++---- "help/\342\212\242identity right.md" | 24 +++--- "help/\342\212\243identity left.md" | 24 +++--- "help/\342\212\270before bindleft.md" | 48 ++++++------ "help/\342\213\206exponential power.md" | 28 +++---- "help/\342\213\210enlist pair.md" | 58 ++++++++------- "help/\342\214\210ceiling maximum.md" | 24 +++--- "help/\342\214\212floor minimum.md" | 24 +++--- "help/\342\214\234table.md" | 34 +++++---- "help/\342\214\275reverse rotate.md" | 68 ++++++++--------- "help/\342\214\276under.md" | 20 ++--- "help/\342\215\211transpose dyadtranspose.md" | 58 ++++++++------- "help/\342\215\213gradeup binsup.md" | 38 +++++----- "help/\342\215\222gradedown binsdown.md" | 36 ++++----- "help/\342\215\237repeat.md" | 20 ++--- "help/\342\215\267deduplicate find.md" | 92 +++++++++++------------ "help/\342\216\211rank.md" | 52 ++++++------- "help/\342\216\212catch.md" | 16 ++-- "help/\342\227\213over.md" | 32 ++++---- "help/\342\227\266choose.md" | 28 +++---- "help/\342\232\207depth.md" | 16 ++-- "help/\342\237\234after bindright.md" | 48 ++++++------ "help/\342\245\212deshape reshape.md" | 56 +++++++------- 63 files changed, 1351 insertions(+), 1225 deletions(-) (limited to 'help') diff --git a/help/!assert assertwithmsg.md b/help/!assert assertwithmsg.md index 4e823a1e..80dfb851 100644 --- a/help/!assert assertwithmsg.md +++ b/help/!assert assertwithmsg.md @@ -1,31 +1,33 @@ -Exclamation Mark (`!`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/!assert assertwithmsg.html).* + +# Exclamation Mark (`!`) `! 𝕩`: Assert Throw an error if `𝕩` is not 1. -``` - ! 1 -1 - ! 2 -Error: Assertion error -at ! 2 - ^ - ! "hello" -Error: hello -at ! "hello" -``` + + ! 1 + 1 + ! 2 + Error: Assertion error + at ! 2 + ^ + ! "hello" + Error: hello + at ! "hello" + `𝕨 ! 𝕩`: Dyad Throw an error with message `𝕨` if `𝕩` is not 1. -``` - "hi" ! 1 -1 - "two" ! 2 -Error: two -at "two" ! 2 - ^ - "hello error" ! "hello" -Error: hello error -at "hello error" ! "hello" -``` \ No newline at end of file + + "hi" ! 1 + 1 + "two" ! 2 + Error: two + at "two" ! 2 + ^ + "hello error" ! "hello" + Error: hello error + at "hello error" ! "hello" + diff --git a/help/+conjugate add.md b/help/+conjugate add.md index dc8a0467..37c32295 100644 --- a/help/+conjugate add.md +++ b/help/+conjugate add.md @@ -1,22 +1,24 @@ -Plus (`+`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/+conjugate add.html).* + +# Plus (`+`) `+ 𝕩`: Conjugate -``` - + 1 -1 - + Β―1 -Β―1 -``` + + + 1 + 1 + + Β―1 + Β―1 + `𝕨 + 𝕩`: Add `𝕨` added to `𝕩`. Either `𝕨` or `𝕩` can be a character, and if so, the other has to be a number. [Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) -``` - 1 + 2 -3 - 1 + 2β€Ώ3β€Ώ4 -⟨ 3 4 5 ⟩ - 'a' + 4 -'e' -``` + + 1 + 2 + 3 + 1 + 2β€Ώ3β€Ώ4 + ⟨ 3 4 5 ⟩ + 'a' + 4 + 'e' + diff --git a/help/-negate subtract.md b/help/-negate subtract.md index df2cc167..10403db4 100644 --- a/help/-negate subtract.md +++ b/help/-negate subtract.md @@ -1,28 +1,30 @@ -Minus (`-`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/-negate subtract.html).* + +# Minus (`-`) `- 𝕩`: Negate Additive Inverse of `𝕩`. [Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) -``` - - 1 -Β―1 - - Β―1 -1 -``` + + - 1 + Β―1 + - Β―1 + 1 + `𝕨 - 𝕩`: Subtract Subtract `𝕩` from `𝕨`. `𝕨` and `𝕩` can be characters or numbers. [Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) -``` - 1 - 2 -Β―1 - 1 - 2β€Ώ3β€Ώ4 -⟨ Β―1 Β―2 Β―3 ⟩ - 'a' - 4 -']' - 'b' - 'a' -1 -``` + + 1 - 2 + Β―1 + 1 - 2β€Ώ3β€Ώ4 + ⟨ Β―1 Β―2 Β―3 ⟩ + 'a' - 4 + ']' + 'b' - 'a' + 1 + diff --git a/help/merge great.md b/help/>merge great.md index 913a2b6c..a90e1d5d 100644 --- a/help/>merge great.md +++ b/help/>merge great.md @@ -1,4 +1,6 @@ -Greater Than (`>`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/>merge great.html).* + +# Greater Than (`>`) `> 𝕩`: Merge @@ -8,31 +10,31 @@ All elements must have the same rank. Returns atomic values as is. -``` - a ← ⟨⟨1, 2⟩, ⟨3, 4⟩⟩ -⟨ ⟨ 1 2 ⟩ ⟨ 3 4 ⟩ ⟩ - >a -β”Œβ”€ -β•΅ 1 2 - 3 4 - β”˜ - β‰’a -⟨ 2 ⟩ - β‰’>a -⟨ 2 2 ⟩ - -``` + + a ← ⟨⟨1, 2⟩, ⟨3, 4⟩⟩ + ⟨ ⟨ 1 2 ⟩ ⟨ 3 4 ⟩ ⟩ + >a + β”Œβ”€ + β•΅ 1 2 + 3 4 + β”˜ + β‰’a + ⟨ 2 ⟩ + β‰’>a + ⟨ 2 2 ⟩ + + `𝕨 > 𝕩`: Greater Than `𝕨` and `𝕩` can both be either numbers or characters. [Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) -``` - 1 > 3 -0 - 2β€Ώ3β€Ώ0 > 3β€Ώ1β€Ώ0 -⟨ 0 1 0 ⟩ - 'a' > 'b' -1 -``` \ No newline at end of file + + 1 > 3 + 0 + 2β€Ώ3β€Ώ0 > 3β€Ώ1β€Ώ0 + ⟨ 0 1 0 ⟩ + 'a' > 'b' + 1 + diff --git a/help/`scan.md b/help/`scan.md index dc4013b9..5f255d70 100644 --- a/help/`scan.md +++ b/help/`scan.md @@ -1,29 +1,31 @@ -Acute Accent (`` ` ``) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/`scan.html).* -`𝔽` 𝕩`: Fold +# Acute Accent (`` ` ``) + +``𝔽` 𝕩``: Fold Scan over `𝕩` with `𝔽` from left to right, producing intermediate values. -``` - +` 1β€Ώ2β€Ώ3 -⟨ 1 3 6 ⟩ - ⟨1, 1+2, (1+2)+3⟩ -⟨ 1 3 6 ⟩ - -` 1β€Ώ2β€Ώ3 -⟨ 1 Β―1 Β―4 ⟩ - ⟨1, 1-2, (1-2)-3⟩ -⟨ 1 Β―1 Β―4 ⟩ -``` -`𝕨 𝔽` 𝕩`: Scan With initial + + +` 1β€Ώ2β€Ώ3 + ⟨ 1 3 6 ⟩ + ⟨1, 1+2, (1+2)+3⟩ + ⟨ 1 3 6 ⟩ + -` 1β€Ώ2β€Ώ3 + ⟨ 1 Β―1 Β―4 ⟩ + ⟨1, 1-2, (1-2)-3⟩ + ⟨ 1 Β―1 Β―4 ⟩ + +``𝕨 𝔽` 𝕩``: Scan With initial Monadic scan, but use `𝕨` as initial left argument. -``` - 5 +` 1β€Ώ2β€Ώ3 -⟨ 6 8 11 ⟩ - ⟨5+1, (5+1)+2, ((5+1)+2)+3⟩ -⟨ 6 8 11 ⟩ - 5 -` 1β€Ώ2β€Ώ3 -⟨ 4 2 Β―1 ⟩ - ⟨5-1, (5-1)-2, ((5-1)-2)-3⟩ -⟨ 4 2 Β―1 ⟩ -``` \ No newline at end of file + + 5 +` 1β€Ώ2β€Ώ3 + ⟨ 6 8 11 ⟩ + ⟨5+1, (5+1)+2, ((5+1)+2)+3⟩ + ⟨ 6 8 11 ⟩ + 5 -` 1β€Ώ2β€Ώ3 + ⟨ 4 2 Β―1 ⟩ + ⟨5-1, (5-1)-2, ((5-1)-2)-3⟩ + ⟨ 4 2 Β―1 ⟩ + diff --git a/help/sindices replicate.md b/help/sindices replicate.md index 852570d1..c0040925 100644 --- a/help/sindices replicate.md +++ b/help/sindices replicate.md @@ -1,23 +1,25 @@ -Solidus (`/`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/sindices replicate.html).* + +# Solidus (`/`) `/ 𝕩`: Indices Repeat the index of each element in `𝕩` by the element's value. `𝕩` must be rank 1. -``` - / 1β€Ώ2β€Ώ3 -⟨ 0 1 1 2 2 2 ⟩ - / 1β€Ώ0β€Ώ1 -⟨ 0 2 ⟩ -``` + + / 1β€Ώ2β€Ώ3 + ⟨ 0 1 1 2 2 2 ⟩ + / 1β€Ώ0β€Ώ1 + ⟨ 0 2 ⟩ + `𝕨 / 𝕩`: Replicate Repeat each major cell in `𝕩` by the corresponding element in `𝕨`. Atomic `𝕨` applies to all elements. -``` - 3 / "copy" -"cccooopppyyy" - 1β€Ώ0β€Ώ1 / 1β€Ώ2β€Ώ3 -⟨ 1 3 ⟩ -``` \ No newline at end of file + + 3 / "copy" + "cccooopppyyy" + 1β€Ώ0β€Ώ1 / 1β€Ώ2β€Ώ3 + ⟨ 1 3 ⟩ + diff --git a/help/|abs modulus.md b/help/|abs modulus.md index 533ab6b4..7a67ad86 100644 --- a/help/|abs modulus.md +++ b/help/|abs modulus.md @@ -1,25 +1,27 @@ -Pipe (`|`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/|abs modulus.html).* + +# Pipe (`|`) `| 𝕩`: Absolute Value Absolute Value of `𝕩`. [Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) -``` - | Β―2 -2 - | 1β€Ώ3β€ΏΒ―4β€Ώ3 -⟨ 1 3 4 3 ⟩ -``` + + | Β―2 + 2 + | 1β€Ώ3β€ΏΒ―4β€Ώ3 + ⟨ 1 3 4 3 ⟩ + `𝕨 | 𝕩`: Modulus Remainder of `𝕩` divided by `𝕨`. [Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) -``` - 1 | 3 -0 - 2 | 3β€Ώ4β€Ώ5 -⟨ 1 0 1 ⟩ -``` \ No newline at end of file + + 1 | 3 + 0 + 2 | 3β€Ώ4β€Ώ5 + ⟨ 1 0 1 ⟩ + diff --git "a/help/\302\250each.md" "b/help/\302\250each.md" index 2a387b97..1ec3504d 100644 --- "a/help/\302\250each.md" +++ "b/help/\302\250each.md" @@ -1,15 +1,17 @@ -Diaresis (`Β¨`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/Β¨each.html).* + +# Diaresis (`Β¨`) `𝔽¨ 𝕩`, `𝕨 𝔽¨ 𝕩`: Each Apply `𝔽` to/between the major elements of the arguments. (`π”½βš‡Β―1`) -``` - <Β¨ 1β€Ώ2β€Ώ3 -β”Œβ”€ -Β· β”ŒΒ· β”ŒΒ· β”ŒΒ· - Β· 1 Β· 2 Β· 3 - β”˜ β”˜ β”˜ - β”˜ - 4β€Ώ5β€Ώ6 ∾¨ 1β€Ώ2β€Ώ3 -⟨ ⟨ 4 1 ⟩ ⟨ 5 2 ⟩ ⟨ 6 3 ⟩ ⟩ -``` \ No newline at end of file + + <Β¨ 1β€Ώ2β€Ώ3 + β”Œβ”€ + Β· β”ŒΒ· β”ŒΒ· β”ŒΒ· + Β· 1 Β· 2 Β· 3 + β”˜ β”˜ β”˜ + β”˜ + 4β€Ώ5β€Ώ6 ∾¨ 1β€Ώ2β€Ώ3 + ⟨ ⟨ 4 1 ⟩ ⟨ 5 2 ⟩ ⟨ 6 3 ⟩ ⟩ + diff --git "a/help/\302\253shiftbefore.md" "b/help/\302\253shiftbefore.md" index 926dcefb..ae9ec2ce 100644 --- "a/help/\302\253shiftbefore.md" +++ "b/help/\302\253shiftbefore.md" @@ -1,37 +1,39 @@ -Left Pointing Double Angle Quotation (`Β«`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/Β«shiftbefore.html).* + +# Left Pointing Double Angle Quotation (`Β«`) `Β« 𝕩`: Shift Before Remove the first element of `𝕩`, add a cell of fill values to the end of the first axis of `𝕩`. -``` - 78 Β« 1β€Ώ2β€Ώ3 -⟨ 1 2 78 ⟩ - Β« 1β€Ώ2β€Ώ3 -⟨ 2 3 0 ⟩ - Β« 3β€Ώ3 β₯Š 9 -β”Œβ”€ -β•΅ 9 9 9 - 9 9 9 - 0 0 0 - β”˜ -``` + + 78 Β« 1β€Ώ2β€Ώ3 + ⟨ 1 2 78 ⟩ + Β« 1β€Ώ2β€Ώ3 + ⟨ 2 3 0 ⟩ + Β« 3β€Ώ3 β₯Š 9 + β”Œβ”€ + β•΅ 9 9 9 + 9 9 9 + 0 0 0 + β”˜ + `𝕨 Β« 𝕩`: Shift Before Remove the first `≠𝕨` (length) major cells from `𝕩`, join `𝕨` to the end of `𝕩`. Ranks must match. -``` - 8β€Ώ5 Β« 1β€Ώ2β€Ώ3 -⟨ 3 8 5 ⟩ - a ← 3β€Ώ3 β₯Š 9 -β”Œβ”€ -β•΅ 9 9 9 - 9 9 9 - 9 9 9 - β”˜ - 1β€Ώ2β€Ώ3 Β« a -β”Œβ”€ -β•΅ 9 9 9 - 9 9 9 - 1 2 3 - β”˜ -``` \ No newline at end of file + + 8β€Ώ5 Β« 1β€Ώ2β€Ώ3 + ⟨ 3 8 5 ⟩ + a ← 3β€Ώ3 β₯Š 9 + β”Œβ”€ + β•΅ 9 9 9 + 9 9 9 + 9 9 9 + β”˜ + 1β€Ώ2β€Ώ3 Β« a + β”Œβ”€ + β•΅ 9 9 9 + 9 9 9 + 1 2 3 + β”˜ + diff --git "a/help/\302\254not span.md" "b/help/\302\254not span.md" index 5649410e..26349704 100644 --- "a/help/\302\254not span.md" +++ "b/help/\302\254not span.md" @@ -1,25 +1,27 @@ -Not (`Β¬`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/Β¬not span.html).* + +# Not (`Β¬`) `Β¬ 𝕩`: Logical Not Logical Not of `𝕩`. [Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) -``` - Β¬ 0 -1 - Β¬ 1β€Ώ0 -⟨ 0 1 ⟩ -``` + + Β¬ 0 + 1 + Β¬ 1β€Ώ0 + ⟨ 0 1 ⟩ + `𝕨 Β¬ 𝕩`: Span Count of numbers in the inclusive range from `𝕩` to `𝕨`. [Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) -``` - 3 Β¬ 1 -3 - 3β€Ώ4 Β¬ 0β€Ώ2 -⟨ 4 3 ⟩ -``` \ No newline at end of file + + 3 Β¬ 1 + 3 + 3β€Ώ4 Β¬ 0β€Ώ2 + ⟨ 4 3 ⟩ + diff --git "a/help/\302\264fold.md" "b/help/\302\264fold.md" index 0f3d2a69..2561bd89 100644 --- "a/help/\302\264fold.md" +++ "b/help/\302\264fold.md" @@ -1,28 +1,30 @@ -Acute Accent (`Β΄`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/Β΄fold.html).* + +# Acute Accent (`Β΄`) `𝔽´ 𝕩`: Fold Fold over `𝕩` with `𝔽` from right to left i.e. Insert `𝔽` between the elements of `𝕩`. -``` - +Β΄ 1β€Ώ2β€Ώ3 -6 - 1+2+3 -6 - -Β΄ 1β€Ώ2β€Ώ3 -2 - 1-2-3 -2 -``` + + +Β΄ 1β€Ώ2β€Ώ3 + 6 + 1+2+3 + 6 + -Β΄ 1β€Ώ2β€Ώ3 + 2 + 1-2-3 + 2 + `𝕨 𝔽´ 𝕩`: Fold With initial Monadic fold, but use `𝕨` as initial right argument. -``` - 5 +Β΄ 1β€Ώ2β€Ώ3 -11 - 1+2+3+5 -11 - 5 -Β΄ 1β€Ώ2β€Ώ3 -Β―3 - 1-2-3-5 -Β―3 -``` \ No newline at end of file + + 5 +Β΄ 1β€Ώ2β€Ώ3 + 11 + 1+2+3+5 + 11 + 5 -Β΄ 1β€Ώ2β€Ώ3 + Β―3 + 1-2-3-5 + Β―3 + diff --git "a/help/\302\273shiftafter.md" "b/help/\302\273shiftafter.md" index af8a6bb1..0d0bf6ff 100644 --- "a/help/\302\273shiftafter.md" +++ "b/help/\302\273shiftafter.md" @@ -1,37 +1,39 @@ -Right Pointing Double Angle Quotation (`Β»`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/Β»shiftafter.html).* + +# Right Pointing Double Angle Quotation (`Β»`) `Β» 𝕩`: Shift After Remove the last element of `𝕩`, add a cell of fill values to the start of the first axis of `𝕩`. -``` - Β» 1β€Ώ2β€Ώ3 -⟨ 0 1 2 ⟩ - Β» 3β€Ώ3 β₯Š 9 -β”Œβ”€ -β•΅ 0 0 0 - 9 9 9 - 9 9 9 - β”˜ -``` + + Β» 1β€Ώ2β€Ώ3 + ⟨ 0 1 2 ⟩ + Β» 3β€Ώ3 β₯Š 9 + β”Œβ”€ + β•΅ 0 0 0 + 9 9 9 + 9 9 9 + β”˜ + `𝕨 Β» 𝕩`: Shift After Remove the last `≠𝕨` (length) major cells from `𝕩`, join `𝕨` to the start of `𝕩`. Ranks must match. -``` - 78 Β» 1β€Ώ2β€Ώ3 -⟨ 78 1 2 ⟩ - 1β€Ώ2 Β» 1β€Ώ2β€Ώ3 -⟨ 1 2 1 ⟩ - a ← 3β€Ώ3 β₯Š 9 -β”Œβ”€ -β•΅ 9 9 9 - 9 9 9 - 9 9 9 - β”˜ - 1β€Ώ2β€Ώ3 Β» a -β”Œβ”€ -β•΅ 1 2 3 - 9 9 9 - 9 9 9 - β”˜ -``` \ No newline at end of file + + 78 Β» 1β€Ώ2β€Ώ3 + ⟨ 78 1 2 ⟩ + 1β€Ώ2 Β» 1β€Ώ2β€Ώ3 + ⟨ 1 2 1 ⟩ + a ← 3β€Ώ3 β₯Š 9 + β”Œβ”€ + β•΅ 9 9 9 + 9 9 9 + 9 9 9 + β”˜ + 1β€Ώ2β€Ώ3 Β» a + β”Œβ”€ + β•΅ 1 2 3 + 9 9 9 + 9 9 9 + β”˜ + diff --git "a/help/\303\227sign multiply.md" "b/help/\303\227sign multiply.md" index 465d5023..ea513dbe 100644 --- "a/help/\303\227sign multiply.md" +++ "b/help/\303\227sign multiply.md" @@ -1,4 +1,6 @@ -Times (`Γ—`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/Γ—sign multiply.html).* + +# Times (`Γ—`) `Γ— 𝕩`: Sign @@ -8,19 +10,19 @@ Sign of `𝕩`. - `1` if `𝕩 > 0` [Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) -``` - Γ— Β―5β€Ώ0β€Ώ5β€Ώ1 -⟨ Β―1 0 1 1 ⟩ -``` + + Γ— Β―5β€Ώ0β€Ώ5β€Ώ1 + ⟨ Β―1 0 1 1 ⟩ + `𝕨 Γ— 𝕩`: Multiply `𝕨` multiplied by `𝕩`. [Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) -``` - 1 Γ— 2 -2 - 2 Γ— 2β€Ώ3β€Ώ4 -⟨ 4 6 8 ⟩ -``` \ No newline at end of file + + 1 Γ— 2 + 2 + 2 Γ— 2β€Ώ3β€Ώ4 + ⟨ 4 6 8 ⟩ + diff --git "a/help/\303\267reciprocal divide.md" "b/help/\303\267reciprocal divide.md" index b43b5a76..d55fb14b 100644 --- "a/help/\303\267reciprocal divide.md" +++ "b/help/\303\267reciprocal divide.md" @@ -1,20 +1,22 @@ -Divide (`Γ·`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/Γ·reciprocal divide.html).* + +# Divide (`Γ·`) `Γ· 𝕩`: Reciprocal Gives `1 Γ· 𝕩`. [Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) -``` - Γ· 5 -0.2 -``` + + Γ· 5 + 0.2 + `𝕨 Γ· 𝕩`: Divide `𝕨` divided by `𝕩`. [Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) -``` -ExamplesIfAny -``` \ No newline at end of file + + ExamplesIfAny + diff --git "a/help/\313\230cells.md" "b/help/\313\230cells.md" index 4f5a3751..39a686f2 100644 --- "a/help/\313\230cells.md" +++ "b/help/\313\230cells.md" @@ -1,26 +1,28 @@ -Breve (`˘`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/˘cells.html).* + +# Breve (`˘`) `π”½Λ˜ 𝕩`, `𝕨 π”½Λ˜ 𝕩`: Cells Apply `𝔽` to/between the major cells of the arguments. (`π”½βŽ‰Β―1`) -``` - a ← 3β€Ώ3 β₯Š ↕9 -β”Œβ”€ -β•΅ 0 1 2 - 3 4 5 - 6 7 8 - β”˜ - <˘ a -⟨ ⟨ 0 1 2 ⟩ ⟨ 3 4 5 ⟩ ⟨ 6 7 8 ⟩ ⟩ - a β‰Λ˜ a -β”Œβ”€ -β•Ž 0 1 2 - 0 1 2 - - 3 4 5 - 3 4 5 - - 6 7 8 - 6 7 8 - β”˜ -``` \ No newline at end of file + + a ← 3β€Ώ3 β₯Š ↕9 + β”Œβ”€ + β•΅ 0 1 2 + 3 4 5 + 6 7 8 + β”˜ + <˘ a + ⟨ ⟨ 0 1 2 ⟩ ⟨ 3 4 5 ⟩ ⟨ 6 7 8 ⟩ ⟩ + a β‰Λ˜ a + β”Œβ”€ + β•Ž 0 1 2 + 0 1 2 + + 3 4 5 + 3 4 5 + + 6 7 8 + 6 7 8 + β”˜ + diff --git "a/help/\313\231constant.md" "b/help/\313\231constant.md" index c7025d3e..f34e7ca4 100644 --- "a/help/\313\231constant.md" +++ "b/help/\313\231constant.md" @@ -1,11 +1,13 @@ -Dot Above (`Λ™`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/Λ™constant.html).* + +# Dot Above (`Λ™`) `𝔽˙ 𝕩`, `𝕨 𝔽˙ 𝕩`: Constant Returns a function that will always return `𝕗`. -``` - "hello" (1 Λ™) 2 -1 - "hello" ({𝕨+𝕩} Λ™) 2 -(function block) -``` \ No newline at end of file + + "hello" (1 Λ™) 2 + 1 + "hello" ({𝕨+𝕩} Λ™) 2 + (function block) + diff --git "a/help/\313\234self swap.md" "b/help/\313\234self swap.md" index d50ddc9f..dcef5130 100644 --- "a/help/\313\234self swap.md" +++ "b/help/\313\234self swap.md" @@ -1,21 +1,23 @@ -Small Tilde (`˜`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/˜self swap.html).* + +# Small Tilde (`˜`) `π”½Λœ 𝕩`: Self Supplies `𝕩` as a left argument to `𝔽` (`𝕩 𝔽 𝕩`). -``` - 1 + 1 -2 - +˜ 1 -2 -``` + + 1 + 1 + 2 + +˜ 1 + 2 + `𝕨 π”½Λœ 𝕩`: Swap Swaps the arguments of `𝔽` (`𝕩 𝔽 𝕨`). -``` - 1 - 2 -Β―1 - 1 -˜ 2 -1 -``` \ No newline at end of file + + 1 - 2 + Β―1 + 1 -˜ 2 + 1 + diff --git "a/help/\342\201\274undo.md" "b/help/\342\201\274undo.md" index cac9cf46..10b622b3 100644 --- "a/help/\342\201\274undo.md" +++ "b/help/\342\201\274undo.md" @@ -1,20 +1,22 @@ -Superscript Equals Sign (`⁼`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/⁼undo.html).* + +# Superscript Equals Sign (`⁼`) `𝔽⁼ 𝕩`, `𝕨 𝔽⁼ 𝕩`: Undo Invert the function `𝔽`, or use its defined inverse. Not all functions have inverses. -``` - 1 - 2 -Β―1 - 1 -⁼ 2 -Β―1 - √ 16 -4 - √⁼ 4 -16 - ⋆ 1 -2.718281828459045 - ⋆⁼ 2.718281828459045 -1 -``` \ No newline at end of file + + 1 - 2 + Β―1 + 1 -⁼ 2 + Β―1 + √ 16 + 4 + √⁼ 4 + 16 + ⋆ 1 + 2.718281828459045 + ⋆⁼ 2.718281828459045 + 1 + diff --git "a/help/\342\206\221prefixes take.md" "b/help/\342\206\221prefixes take.md" index 139ebda4..73530b51 100644 --- "a/help/\342\206\221prefixes take.md" +++ "b/help/\342\206\221prefixes take.md" @@ -1,26 +1,28 @@ -Up Arrow (`↑`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/↑prefixes take.html).* + +# Up Arrow (`↑`) `↑ 𝕩`: Prefixes Prefixes of array `𝕩` along its first axis. -``` - ↑ 1β€Ώ2β€Ώ3β€Ώ4 -⟨ ⟨⟩ ⟨ 1 ⟩ ⟨ 1 2 ⟩ ⟨ 1 2 3 ⟩ ⟨ 1 2 3 4 ⟩ ⟩ - a ← 3β€Ώ3 β₯Š ↕9 -β”Œβ”€ -β•΅ 0 1 2 - 3 4 5 - 6 7 8 - β”˜ - ↑ a -β”Œβ”€ -Β· ↕0β€Ώ3 β”Œβ”€ β”Œβ”€ β”Œβ”€ - β•΅ 0 1 2 β•΅ 0 1 2 β•΅ 0 1 2 - β”˜ 3 4 5 3 4 5 - β”˜ 6 7 8 - β”˜ - β”˜ -``` + + ↑ 1β€Ώ2β€Ώ3β€Ώ4 + ⟨ ⟨⟩ ⟨ 1 ⟩ ⟨ 1 2 ⟩ ⟨ 1 2 3 ⟩ ⟨ 1 2 3 4 ⟩ ⟩ + a ← 3β€Ώ3 β₯Š ↕9 + β”Œβ”€ + β•΅ 0 1 2 + 3 4 5 + 6 7 8 + β”˜ + ↑ a + β”Œβ”€ + Β· ↕0β€Ώ3 β”Œβ”€ β”Œβ”€ β”Œβ”€ + β•΅ 0 1 2 β•΅ 0 1 2 β•΅ 0 1 2 + β”˜ 3 4 5 3 4 5 + β”˜ 6 7 8 + β”˜ + β”˜ + `𝕨 ↑ 𝕩`: Take @@ -29,34 +31,34 @@ For each integer in `𝕨`, take that many elements from each dimension of `𝕩 Negative numbers take from the end. If any of the elements in `𝕨` are greater than the length of their respective dimension, the dimension is extended with a fill value. -``` - 3 ↑ 1β€Ώ3β€Ώ5β€Ώ67 -⟨ 1 3 5 ⟩ - a ← 4β€Ώ4 β₯Š ↕16 -β”Œβ”€ -β•΅ 0 1 2 3 - 4 5 6 7 - 8 9 10 11 - 12 13 14 15 + + 3 ↑ 1β€Ώ3β€Ώ5β€Ώ67 + ⟨ 1 3 5 ⟩ + a ← 4β€Ώ4 β₯Š ↕16 + β”Œβ”€ + β•΅ 0 1 2 3 + 4 5 6 7 + 8 9 10 11 + 12 13 14 15 + β”˜ + 3β€Ώ3 ↑ a + β”Œβ”€ + β•΅ 0 1 2 + 4 5 6 + 8 9 10 + β”˜ + 5β€Ώ5 ↑ a + β”Œβ”€ + β•΅ 0 1 2 3 0 + 4 5 6 7 0 + 8 9 10 11 0 + 12 13 14 15 0 + 0 0 0 0 0 + β”˜ + 3β€ΏΒ―3 ↑ a + β”Œβ”€ + β•΅ 1 2 3 + 5 6 7 + 9 10 11 β”˜ - 3β€Ώ3 ↑ a -β”Œβ”€ -β•΅ 0 1 2 - 4 5 6 - 8 9 10 - β”˜ - 5β€Ώ5 ↑ a -β”Œβ”€ -β•΅ 0 1 2 3 0 - 4 5 6 7 0 - 8 9 10 11 0 - 12 13 14 15 0 - 0 0 0 0 0 - β”˜ - 3β€ΏΒ―3 ↑ a -β”Œβ”€ -β•΅ 1 2 3 - 5 6 7 - 9 10 11 - β”˜ -``` \ No newline at end of file + diff --git "a/help/\342\206\223suffixes drop.md" "b/help/\342\206\223suffixes drop.md" index a1a0c346..39648ccd 100644 --- "a/help/\342\206\223suffixes drop.md" +++ "b/help/\342\206\223suffixes drop.md" @@ -1,51 +1,53 @@ -Down Arrow (`↓`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/↓suffixes drop.html).* + +# Down Arrow (`↓`) `↓ 𝕩`: Suffixes Suffixes of array `𝕩` along its first axis. -``` - ↓ 1β€Ώ2β€Ώ3β€Ώ4 -⟨ ⟨ 1 2 3 4 ⟩ ⟨ 2 3 4 ⟩ ⟨ 3 4 ⟩ ⟨ 4 ⟩ ⟨⟩ ⟩ - a ← 3β€Ώ3 β₯Š ↕9 -β”Œβ”€ -β•΅ 0 1 2 - 3 4 5 - 6 7 8 - β”˜ - ↓ a -β”Œβ”€ -Β· β”Œβ”€ β”Œβ”€ β”Œβ”€ ↕0β€Ώ3 - β•΅ 0 1 2 β•΅ 3 4 5 β•΅ 6 7 8 - 3 4 5 6 7 8 β”˜ - 6 7 8 β”˜ - β”˜ - β”˜ -``` + + ↓ 1β€Ώ2β€Ώ3β€Ώ4 + ⟨ ⟨ 1 2 3 4 ⟩ ⟨ 2 3 4 ⟩ ⟨ 3 4 ⟩ ⟨ 4 ⟩ ⟨⟩ ⟩ + a ← 3β€Ώ3 β₯Š ↕9 + β”Œβ”€ + β•΅ 0 1 2 + 3 4 5 + 6 7 8 + β”˜ + ↓ a + β”Œβ”€ + Β· β”Œβ”€ β”Œβ”€ β”Œβ”€ ↕0β€Ώ3 + β•΅ 0 1 2 β•΅ 3 4 5 β•΅ 6 7 8 + 3 4 5 6 7 8 β”˜ + 6 7 8 β”˜ + β”˜ + β”˜ + `𝕨 ↓ 𝕩`: Drop For each integer in `𝕨`, drop that many elements from the beginning of each dimension of `𝕩`. Negative numbers drop from the end. -``` - 3 ↓ 1β€Ώ3β€Ώ5β€Ώ67 -⟨ 67 ⟩ - a ← 4β€Ώ4 β₯Š ↕16 -β”Œβ”€ -β•΅ 0 1 2 3 - 4 5 6 7 - 8 9 10 11 - 12 13 14 15 - β”˜ - 3β€Ώ3 ↓ a -β”Œβ”€ -β•΅ 15 - β”˜ - 5β€Ώ5 ↓ a -β”Œβ” -β””β”˜ - 3β€ΏΒ―3 ↓ a -β”Œβ”€ -β•΅ 12 - β”˜ -``` \ No newline at end of file + + 3 ↓ 1β€Ώ3β€Ώ5β€Ώ67 + ⟨ 67 ⟩ + a ← 4β€Ώ4 β₯Š ↕16 + β”Œβ”€ + β•΅ 0 1 2 3 + 4 5 6 7 + 8 9 10 11 + 12 13 14 15 + β”˜ + 3β€Ώ3 ↓ a + β”Œβ”€ + β•΅ 15 + β”˜ + 5β€Ώ5 ↓ a + β”Œβ” + β””β”˜ + 3β€ΏΒ―3 ↓ a + β”Œβ”€ + β•΅ 12 + β”˜ + diff --git "a/help/\342\206\225range windows.md" "b/help/\342\206\225range windows.md" index 3cb886e5..d052bce0 100644 --- "a/help/\342\206\225range windows.md" +++ "b/help/\342\206\225range windows.md" @@ -1,51 +1,53 @@ -Up Down Arrow (`↕`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/↕range windows.html).* + +# Up Down Arrow (`↕`) `↕ 𝕩`: Range Return all indices to index into an array of shape `𝕩`, in the shape described by `𝕩`. When given a single number, range from 0 to `𝕩-1`. -``` - ↕ 4 -⟨ 0 1 2 3 ⟩ - ↕ 4β€Ώ5 -β”Œβ”€ -β•΅ ⟨ 0 0 ⟩ ⟨ 0 1 ⟩ ⟨ 0 2 ⟩ ⟨ 0 3 ⟩ ⟨ 0 4 ⟩ - ⟨ 1 0 ⟩ ⟨ 1 1 ⟩ ⟨ 1 2 ⟩ ⟨ 1 3 ⟩ ⟨ 1 4 ⟩ - ⟨ 2 0 ⟩ ⟨ 2 1 ⟩ ⟨ 2 2 ⟩ ⟨ 2 3 ⟩ ⟨ 2 4 ⟩ - ⟨ 3 0 ⟩ ⟨ 3 1 ⟩ ⟨ 3 2 ⟩ ⟨ 3 3 ⟩ ⟨ 3 4 ⟩ - β”˜ -``` + + ↕ 4 + ⟨ 0 1 2 3 ⟩ + ↕ 4β€Ώ5 + β”Œβ”€ + β•΅ ⟨ 0 0 ⟩ ⟨ 0 1 ⟩ ⟨ 0 2 ⟩ ⟨ 0 3 ⟩ ⟨ 0 4 ⟩ + ⟨ 1 0 ⟩ ⟨ 1 1 ⟩ ⟨ 1 2 ⟩ ⟨ 1 3 ⟩ ⟨ 1 4 ⟩ + ⟨ 2 0 ⟩ ⟨ 2 1 ⟩ ⟨ 2 2 ⟩ ⟨ 2 3 ⟩ ⟨ 2 4 ⟩ + ⟨ 3 0 ⟩ ⟨ 3 1 ⟩ ⟨ 3 2 ⟩ ⟨ 3 3 ⟩ ⟨ 3 4 ⟩ + β”˜ + `𝕨 ↕ 𝕩`: Windows Overlapping slices of `𝕩` which are of shape `𝕨`. -``` - 5 ↕ "abcdefg" -β”Œβ”€ -β•΅"abcde - bcdef - cdefg" - β”˜ - a ← 3β€Ώ3β₯Šβ†•9 -β”Œβ”€ -β•΅ 0 1 2 - 3 4 5 - 6 7 8 - β”˜ - 2β€Ώ2 ↕ a -β”Œβ”€ -┆ 0 1 - 3 4 - - 1 2 - 4 5 - - - 3 4 - 6 7 - - 4 5 - 7 8 - β”˜ -``` \ No newline at end of file + + 5 ↕ "abcdefg" + β”Œβ”€ + β•΅"abcde + bcdef + cdefg" + β”˜ + a ← 3β€Ώ3β₯Šβ†•9 + β”Œβ”€ + β•΅ 0 1 2 + 3 4 5 + 6 7 8 + β”˜ + 2β€Ώ2 ↕ a + β”Œβ”€ + ┆ 0 1 + 3 4 + + 1 2 + 4 5 + + + 3 4 + 6 7 + + 4 5 + 7 8 + β”˜ + diff --git "a/help/\342\210\212markfirst memberof.md" "b/help/\342\210\212markfirst memberof.md" index 05e7ce28..04d4a940 100644 --- "a/help/\342\210\212markfirst memberof.md" +++ "b/help/\342\210\212markfirst memberof.md" @@ -1,37 +1,39 @@ -Element Of (`∊`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/∊markfirst memberof.html).* + +# Element Of (`∊`) `∊ 𝕩`: Unique Mask Mark the first occurrence of each major cell in `𝕩` with a 1, and all other occurrences with a 0. -``` - ∊ 4β€Ώ5β€Ώ6β€Ώ6β€Ώ4β€Ώ7β€Ώ5 -⟨ 1 1 1 0 0 1 0 ⟩ - a ← 3β€Ώ3 β₯Š ↕9 -β”Œβ”€ -β•΅ 0 1 2 - 3 4 5 - 6 7 8 - β”˜ - ∊ a -⟨ 1 1 1 ⟩ -``` + + ∊ 4β€Ώ5β€Ώ6β€Ώ6β€Ώ4β€Ώ7β€Ώ5 + ⟨ 1 1 1 0 0 1 0 ⟩ + a ← 3β€Ώ3 β₯Š ↕9 + β”Œβ”€ + β•΅ 0 1 2 + 3 4 5 + 6 7 8 + β”˜ + ∊ a + ⟨ 1 1 1 ⟩ + `𝕨 ∊ 𝕩`: Member Of Is each element in `𝕨` a major cell of `𝕩`? -``` - ⟨1⟩ ∊ ↕9 -⟨ 1 ⟩ - a ← 3β€Ώ3 β₯Š ↕9 -β”Œβ”€ -β•΅ 0 1 2 - 3 4 5 - 6 7 8 + + ⟨1⟩ ∊ ↕9 + ⟨ 1 ⟩ + a ← 3β€Ώ3 β₯Š ↕9 + β”Œβ”€ + β•΅ 0 1 2 + 3 4 5 + 6 7 8 + β”˜ + ⟨0β€Ώ1β€Ώ2⟩ ∊ a + β”ŒΒ· + Β· 0 β”˜ - ⟨0β€Ώ1β€Ώ2⟩ ∊ a -β”ŒΒ· -Β· 0 - β”˜ - ⟨1β€Ώ3 β₯Š 0β€Ώ1β€Ώ2⟩ ∊ a -⟨ 1 ⟩ -``` \ No newline at end of file + ⟨1β€Ώ3 β₯Š 0β€Ώ1β€Ώ2⟩ ∊ a + ⟨ 1 ⟩ + diff --git "a/help/\342\210\230atop.md" "b/help/\342\210\230atop.md" index b1bcd796..9a713560 100644 --- "a/help/\342\210\230atop.md" +++ "b/help/\342\210\230atop.md" @@ -1,27 +1,29 @@ -Ring Operator (`∘`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/∘atop.html).* + +# Ring Operator (`∘`) `π”½βˆ˜π”Ύ 𝕩`: Atop Apply `𝔾` to `𝕩`, then apply `𝔽` (`𝔽 𝔾 𝕩`). `𝔽` and `𝔾` must be monadic. -``` - -∘- 5 -5 - - - 5 -5 -``` + + -∘- 5 + 5 + - - 5 + 5 + `𝕨 π”½βˆ˜π”Ύ 𝕩`: Dyadic Atop Apply `𝔾` to `𝕨` and `𝕩`, then apply `𝔽` (`𝔽 (𝕨 𝔾 𝕩)`). `𝔽` must be monadic, and `𝔾` must be dyadic. -``` - 1 -∘+ 2 -Β―3 - 1 - + 2 -Β―1 - - 1 + 2 -Β―3 -``` \ No newline at end of file + + 1 -∘+ 2 + Β―3 + 1 - + 2 + Β―1 + - 1 + 2 + Β―3 + diff --git "a/help/\342\210\232squareroot root.md" "b/help/\342\210\232squareroot root.md" index 8e14ff8f..b7a30406 100644 --- "a/help/\342\210\232squareroot root.md" +++ "b/help/\342\210\232squareroot root.md" @@ -1,21 +1,23 @@ -Root (`√`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/√squareroot root.html).* + +# Root (`√`) `√ 𝕩`: Square root [Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) -``` - √ 2 -1.4142135623730951 -``` + + √ 2 + 1.4142135623730951 + `𝕨 √ 𝕩`: Root `𝕨`th root of `𝕩`. [Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) -``` - 2 √ 2 -1.4142135623730951 - 1β€Ώ2β€Ώ3β€Ώ4 √ 4 -⟨ 4 2 1.5874010519681994 1.414213562373095 ⟩ -``` \ No newline at end of file + + 2 √ 2 + 1.4142135623730951 + 1β€Ώ2β€Ώ3β€Ώ4 √ 4 + ⟨ 4 2 1.5874010519681994 1.414213562373095 ⟩ + diff --git "a/help/\342\210\247sortup and.md" "b/help/\342\210\247sortup and.md" index dd53aee3..9b23d4ac 100644 --- "a/help/\342\210\247sortup and.md" +++ "b/help/\342\210\247sortup and.md" @@ -1,21 +1,23 @@ -Logical And (`∧`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/∧sortup and.html).* + +# Logical And (`∧`) `∧ 𝕩`: Sort Up Sort array `𝕩` in ascending order. -``` - ∧ 3β€Ώ1β€Ώ4β€Ώ1β€Ώ5 -⟨ 1 1 3 4 5 ⟩ -``` + + ∧ 3β€Ώ1β€Ώ4β€Ώ1β€Ώ5 + ⟨ 1 1 3 4 5 ⟩ + `𝕨 ∧ 𝕩`: Logical And Logical And of `𝕨` and `𝕩`. [Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) -``` - 1 ∧ 1 -1 - 1β€Ώ0 ∧ 1β€Ώ1 -⟨ 1 0 ⟩ -``` \ No newline at end of file + + 1 ∧ 1 + 1 + 1β€Ώ0 ∧ 1β€Ώ1 + ⟨ 1 0 ⟩ + diff --git "a/help/\342\210\250sortdown or.md" "b/help/\342\210\250sortdown or.md" index 6e8d27b7..78eebef9 100644 --- "a/help/\342\210\250sortdown or.md" +++ "b/help/\342\210\250sortdown or.md" @@ -1,23 +1,25 @@ -Logical Or (`∨`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/∨sortdown or.html).* + +# Logical Or (`∨`) `∨ 𝕩`: Sort Down Sort array `𝕩` in descending order. -``` - ∨ 3β€Ώ1β€Ώ4β€Ώ1β€Ώ5 -⟨ 5 4 3 1 1 ⟩ -``` + + ∨ 3β€Ώ1β€Ώ4β€Ώ1β€Ώ5 + ⟨ 5 4 3 1 1 ⟩ + `𝕨 ∨ 𝕩`: Logical Or Logical Or of `𝕨` and `𝕩`. [Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) -``` - 1 ∨ 0 -1 - 1β€Ώ0 ∨ 1β€Ώ1 -⟨ 1 1 ⟩ - 0 ∨ 0 -0 -``` \ No newline at end of file + + 1 ∨ 0 + 1 + 1β€Ώ0 ∨ 1β€Ώ1 + ⟨ 1 1 ⟩ + 0 ∨ 0 + 0 + diff --git "a/help/\342\210\276join jointo.md" "b/help/\342\210\276join jointo.md" index 028ea885..b69f5a45 100644 --- "a/help/\342\210\276join jointo.md" +++ "b/help/\342\210\276join jointo.md" @@ -1,60 +1,62 @@ -Lazy S (`∾`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/∾join jointo.html).* + +# Lazy S (`∾`) `∾ 𝕩`: Join Join all elements of `𝕩` together. Element ranks must be compatible. -``` - ∾ ⟨1β€Ώ2, 3, 4β€Ώ5⟩ -⟨ 1 2 3 4 5 ⟩ - m ← (3β€Ώ1β‰βŒœ4β€Ώ2β€Ώ5) β₯ŠΒ¨ 2β€Ώ3β₯Šβ†•6 -β”Œβ”€ -β•΅ β”Œβ”€ β”Œβ”€ β”Œβ”€ - β•΅ 0 0 0 0 β•΅ 1 1 β•΅ 2 2 2 2 2 - 0 0 0 0 1 1 2 2 2 2 2 - 0 0 0 0 1 1 2 2 2 2 2 - β”˜ β”˜ β”˜ - β”Œβ”€ β”Œβ”€ β”Œβ”€ - β•΅ 3 3 3 3 β•΅ 4 4 β•΅ 5 5 5 5 5 - β”˜ β”˜ β”˜ - β”˜ - ∾ m -β”Œβ”€ -β•΅ 0 0 0 0 1 1 2 2 2 2 2 - 0 0 0 0 1 1 2 2 2 2 2 - 0 0 0 0 1 1 2 2 2 2 2 - 3 3 3 3 4 4 5 5 5 5 5 - β”˜ -``` + + ∾ ⟨1β€Ώ2, 3, 4β€Ώ5⟩ + ⟨ 1 2 3 4 5 ⟩ + m ← (3β€Ώ1β‰βŒœ4β€Ώ2β€Ώ5) β₯ŠΒ¨ 2β€Ώ3β₯Šβ†•6 + β”Œβ”€ + β•΅ β”Œβ”€ β”Œβ”€ β”Œβ”€ + β•΅ 0 0 0 0 β•΅ 1 1 β•΅ 2 2 2 2 2 + 0 0 0 0 1 1 2 2 2 2 2 + 0 0 0 0 1 1 2 2 2 2 2 + β”˜ β”˜ β”˜ + β”Œβ”€ β”Œβ”€ β”Œβ”€ + β•΅ 3 3 3 3 β•΅ 4 4 β•΅ 5 5 5 5 5 + β”˜ β”˜ β”˜ + β”˜ + ∾ m + β”Œβ”€ + β•΅ 0 0 0 0 1 1 2 2 2 2 2 + 0 0 0 0 1 1 2 2 2 2 2 + 0 0 0 0 1 1 2 2 2 2 2 + 3 3 3 3 4 4 5 5 5 5 5 + β”˜ + `𝕨 ∾ 𝕩`: Join Join `𝕨` to `𝕩` along the first axis. -``` - "abcd" ∾ "EFG" -"abcdEFG" - a ← 3β€Ώ3 β₯Š ↕9 -β”Œβ”€ -β•΅ 0 1 2 - 3 4 5 - 6 7 8 - β”˜ - c ← 4β€Ώ3 β₯Š ↕12 -β”Œβ”€ -β•΅ 0 1 2 - 3 4 5 - 6 7 8 - 9 10 11 - β”˜ - a∾c -β”Œβ”€ -β•΅ 0 1 2 - 3 4 5 - 6 7 8 - 0 1 2 - 3 4 5 - 6 7 8 - 9 10 11 - β”˜ -``` \ No newline at end of file + + "abcd" ∾ "EFG" + "abcdEFG" + a ← 3β€Ώ3 β₯Š ↕9 + β”Œβ”€ + β•΅ 0 1 2 + 3 4 5 + 6 7 8 + β”˜ + c ← 4β€Ώ3 β₯Š ↕12 + β”Œβ”€ + β•΅ 0 1 2 + 3 4 5 + 6 7 8 + 9 10 11 + β”˜ + a∾c + β”Œβ”€ + β•΅ 0 1 2 + 3 4 5 + 6 7 8 + 0 1 2 + 3 4 5 + 6 7 8 + 9 10 11 + β”˜ + diff --git "a/help/\342\211\215solo couple.md" "b/help/\342\211\215solo couple.md" index 9ce6366a..03b8fe03 100644 --- "a/help/\342\211\215solo couple.md" +++ "b/help/\342\211\215solo couple.md" @@ -1,42 +1,44 @@ -Tape (`≍`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/≍solo couple.html).* + +# Tape (`≍`) `≍ 𝕩`: Solo Add a dimension to `𝕩`. -``` - ≍ 1 -⟨ 1 ⟩ - - ≍≍ 1 -β”Œβ”€ -β•΅ 1 - β”˜ - - ≍≍≍ 1 -β”Œβ”€ -β•Ž 1 - β”˜ - - ≍≍ 1β€Ώ2β€Ώ3β€Ώ4 -β”Œβ”€ -β•΅ 1 2 3 4 - β”˜ - - ≍≍≍ 1β€Ώ2β€Ώ3β€Ώ4 -β”Œβ”€ -β•Ž 1 2 3 4 - β”˜ -``` + + ≍ 1 + ⟨ 1 ⟩ + + ≍≍ 1 + β”Œβ”€ + β•΅ 1 + β”˜ + + ≍≍≍ 1 + β”Œβ”€ + β•Ž 1 + β”˜ + + ≍≍ 1β€Ώ2β€Ώ3β€Ώ4 + β”Œβ”€ + β•΅ 1 2 3 4 + β”˜ + + ≍≍≍ 1β€Ώ2β€Ώ3β€Ώ4 + β”Œβ”€ + β•Ž 1 2 3 4 + β”˜ + `𝕨 ≍ 𝕩`: Couple Join `𝕨` and `𝕩` along a newly created axis. -``` - 1 ≍ 3 -⟨ 1 3 ⟩ - 1β€Ώ2 ≍ 2β€Ώ3 -β”Œβ”€ -β•΅ 1 2 - 2 3 - β”˜ -``` \ No newline at end of file + + 1 ≍ 3 + ⟨ 1 3 ⟩ + 1β€Ώ2 ≍ 2β€Ώ3 + β”Œβ”€ + β•΅ 1 2 + 2 3 + β”˜ + diff --git "a/help/\342\211\240length notequal.md" "b/help/\342\211\240length notequal.md" index 770530e6..e5696435 100644 --- "a/help/\342\211\240length notequal.md" +++ "b/help/\342\211\240length notequal.md" @@ -1,30 +1,32 @@ -Not Equal (`β‰ `) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/β‰ length notequal.html).* + +# Not Equal (`β‰ `) `β‰  𝕩`: Length Length of the first dimension of `𝕩`. -``` - β‰  3 -1 - β‰  ⟨1, 2, 3⟩ -3 - β‰  3β€Ώ4β€Ώ5β₯Š0 -3 - β‰  1β€Ώ4β€Ώ5β₯Š0 -1 - β‰  4β€Ώ4β€Ώ5β₯Š0 -4 -``` + + β‰  3 + 1 + β‰  ⟨1, 2, 3⟩ + 3 + β‰  3β€Ώ4β€Ώ5β₯Š0 + 3 + β‰  1β€Ώ4β€Ώ5β₯Š0 + 1 + β‰  4β€Ώ4β€Ώ5β₯Š0 + 4 + `𝕨 β‰  𝕩`: Not Equal To [Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) -``` - 1 β‰  3 -1 - 2β€Ώ3β€Ώ0 β‰  3β€Ώ1β€Ώ0 -⟨ 1 1 0 ⟩ - 'a' β‰  'a' -0 -``` \ No newline at end of file + + 1 β‰  3 + 1 + 2β€Ώ3β€Ώ0 β‰  3β€Ώ1β€Ώ0 + ⟨ 1 1 0 ⟩ + 'a' β‰  'a' + 0 + diff --git "a/help/\342\211\241depth match.md" "b/help/\342\211\241depth match.md" index 0575adef..32d8960b 100644 --- "a/help/\342\211\241depth match.md" +++ "b/help/\342\211\241depth match.md" @@ -1,23 +1,25 @@ -Identical To (`≑`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/≑depth match.html).* + +# Identical To (`≑`) `≑ 𝕩`: Depth Highest level of nesting in `𝕩`. -``` - ≑ 2β€Ώ3β€Ώ4 -1 - ≑ ⟨2,<3,4,<<<5⟩ -4 - ≑ 9 -0 -``` + + ≑ 2β€Ώ3β€Ώ4 + 1 + ≑ ⟨2,<3,4,<<<5⟩ + 4 + ≑ 9 + 0 + `𝕨 ≑ 𝕩`: Match Does `𝕨` exactly match `𝕩`? -``` - 1 ≑ ⟨1⟩ -0 - ⟨1⟩ ≑ ⟨1⟩ -1 -``` \ No newline at end of file + + 1 ≑ ⟨1⟩ + 0 + ⟨1⟩ ≑ ⟨1⟩ + 1 + diff --git "a/help/\342\211\242shape notmatch.md" "b/help/\342\211\242shape notmatch.md" index 50e18f9e..826aa2f4 100644 --- "a/help/\342\211\242shape notmatch.md" +++ "b/help/\342\211\242shape notmatch.md" @@ -1,23 +1,25 @@ -Not Identical To (`β‰’`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/β‰’shape notmatch.html).* + +# Not Identical To (`β‰’`) `β‰’ 𝕩`: Shape Length of each dimension of x. -``` - β‰’ 1 -⟨⟩ - β‰’ 1β€Ώ2 -⟨ 2 ⟩ - β‰’ 1β€Ώ2 ≍ 3β€Ώ4 -⟨ 2 2 ⟩ -``` + + β‰’ 1 + ⟨⟩ + β‰’ 1β€Ώ2 + ⟨ 2 ⟩ + β‰’ 1β€Ώ2 ≍ 3β€Ώ4 + ⟨ 2 2 ⟩ + `𝕨 β‰’ 𝕩`: Not Match Does `𝕨` not exactly match `𝕩`? -``` - 1 β‰’ ⟨1⟩ -1 - ⟨1⟩ β‰’ ⟨1⟩ -0 -``` \ No newline at end of file + + 1 β‰’ ⟨1⟩ + 1 + ⟨1⟩ β‰’ ⟨1⟩ + 0 + diff --git "a/help/\342\211\244lessequal.md" "b/help/\342\211\244lessequal.md" index 8005681b..35e3bbef 100644 --- "a/help/\342\211\244lessequal.md" +++ "b/help/\342\211\244lessequal.md" @@ -1,13 +1,15 @@ -Lesser Than or Equal To (`≀`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/≀lessequal.html).* + +# Lesser Than or Equal To (`≀`) `𝕨 ≀ 𝕩`: Lesser Than or Equal To `𝕨` and `𝕩` can both be either numbers or characters. [Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) -``` - 1 ≀ 3 -1 - 2β€Ώ3β€Ώ0 ≀ 3β€Ώ1β€Ώ0 -⟨ 1 0 1 ⟩ -``` \ No newline at end of file + + 1 ≀ 3 + 1 + 2β€Ώ3β€Ώ0 ≀ 3β€Ώ1β€Ώ0 + ⟨ 1 0 1 ⟩ + diff --git "a/help/\342\211\245greatequal.md" "b/help/\342\211\245greatequal.md" index 3b4e9cf9..129478a9 100644 --- "a/help/\342\211\245greatequal.md" +++ "b/help/\342\211\245greatequal.md" @@ -1,13 +1,15 @@ -Greater Than or Equal To (`β‰₯`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/β‰₯greatequal.html).* + +# Greater Than or Equal To (`β‰₯`) `𝕨 β‰₯ 𝕩`: Greater Than or Equal To `𝕨` and `𝕩` can both be either numbers or characters. [Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) -``` - 1 β‰₯ 3 -0 - 2β€Ώ3β€Ώ0 β‰₯ 3β€Ώ1β€Ώ0 -⟨ 0 1 1 ⟩ -``` \ No newline at end of file + + 1 β‰₯ 3 + 0 + 2β€Ώ3β€Ώ0 β‰₯ 3β€Ώ1β€Ώ0 + ⟨ 0 1 1 ⟩ + diff --git "a/help/\342\212\217firstcell select.md" "b/help/\342\212\217firstcell select.md" index 33d0d2f6..e1f41e98 100644 --- "a/help/\342\212\217firstcell select.md" +++ "b/help/\342\212\217firstcell select.md" @@ -1,38 +1,40 @@ -Square Image Of (`⊏`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/⊏firstcell select.html).* + +# Square Image Of (`⊏`) `⊏ 𝕩`: First Cell First major cell of `𝕩`. -``` - ⊏ ⟨1, 2, 3⟩ -β”ŒΒ· -Β· 1 - β”˜ - a ← 3β€Ώ3 β₯Š ↕9 -β”Œβ”€ -β•΅ 0 1 2 - 3 4 5 - 6 7 8 + + ⊏ ⟨1, 2, 3⟩ + β”ŒΒ· + Β· 1 β”˜ - ⊏ a -⟨ 0 1 2 ⟩ -``` + a ← 3β€Ώ3 β₯Š ↕9 + β”Œβ”€ + β•΅ 0 1 2 + 3 4 5 + 6 7 8 + β”˜ + ⊏ a + ⟨ 0 1 2 ⟩ + `𝕨 ⊏ 𝕩`: Select Select the major cells of `𝕨` at the indices in `𝕩`. -``` - 2β€Ώ0 ⊏ ⟨1, 2, 3⟩ -⟨ 3 1 ⟩ - a ← 3β€Ώ3 β₯Š ↕9 -β”Œβ”€ -β•΅ 0 1 2 - 3 4 5 - 6 7 8 - β”˜ - 2β€Ώ0 ⊏ a -β”Œβ”€ -β•΅ 6 7 8 - 0 1 2 - β”˜ -``` \ No newline at end of file + + 2β€Ώ0 ⊏ ⟨1, 2, 3⟩ + ⟨ 3 1 ⟩ + a ← 3β€Ώ3 β₯Š ↕9 + β”Œβ”€ + β•΅ 0 1 2 + 3 4 5 + 6 7 8 + β”˜ + 2β€Ώ0 ⊏ a + β”Œβ”€ + β•΅ 6 7 8 + 0 1 2 + β”˜ + diff --git "a/help/\342\212\220classify indexof.md" "b/help/\342\212\220classify indexof.md" index b4605a59..b7fe2072 100644 --- "a/help/\342\212\220classify indexof.md" +++ "b/help/\342\212\220classify indexof.md" @@ -1,37 +1,39 @@ -Square Original Of (`⊐`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/⊐classify indexof.html).* + +# Square Original Of (`⊐`) `⊐ 𝕩`: Classify First index of each major cell of `𝕩` in `𝕩`. -``` - ⊐ 5β€Ώ6β€Ώ2β€Ώ2β€Ώ5β€Ώ1 -⟨ 0 1 2 2 0 3 ⟩ - a ← 3β€Ώ3 β₯Š 0β€Ώ1β€Ώ2β€Ώ9β€Ώ0β€Ώ9β€Ώ0β€Ώ1β€Ώ2 -β”Œβ”€ -β•΅ 0 1 2 - 9 0 9 - 0 1 2 - β”˜ - ⊐ a -⟨ 0 1 0 ⟩ -``` + + ⊐ 5β€Ώ6β€Ώ2β€Ώ2β€Ώ5β€Ώ1 + ⟨ 0 1 2 2 0 3 ⟩ + a ← 3β€Ώ3 β₯Š 0β€Ώ1β€Ώ2β€Ώ9β€Ώ0β€Ώ9β€Ώ0β€Ώ1β€Ώ2 + β”Œβ”€ + β•΅ 0 1 2 + 9 0 9 + 0 1 2 + β”˜ + ⊐ a + ⟨ 0 1 0 ⟩ + `𝕨 ⊐ 𝕩`: Index Of First index of each major cell of `𝕩` in `𝕨`. Rank of `𝕩` must be at least cell rank of 𝕨`. If a cell is not found in `𝕨`, that position will contain the length of `𝕨` (`≠𝕨`). -``` - 5β€Ώ6β€Ώ2β€Ώ2β€Ώ5β€Ώ1 ⊐ 5β€Ώ2β€Ώ1β€Ώ6 -⟨ 0 2 5 1 ⟩ - a ← 3β€Ώ3 β₯Š 0β€Ώ1β€Ώ2β€Ώ9β€Ώ0β€Ώ9β€Ώ0β€Ώ1β€Ώ2 -β”Œβ”€ -β•΅ 0 1 2 - 9 0 9 - 0 1 2 + + 5β€Ώ6β€Ώ2β€Ώ2β€Ώ5β€Ώ1 ⊐ 5β€Ώ2β€Ώ1β€Ώ6 + ⟨ 0 2 5 1 ⟩ + a ← 3β€Ώ3 β₯Š 0β€Ώ1β€Ώ2β€Ώ9β€Ώ0β€Ώ9β€Ώ0β€Ώ1β€Ώ2 + β”Œβ”€ + β•΅ 0 1 2 + 9 0 9 + 0 1 2 + β”˜ + a ⊐ ⟨9β€Ώ0β€Ώ9⟩ + β”ŒΒ· + Β· 3 β”˜ - a ⊐ ⟨9β€Ώ0β€Ώ9⟩ -β”ŒΒ· -Β· 3 - β”˜ -``` \ No newline at end of file + diff --git "a/help/\342\212\221first pick.md" "b/help/\342\212\221first pick.md" index 0a4232fa..8023466c 100644 --- "a/help/\342\212\221first pick.md" +++ "b/help/\342\212\221first pick.md" @@ -1,33 +1,35 @@ -Square Image Of Or Equal To (`βŠ‘`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/βŠ‘first pick.html).* + +# Square Image Of Or Equal To (`βŠ‘`) `βŠ‘ 𝕩`: First First element of `𝕩`. -``` - βŠ‘ ⟨1, 2, 3⟩ -1 - a ← 3β€Ώ3 β₯Š ↕9 -β”Œβ”€ -β•΅ 0 1 2 - 3 4 5 - 6 7 8 - β”˜ - βŠ‘ a -0 -``` + + βŠ‘ ⟨1, 2, 3⟩ + 1 + a ← 3β€Ώ3 β₯Š ↕9 + β”Œβ”€ + β•΅ 0 1 2 + 3 4 5 + 6 7 8 + β”˜ + βŠ‘ a + 0 + `𝕨 βŠ‘ 𝕩`: Pick Pick the element of `𝕨` at index `𝕩`. -``` - 2 βŠ‘ ⟨1, 2, 3⟩ -3 - a ← 3β€Ώ3 β₯Š ↕9 -β”Œβ”€ -β•΅ 0 1 2 - 3 4 5 - 6 7 8 - β”˜ - 2β€Ώ0 βŠ‘ a -6 -``` \ No newline at end of file + + 2 βŠ‘ ⟨1, 2, 3⟩ + 3 + a ← 3β€Ώ3 β₯Š ↕9 + β”Œβ”€ + β•΅ 0 1 2 + 3 4 5 + 6 7 8 + β”˜ + 2β€Ώ0 βŠ‘ a + 6 + diff --git "a/help/\342\212\222occcount progindex.md" "b/help/\342\212\222occcount progindex.md" index 277fd6ac..6ac22c80 100644 --- "a/help/\342\212\222occcount progindex.md" +++ "b/help/\342\212\222occcount progindex.md" @@ -1,24 +1,26 @@ -Square Original Of or Equal To (`βŠ’`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/βŠ’occcount progindex.html).* + +# Square Original Of or Equal To (`βŠ’`) `βŠ’ 𝕩`: Occurrence Count Number of times each major cell of `𝕩` appears before itself. -``` - βŠ’ 2β€Ώ7β€Ώ1β€Ώ8β€Ώ1β€Ώ7β€Ώ1β€Ώ8β€Ώ2β€Ώ8β€Ώ4 -⟨ 0 0 0 0 1 1 2 1 1 2 0 ⟩ - β‰βŸœβŠ’ 2β€Ώ7β€Ώ1β€Ώ8β€Ώ1β€Ώ7β€Ώ1β€Ώ8β€Ώ2β€Ώ8β€Ώ4 -β”Œβ”€ -β•΅ 2 7 1 8 1 7 1 8 2 8 4 - 0 0 0 0 1 1 2 1 1 2 0 - β”˜ -``` + + βŠ’ 2β€Ώ7β€Ώ1β€Ώ8β€Ώ1β€Ώ7β€Ώ1β€Ώ8β€Ώ2β€Ώ8β€Ώ4 + ⟨ 0 0 0 0 1 1 2 1 1 2 0 ⟩ + β‰βŸœβŠ’ 2β€Ώ7β€Ώ1β€Ώ8β€Ώ1β€Ώ7β€Ώ1β€Ώ8β€Ώ2β€Ώ8β€Ώ4 + β”Œβ”€ + β•΅ 2 7 1 8 1 7 1 8 2 8 4 + 0 0 0 0 1 1 2 1 1 2 0 + β”˜ + `𝕨 βŠ’ 𝕩`: Progressive Index Of Index of the first unused match of each major cell of `𝕩` in `𝕨`. If there are no more matches left, length of `𝕨` is placed in that position. -``` - "aaa" βŠ’ "aaaaa" -⟨ 0 1 2 3 3 ⟩ - "aaabb" βŠ’ "ababababab" -⟨ 0 3 1 4 2 5 5 5 5 5 ⟩ -``` \ No newline at end of file + + "aaa" βŠ’ "aaaaa" + ⟨ 0 1 2 3 3 ⟩ + "aaabb" βŠ’ "ababababab" + ⟨ 0 3 1 4 2 5 5 5 5 5 ⟩ + diff --git "a/help/\342\212\224groupindices group.md" "b/help/\342\212\224groupindices group.md" index 172fe0f5..689ed6c1 100644 --- "a/help/\342\212\224groupindices group.md" +++ "b/help/\342\212\224groupindices group.md" @@ -1,19 +1,21 @@ -Square Cup (`βŠ”`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/βŠ”groupindices group.html).* + +# Square Cup (`βŠ”`) `βŠ” 𝕩`: Group Indices Group the indices of the major cells of `𝕩` by their respective values. `𝕩` must consist of integers. Groups start from 0. -``` - βŠ” 4β€Ώ5β€Ώ6β€Ώ6β€Ώ4β€Ώ7β€Ώ5 -⟨ ⟨⟩ ⟨⟩ ⟨⟩ ⟨⟩ ⟨ 0 4 ⟩ ⟨ 1 6 ⟩ ⟨ 2 3 ⟩ ⟨ 5 ⟩ ⟩ - (↕8) ≍ βŠ” 4β€Ώ5β€Ώ6β€Ώ6β€Ώ4β€Ώ7β€Ώ5 -β”Œβ”€ -β•΅ 0 1 2 3 4 5 6 7 - ⟨⟩ ⟨⟩ ⟨⟩ ⟨⟩ ⟨ 0 4 ⟩ ⟨ 1 6 ⟩ ⟨ 2 3 ⟩ ⟨ 5 ⟩ - β”˜ -``` + + βŠ” 4β€Ώ5β€Ώ6β€Ώ6β€Ώ4β€Ώ7β€Ώ5 + ⟨ ⟨⟩ ⟨⟩ ⟨⟩ ⟨⟩ ⟨ 0 4 ⟩ ⟨ 1 6 ⟩ ⟨ 2 3 ⟩ ⟨ 5 ⟩ ⟩ + (↕8) ≍ βŠ” 4β€Ώ5β€Ώ6β€Ώ6β€Ώ4β€Ώ7β€Ώ5 + β”Œβ”€ + β•΅ 0 1 2 3 4 5 6 7 + ⟨⟩ ⟨⟩ ⟨⟩ ⟨⟩ ⟨ 0 4 ⟩ ⟨ 1 6 ⟩ ⟨ 2 3 ⟩ ⟨ 5 ⟩ + β”˜ + `𝕨 βŠ” 𝕩`: Group @@ -22,11 +24,11 @@ Group the major cells of `𝕩` by their respective indices in `𝕨`. If an element corresponds to `Β―1`, it is excluded from grouping. An extra element can be added to the end of `𝕨` to specify length of the result. -``` - 1β€Ώ0β€Ώ1β€Ώ2β€Ώ2β€Ώ3β€Ώ3 βŠ” 4β€Ώ5β€Ώ6β€Ώ6β€Ώ4β€Ώ7β€Ώ5 -⟨ ⟨ 5 ⟩ ⟨ 4 6 ⟩ ⟨ 6 4 ⟩ ⟨ 7 5 ⟩ ⟩ - 1β€Ώ0β€Ώ1β€ΏΒ―1β€ΏΒ―1β€Ώ3β€Ώ3 βŠ” 4β€Ώ5β€Ώ6β€Ώ6β€Ώ4β€Ώ7β€Ώ5 -⟨ ⟨ 5 ⟩ ⟨ 4 6 ⟩ ⟨⟩ ⟨ 7 5 ⟩ ⟩ - 1β€Ώ0β€Ώ1β€ΏΒ―1β€ΏΒ―1β€Ώ3β€Ώ3β€Ώ10 βŠ” 4β€Ώ5β€Ώ6β€Ώ6β€Ώ4β€Ώ7β€Ώ5 -⟨ ⟨ 5 ⟩ ⟨ 4 6 ⟩ ⟨⟩ ⟨ 7 5 ⟩ ⟨⟩ ⟨⟩ ⟨⟩ ⟨⟩ ⟨⟩ ⟨⟩ ⟩ -``` \ No newline at end of file + + 1β€Ώ0β€Ώ1β€Ώ2β€Ώ2β€Ώ3β€Ώ3 βŠ” 4β€Ώ5β€Ώ6β€Ώ6β€Ώ4β€Ώ7β€Ώ5 + ⟨ ⟨ 5 ⟩ ⟨ 4 6 ⟩ ⟨ 6 4 ⟩ ⟨ 7 5 ⟩ ⟩ + 1β€Ώ0β€Ώ1β€ΏΒ―1β€ΏΒ―1β€Ώ3β€Ώ3 βŠ” 4β€Ώ5β€Ώ6β€Ώ6β€Ώ4β€Ώ7β€Ώ5 + ⟨ ⟨ 5 ⟩ ⟨ 4 6 ⟩ ⟨⟩ ⟨ 7 5 ⟩ ⟩ + 1β€Ώ0β€Ώ1β€ΏΒ―1β€ΏΒ―1β€Ώ3β€Ώ3β€Ώ10 βŠ” 4β€Ώ5β€Ώ6β€Ώ6β€Ώ4β€Ώ7β€Ώ5 + ⟨ ⟨ 5 ⟩ ⟨ 4 6 ⟩ ⟨⟩ ⟨ 7 5 ⟩ ⟨⟩ ⟨⟩ ⟨⟩ ⟨⟩ ⟨⟩ ⟨⟩ ⟩ + diff --git "a/help/\342\212\230valences.md" "b/help/\342\212\230valences.md" index 3caca9a6..d1079210 100644 --- "a/help/\342\212\230valences.md" +++ "b/help/\342\212\230valences.md" @@ -1,21 +1,23 @@ -Circled Division Slash (`⊘`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/⊘valences.html).* + +# Circled Division Slash (`⊘`) `π”½βŠ˜π”Ύ 𝕩`: Valences Apply `𝔽` to `𝕩`. -``` - +⊘- 5 -5 - -⊘+ 5 -Β―5 -``` + + +⊘- 5 + 5 + -⊘+ 5 + Β―5 + `𝕨 π”½βŠ˜π”Ύ 𝕩`: Valences Apply `𝔾` to `𝕨` and `𝕩`. -``` - 4 +⊘- 5 -Β―1 - 4 -⊘+ 5 -9 -``` \ No newline at end of file + + 4 +⊘- 5 + Β―1 + 4 -⊘+ 5 + 9 + diff --git "a/help/\342\212\242identity right.md" "b/help/\342\212\242identity right.md" index 4870b9eb..2edca7c5 100644 --- "a/help/\342\212\242identity right.md" +++ "b/help/\342\212\242identity right.md" @@ -1,19 +1,21 @@ -Right Tack (`⊒`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/⊒identity right.html).* + +# Right Tack (`⊒`) `⊒ 𝕩`: Return `𝕩`. -``` - ⊒ 5 -5 -``` + + ⊒ 5 + 5 + `𝕨 ⊒ 𝕩`: Right Return `𝕩`. -``` - 5 ⊒ 8 -8 - 'a' ⊒ 1β€Ώ2β€Ώ3 -⟨ 1 2 3 ⟩ -``` \ No newline at end of file + + 5 ⊒ 8 + 8 + 'a' ⊒ 1β€Ώ2β€Ώ3 + ⟨ 1 2 3 ⟩ + diff --git "a/help/\342\212\243identity left.md" "b/help/\342\212\243identity left.md" index 614c4f2a..2af385a6 100644 --- "a/help/\342\212\243identity left.md" +++ "b/help/\342\212\243identity left.md" @@ -1,19 +1,21 @@ -Left Tack (`⊣`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/⊣identity left.html).* + +# Left Tack (`⊣`) `⊣ 𝕩`: Return `𝕩`. -``` - ⊣ 5 -5 -``` + + ⊣ 5 + 5 + `𝕨 ⊣ 𝕩`: Left Return `𝕨`. -``` - 5 ⊣ 8 -5 - 'a' ⊣ 1β€Ώ2β€Ώ3 -'a' -``` \ No newline at end of file + + 5 ⊣ 8 + 5 + 'a' ⊣ 1β€Ώ2β€Ώ3 + 'a' + diff --git "a/help/\342\212\270before bindleft.md" "b/help/\342\212\270before bindleft.md" index 461c0167..0dfe86e5 100644 --- "a/help/\342\212\270before bindleft.md" +++ "b/help/\342\212\270before bindleft.md" @@ -1,41 +1,43 @@ -Multimap (`⊸`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/⊸before bindleft.html).* + +# Multimap (`⊸`) `π•—βŠΈπ”Ύ 𝕩`: Bind Left Supply `𝕗` as a left argument to `𝔾` (`𝕗 𝔾 𝕩`). `𝕗` must be a value, `𝔾` must be dyadic. -``` - 3⊸- 9 -Β―6 - 3 - 9 -Β―6 -``` + + 3⊸- 9 + Β―6 + 3 - 9 + Β―6 + `π”½βŠΈπ”Ύ 𝕩`: Before Apply `𝔽` to `𝕩`, and supply it as a left argument to `𝔾` (`(𝔽 𝕩) 𝔾 𝕩`). `𝔽` must be monadic, `𝔾` must be dyadic. -``` - -⊸+ 9 -0 - - + 9 -Β―9 - (- 9) + 9 -0 -``` + + -⊸+ 9 + 0 + - + 9 + Β―9 + (- 9) + 9 + 0 + `𝕨 π”½βŠΈπ”Ύ 𝕩`: Dyadic Before Apply `𝔽` to `𝕨`, and supply it as a left argument to `𝔾` (`(𝔽 𝕨) 𝔾 𝕩`). `𝔽` must be monadic, `𝔾` must be dyadic. -``` - 2 -⊸+ 1 -Β―1 - 2 - + 1 -1 - (- 2) + 1 -Β―1 -``` \ No newline at end of file + + 2 -⊸+ 1 + Β―1 + 2 - + 1 + 1 + (- 2) + 1 + Β―1 + diff --git "a/help/\342\213\206exponential power.md" "b/help/\342\213\206exponential power.md" index 9420bcbf..51a16e05 100644 --- "a/help/\342\213\206exponential power.md" +++ "b/help/\342\213\206exponential power.md" @@ -1,25 +1,27 @@ -Star (`⋆`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/⋆exponential power.html).* + +# Star (`⋆`) `⋆ 𝕩`: Exponential `e` (Euler's constant) to the power of `𝕩`. [Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) -``` - ⋆ 0β€Ώ1β€Ώ2β€Ώ3 -⟨ 1 2.718281828459045 7.38905609893065 20.085536923187668 ⟩ -``` + + ⋆ 0β€Ώ1β€Ώ2β€Ώ3 + ⟨ 1 2.718281828459045 7.38905609893065 20.085536923187668 ⟩ + `𝕨 ⋆ 𝕩`: Power `𝕨` to the power of `𝕩`. [Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) -``` - 2 ⋆ 5 -32 - 8β€Ώ5β€Ώ9 ⋆ 2 -⟨ 64 25 81 ⟩ - 2β€Ώ3 ⋆ 3β€ΏΒ―4 -⟨ 8 0.012345679012345678 ⟩ -``` \ No newline at end of file + + 2 ⋆ 5 + 32 + 8β€Ώ5β€Ώ9 ⋆ 2 + ⟨ 64 25 81 ⟩ + 2β€Ώ3 ⋆ 3β€ΏΒ―4 + ⟨ 8 0.012345679012345678 ⟩ + diff --git "a/help/\342\213\210enlist pair.md" "b/help/\342\213\210enlist pair.md" index 98407d47..da631346 100644 --- "a/help/\342\213\210enlist pair.md" +++ "b/help/\342\213\210enlist pair.md" @@ -1,36 +1,38 @@ -Bow Tie (`β‹ˆ`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/β‹ˆenlist pair.html).* + +# Bow Tie (`β‹ˆ`) `β‹ˆ 𝕩`: Enlist Put `𝕩` in a single element list. (`βŸ¨π•©βŸ©`) -``` - β‹ˆ 1 -⟨ 1 ⟩ - β‹ˆ 4β€Ώ4 β₯Š 3β€Ώ67β€Ώ8β€Ώ0 -β”Œβ”€ -Β· β”Œβ”€ - β•΅ 3 67 8 0 - 3 67 8 0 - 3 67 8 0 - 3 67 8 0 - β”˜ - β”˜ -``` + + β‹ˆ 1 + ⟨ 1 ⟩ + β‹ˆ 4β€Ώ4 β₯Š 3β€Ώ67β€Ώ8β€Ώ0 + β”Œβ”€ + Β· β”Œβ”€ + β•΅ 3 67 8 0 + 3 67 8 0 + 3 67 8 0 + 3 67 8 0 + β”˜ + β”˜ + `𝕨 β‹ˆ 𝕩`: Pair Put `𝕨` and `𝕩` in a two element list. (`βŸ¨π•¨, π•©βŸ©`) -``` - 1 β‹ˆ 2 -⟨ 1 2 ⟩ - 1 β‹ˆ "dsdasdas" -⟨ 1 "dsdasdas" ⟩ - (3β€Ώ3 β₯Š 3) β‹ˆ 67β€Ώ'a'β€Ώ"example" -β”Œβ”€ -Β· β”Œβ”€ ⟨ 67 'a' "example" ⟩ - β•΅ 3 3 3 - 3 3 3 - 3 3 3 - β”˜ - β”˜ -``` \ No newline at end of file + + 1 β‹ˆ 2 + ⟨ 1 2 ⟩ + 1 β‹ˆ "dsdasdas" + ⟨ 1 "dsdasdas" ⟩ + (3β€Ώ3 β₯Š 3) β‹ˆ 67β€Ώ'a'β€Ώ"example" + β”Œβ”€ + Β· β”Œβ”€ ⟨ 67 'a' "example" ⟩ + β•΅ 3 3 3 + 3 3 3 + 3 3 3 + β”˜ + β”˜ + diff --git "a/help/\342\214\210ceiling maximum.md" "b/help/\342\214\210ceiling maximum.md" index 3b956e9d..13bff822 100644 --- "a/help/\342\214\210ceiling maximum.md" +++ "b/help/\342\214\210ceiling maximum.md" @@ -1,23 +1,25 @@ -Left Ceiling (`⌈`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/⌈ceiling maximum.html).* + +# Left Ceiling (`⌈`) `⌈ 𝕩`: Ceiling Round `𝕩` up. [Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) -``` - ⌈ 1.2β€ΏΟ€β€Ώ3β€Ώ7.89 -⟨ 2 4 3 8 ⟩ -``` + + ⌈ 1.2β€ΏΟ€β€Ώ3β€Ώ7.89 + ⟨ 2 4 3 8 ⟩ + `𝕨 ⌈ 𝕩`: Maximum Maximum of `𝕨` and `𝕩`. [Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) -``` - 1 ⌈ 2 -2 - 2β€Ώ3 ⌈ 4β€Ώ2 -⟨ 4 3 ⟩ -``` \ No newline at end of file + + 1 ⌈ 2 + 2 + 2β€Ώ3 ⌈ 4β€Ώ2 + ⟨ 4 3 ⟩ + diff --git "a/help/\342\214\212floor minimum.md" "b/help/\342\214\212floor minimum.md" index a08d2da4..8075e901 100644 --- "a/help/\342\214\212floor minimum.md" +++ "b/help/\342\214\212floor minimum.md" @@ -1,23 +1,25 @@ -Left Floor (`⌊`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/⌊floor minimum.html).* + +# Left Floor (`⌊`) `⌊ 𝕩`: Floor Round `𝕩` down. [Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) -``` - ⌊ 1.2β€ΏΟ€β€Ώ3β€Ώ7.89 -⟨ 1 3 3 7 ⟩ -``` + + ⌊ 1.2β€ΏΟ€β€Ώ3β€Ώ7.89 + ⟨ 1 3 3 7 ⟩ + `𝕨 ⌊ 𝕩`: Minimum Minimum of `𝕨` and `𝕩`. [Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) -``` - 1 ⌊ 2 -1 - 2β€Ώ3 ⌊ 4β€Ώ2 -⟨ 2 2 ⟩ -``` \ No newline at end of file + + 1 ⌊ 2 + 1 + 2β€Ώ3 ⌊ 4β€Ώ2 + ⟨ 2 2 ⟩ + diff --git "a/help/\342\214\234table.md" "b/help/\342\214\234table.md" index 65ebe6c8..6d7727fc 100644 --- "a/help/\342\214\234table.md" +++ "b/help/\342\214\234table.md" @@ -1,20 +1,22 @@ -Top Left Corner (`⌜`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/⌜table.html).* + +# Top Left Corner (`⌜`) `𝕨 π”½βŒœ 𝕩`: Each Apply `𝔽` between every possible pair of the elements of the arguments. -``` - 1β€Ώ2β€Ώ3β€Ώ4 +⌜ 4β€Ώ5β€Ώ6β€Ώ7 -β”Œβ”€ -β•΅ 5 6 7 8 - 6 7 8 9 - 7 8 9 10 - 8 9 10 11 - β”˜ - "abc" ∾⌜ "xyz" -β”Œβ”€ -β•΅ "ax" "ay" "az" - "bx" "by" "bz" - "cx" "cy" "cz" - β”˜ -``` \ No newline at end of file + + 1β€Ώ2β€Ώ3β€Ώ4 +⌜ 4β€Ώ5β€Ώ6β€Ώ7 + β”Œβ”€ + β•΅ 5 6 7 8 + 6 7 8 9 + 7 8 9 10 + 8 9 10 11 + β”˜ + "abc" ∾⌜ "xyz" + β”Œβ”€ + β•΅ "ax" "ay" "az" + "bx" "by" "bz" + "cx" "cy" "cz" + β”˜ + diff --git "a/help/\342\214\275reverse rotate.md" "b/help/\342\214\275reverse rotate.md" index f8ed52d0..f451d266 100644 --- "a/help/\342\214\275reverse rotate.md" +++ "b/help/\342\214\275reverse rotate.md" @@ -1,41 +1,43 @@ -Circle Stile (`⌽`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/⌽reverse rotate.html).* + +# Circle Stile (`⌽`) `⌽ 𝕩`: Reverse Reverse the first axis of `𝕩`. -``` - ⌽ 1β€Ώ2β€Ώ3 -⟨ 3 2 1 ⟩ - a ← 3β€Ώ3 β₯Š ↕9 -β”Œβ”€ -β•΅ 0 1 2 - 3 4 5 - 6 7 8 - β”˜ - ⌽ a -β”Œβ”€ -β•΅ 6 7 8 - 3 4 5 - 0 1 2 - β”˜ -``` + + ⌽ 1β€Ώ2β€Ώ3 + ⟨ 3 2 1 ⟩ + a ← 3β€Ώ3 β₯Š ↕9 + β”Œβ”€ + β•΅ 0 1 2 + 3 4 5 + 6 7 8 + β”˜ + ⌽ a + β”Œβ”€ + β•΅ 6 7 8 + 3 4 5 + 0 1 2 + β”˜ + `𝕨 ⌽ 𝕩`: Dyad Move the first `𝕨` elements of `𝕩` to its end. Negative `𝕨` reverses the direction of rotation. -``` - 2 ⌽ 1β€Ώ2β€Ώ3 -⟨ 3 1 2 ⟩ - a ← 3β€Ώ3 β₯Š ↕9 -β”Œβ”€ -β•΅ 0 1 2 - 3 4 5 - 6 7 8 - β”˜ - 2 ⌽ a -β”Œβ”€ -β•΅ 6 7 8 - 0 1 2 - 3 4 5 - β”˜ -``` \ No newline at end of file + + 2 ⌽ 1β€Ώ2β€Ώ3 + ⟨ 3 1 2 ⟩ + a ← 3β€Ώ3 β₯Š ↕9 + β”Œβ”€ + β•΅ 0 1 2 + 3 4 5 + 6 7 8 + β”˜ + 2 ⌽ a + β”Œβ”€ + β•΅ 6 7 8 + 0 1 2 + 3 4 5 + β”˜ + diff --git "a/help/\342\214\276under.md" "b/help/\342\214\276under.md" index c7678087..8a70afe9 100644 --- "a/help/\342\214\276under.md" +++ "b/help/\342\214\276under.md" @@ -1,4 +1,6 @@ -Circle Jot (`⌾`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/⌾under.html).* + +# Circle Jot (`⌾`) `π”½βŒΎπ”Ύ 𝕩`, `𝕨 π”½βŒΎπ”Ύ 𝕩`: Under @@ -10,11 +12,11 @@ Where `𝔾` must be 1. A function invertible by `⁼` (Undo) 2. A structural modification -``` - 9⌾(1βŠΈβŠ‘) 1β€Ώ2β€Ώ3 -⟨ 1 9 3 ⟩ - √⁼ (√1) + (√9) -16 - 1 +⌾√ 9 -16 -``` \ No newline at end of file + + 9⌾(1βŠΈβŠ‘) 1β€Ώ2β€Ώ3 + ⟨ 1 9 3 ⟩ + √⁼ (√1) + (√9) + 16 + 1 +⌾√ 9 + 16 + diff --git "a/help/\342\215\211transpose dyadtranspose.md" "b/help/\342\215\211transpose dyadtranspose.md" index da7f058f..b8641803 100644 --- "a/help/\342\215\211transpose dyadtranspose.md" +++ "b/help/\342\215\211transpose dyadtranspose.md" @@ -1,36 +1,38 @@ -Circle Backslash (`⍉`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/⍉transpose dyadtranspose.html).* + +# Circle Backslash (`⍉`) `⍉ 𝕩`: Transpose Move the first axis of `𝕩` to the end. -``` - a ← 3β€Ώ3 β₯Š ↕9 -β”Œβ”€ -β•΅ 0 1 2 - 3 4 5 - 6 7 8 - β”˜ - ⍉ a -β”Œβ”€ -β•΅ 0 3 6 - 1 4 7 - 2 5 8 - β”˜ - b ← 1β€Ώ2β€Ώ3 β₯Š ↕6 -β”Œβ”€ -β•Ž 0 1 2 - 3 4 5 - β”˜ - ≒⍉ b -⟨ 2 3 1 ⟩ -``` + + a ← 3β€Ώ3 β₯Š ↕9 + β”Œβ”€ + β•΅ 0 1 2 + 3 4 5 + 6 7 8 + β”˜ + ⍉ a + β”Œβ”€ + β•΅ 0 3 6 + 1 4 7 + 2 5 8 + β”˜ + b ← 1β€Ώ2β€Ώ3 β₯Š ↕6 + β”Œβ”€ + β•Ž 0 1 2 + 3 4 5 + β”˜ + ≒⍉ b + ⟨ 2 3 1 ⟩ + `𝕨 ⍉ 𝕩`: Dyad Rearrange the axes of `𝕩` as per the axis indices in `𝕨`. -``` - β‰’ a ← 2β€Ώ3β€Ώ4β€Ώ5β€Ώ6 β₯Š1 -⟨ 2 3 4 5 6 ⟩ - β‰’ 1β€Ώ3β€Ώ2β€Ώ0β€Ώ4 ⍉ a -⟨ 5 2 4 3 6 ⟩ -``` \ No newline at end of file + + β‰’ a ← 2β€Ώ3β€Ώ4β€Ώ5β€Ώ6 β₯Š1 + ⟨ 2 3 4 5 6 ⟩ + β‰’ 1β€Ώ3β€Ώ2β€Ώ0β€Ώ4 ⍉ a + ⟨ 5 2 4 3 6 ⟩ + diff --git "a/help/\342\215\213gradeup binsup.md" "b/help/\342\215\213gradeup binsup.md" index 1aee7730..c633a5d8 100644 --- "a/help/\342\215\213gradeup binsup.md" +++ "b/help/\342\215\213gradeup binsup.md" @@ -1,28 +1,30 @@ -Delta Stile (`⍋`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/⍋gradeup binsup.html).* + +# Delta Stile (`⍋`) `⍋ 𝕩`: Grade Up Indices of `𝕩` that would sort its major cells in ascending order. -``` - a ← 3β€Ώ2β€Ώ1 -⟨ 3 2 1 ⟩ - ⍋ a -⟨ 2 1 0 ⟩ - (⍋a) ⊏ a -⟨ 1 2 3 ⟩ - -``` + + a ← 3β€Ώ2β€Ώ1 + ⟨ 3 2 1 ⟩ + ⍋ a + ⟨ 2 1 0 ⟩ + (⍋a) ⊏ a + ⟨ 1 2 3 ⟩ + + `𝕨 ⍋ 𝕩`: Bins Up Binary search for each element of `𝕩` in `𝕨`, and return the index found, if any. `𝕨` must be sorted in ascending order. -``` - 3β€Ώ4β€Ώ5β€Ώ7 ⍋ 2 -β”ŒΒ· -Β· 0 - β”˜ - 3β€Ώ4β€Ώ5β€Ώ7 ⍋ 2β€Ώ6 -⟨ 0 3 ⟩ -``` \ No newline at end of file + + 3β€Ώ4β€Ώ5β€Ώ7 ⍋ 2 + β”ŒΒ· + Β· 0 + β”˜ + 3β€Ώ4β€Ώ5β€Ώ7 ⍋ 2β€Ώ6 + ⟨ 0 3 ⟩ + diff --git "a/help/\342\215\222gradedown binsdown.md" "b/help/\342\215\222gradedown binsdown.md" index ed03f6f4..970fcce9 100644 --- "a/help/\342\215\222gradedown binsdown.md" +++ "b/help/\342\215\222gradedown binsdown.md" @@ -1,16 +1,18 @@ -Del Stile (`⍒`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/⍒gradedown binsdown.html).* + +# Del Stile (`⍒`) `⍒ 𝕩`: Grade Down Indices of `𝕩` that would sort its major cells in descending order. -``` - a ← 1β€Ώ2β€Ώ3 -⟨ 1 2 3 ⟩ - ⍒ a -⟨ 2 1 0 ⟩ - (⍒a) ⊏ a -⟨ 3 2 1 ⟩ -``` + + a ← 1β€Ώ2β€Ώ3 + ⟨ 1 2 3 ⟩ + ⍒ a + ⟨ 2 1 0 ⟩ + (⍒a) ⊏ a + ⟨ 3 2 1 ⟩ + `𝕨 ⍒ 𝕩`: Bins Down @@ -19,11 +21,11 @@ Binary search for each element of `𝕩` in `𝕨`, and return the index found, `𝕨` must be sorted in descending order. [Right Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) -``` - 7β€Ώ5β€Ώ4β€Ώ3 ⍒ 2 -β”ŒΒ· -Β· 4 - β”˜ - 7β€Ώ5β€Ώ4β€Ώ3 ⍒ 2β€Ώ6 -⟨ 4 1 ⟩ -``` \ No newline at end of file + + 7β€Ώ5β€Ώ4β€Ώ3 ⍒ 2 + β”ŒΒ· + Β· 4 + β”˜ + 7β€Ώ5β€Ώ4β€Ώ3 ⍒ 2β€Ώ6 + ⟨ 4 1 ⟩ + diff --git "a/help/\342\215\237repeat.md" "b/help/\342\215\237repeat.md" index 922e57a2..9f190991 100644 --- "a/help/\342\215\237repeat.md" +++ "b/help/\342\215\237repeat.md" @@ -1,15 +1,17 @@ -Circle Star (`⍟`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/⍟repeat.html).* + +# Circle Star (`⍟`) `π”½βŸπ”Ύ 𝕩`, `𝕨 π”½βŸπ”Ύ 𝕩`: Repeat Apply `𝔾` to `𝕨` and `𝕩` and apply `𝔽` to `𝕩` that may times. If `𝕨` is given, keep it as a constant left argument. If `𝔾` returns an array, give `π”½βŸπ•©` for each element. -``` - 1 +⍟⊒ 4 -8 - 1 +⍟1β€Ώ2β€Ώ3 4 -⟨ 5 6 7 ⟩ - 3 ∾⍟{≠𝕩} ⟨4,5,6⟩ -⟨ 3 3 3 4 5 6 ⟩ -``` \ No newline at end of file + + 1 +⍟⊒ 4 + 8 + 1 +⍟1β€Ώ2β€Ώ3 4 + ⟨ 5 6 7 ⟩ + 3 ∾⍟{≠𝕩} ⟨4,5,6⟩ + ⟨ 3 3 3 4 5 6 ⟩ + diff --git "a/help/\342\215\267deduplicate find.md" "b/help/\342\215\267deduplicate find.md" index ae314268..52c560bb 100644 --- "a/help/\342\215\267deduplicate find.md" +++ "b/help/\342\215\267deduplicate find.md" @@ -1,56 +1,58 @@ -Epsilon Underbar (`⍷`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/⍷deduplicate find.html).* + +# Epsilon Underbar (`⍷`) `⍷ 𝕩`: Deduplicate Unique major cells of `𝕩`. -``` - ⍷ 4β€Ώ5β€Ώ6β€Ώ6β€Ώ4β€Ώ7β€Ώ5 -⟨ 4 5 6 7 ⟩ - a ← 3β€Ώ3 β₯Š ↕6 -β”Œβ”€ -β•΅ 0 1 2 - 3 4 5 - 0 1 2 - β”˜ - ⍷ a -β”Œβ”€ -β•΅ 0 1 2 - 3 4 5 - β”˜ -``` + + ⍷ 4β€Ώ5β€Ώ6β€Ώ6β€Ώ4β€Ώ7β€Ώ5 + ⟨ 4 5 6 7 ⟩ + a ← 3β€Ώ3 β₯Š ↕6 + β”Œβ”€ + β•΅ 0 1 2 + 3 4 5 + 0 1 2 + β”˜ + ⍷ a + β”Œβ”€ + β•΅ 0 1 2 + 3 4 5 + β”˜ + `𝕨 ⍷ 𝕩`: Find Mark the top left location of the occurrences of `𝕨` in `𝕩` with a 1, and other locations with 0. Result is the same shape as `(≒𝕨)↕x`. -``` - "string" ⍷ "substring" -⟨ 0 0 0 1 ⟩ - "loooooong" ⍷ "short" -⟨⟩ - a ← 7 (4|β‹†Λœ)βŒœβ—‹β†• 9 -β”Œβ”€ -β•΅ 1 1 1 1 1 1 1 1 1 - 0 1 2 3 0 1 2 3 0 - 0 1 0 1 0 1 0 1 0 - 0 1 0 3 0 1 0 3 0 - 0 1 0 1 0 1 0 1 0 - 0 1 0 3 0 1 0 3 0 - 0 1 0 1 0 1 0 1 0 + + "string" ⍷ "substring" + ⟨ 0 0 0 1 ⟩ + "loooooong" ⍷ "short" + ⟨⟩ + a ← 7 (4|β‹†Λœ)βŒœβ—‹β†• 9 + β”Œβ”€ + β•΅ 1 1 1 1 1 1 1 1 1 + 0 1 2 3 0 1 2 3 0 + 0 1 0 1 0 1 0 1 0 + 0 1 0 3 0 1 0 3 0 + 0 1 0 1 0 1 0 1 0 + 0 1 0 3 0 1 0 3 0 + 0 1 0 1 0 1 0 1 0 + β”˜ + b ← (0β€Ώ3β€Ώ0≍0β€Ώ1β€Ώ0) + β”Œβ”€ + β•΅ 0 3 0 + 0 1 0 + β”˜ + b ⍷ a + β”Œβ”€ + β•΅ 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 + 0 0 1 0 0 0 1 + 0 0 0 0 0 0 0 + 0 0 1 0 0 0 1 β”˜ - b ← (0β€Ώ3β€Ώ0≍0β€Ώ1β€Ώ0) -β”Œβ”€ -β•΅ 0 3 0 - 0 1 0 - β”˜ - b ⍷ a -β”Œβ”€ -β•΅ 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 - 0 0 1 0 0 0 1 - 0 0 0 0 0 0 0 - 0 0 1 0 0 0 1 - β”˜ -``` \ No newline at end of file + diff --git "a/help/\342\216\211rank.md" "b/help/\342\216\211rank.md" index 645b0aaf..153f1839 100644 --- "a/help/\342\216\211rank.md" +++ "b/help/\342\216\211rank.md" @@ -1,4 +1,6 @@ -Circled Horizontal Bar With Notch (`βŽ‰`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/βŽ‰rank.html).* + +# Circled Horizontal Bar With Notch (`βŽ‰`) `π”½βŽ‰π•˜ 𝕩`, `𝕨 π”½βŽ‰π•˜ 𝕩`: Rank @@ -10,27 +12,27 @@ The ranks applied are given by the following: - `βŽ‰ bβ€Ώc` ⍝ Rank-b cells of `𝕨` and rank-c cells of `𝕩` (dyadic) - `βŽ‰ aβ€Ώbβ€Ώc` ⍝ Rank-a cells of `𝕩` (monadic), b-cells of `𝕨` and c-cells of `𝕩` (dyadic) -``` - a ← 3β€Ώ2β€Ώ4β₯Š"ABCDEFGHIJKLMNOPQRSTUVWXYZ" -β”Œβ”€ -β•Ž"ABCD - EFGH - - Β·IJKL - MNOP - - Β·QRST - UVWX" - β”˜ - βŒ½βŽ‰2 a -β”Œβ”€ -β•Ž"EFGH - ABCD - - Β·MNOP - IJKL - - Β·UVWX - QRST" - β”˜ -``` \ No newline at end of file + + a ← 3β€Ώ2β€Ώ4β₯Š"ABCDEFGHIJKLMNOPQRSTUVWXYZ" + β”Œβ”€ + β•Ž"ABCD + EFGH + + Β·IJKL + MNOP + + Β·QRST + UVWX" + β”˜ + βŒ½βŽ‰2 a + β”Œβ”€ + β•Ž"EFGH + ABCD + + Β·MNOP + IJKL + + Β·UVWX + QRST" + β”˜ + diff --git "a/help/\342\216\212catch.md" "b/help/\342\216\212catch.md" index 8f7c680f..9f95659c 100644 --- "a/help/\342\216\212catch.md" +++ "b/help/\342\216\212catch.md" @@ -1,4 +1,6 @@ -Circled Triangle Down (`⎊`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/⎊catch.html).* + +# Circled Triangle Down (`⎊`) `π”½βŽŠπ”Ύ 𝕩`, `𝕨 π”½βŽŠπ”Ύ 𝕩`: Catch @@ -7,9 +9,9 @@ Apply `𝔽` to the arguments. If an error happens when `𝔽` is applied, cancel its execution, apply `𝔾` to the arguments and return the results. Otherwise, return the results of `𝔽`. -``` - ∾⎊{"error occurred with argument: "βˆΎβ€’Fmt 𝕩} 1 -"error occurred with argument: 1" - ∾⎊{"error occurred with argument: "βˆΎβ€’Fmt 𝕩} ⟨⟨1,2⟩, ⟨3,4⟩⟩ -⟨ 1 2 3 4 ⟩ -``` \ No newline at end of file + + ∾⎊{"error occurred with argument: "βˆΎβ€’Fmt 𝕩} 1 + "error occurred with argument: 1" + ∾⎊{"error occurred with argument: "βˆΎβ€’Fmt 𝕩} ⟨⟨1,2⟩, ⟨3,4⟩⟩ + ⟨ 1 2 3 4 ⟩ + diff --git "a/help/\342\227\213over.md" "b/help/\342\227\213over.md" index 98082965..0c84d9bc 100644 --- "a/help/\342\227\213over.md" +++ "b/help/\342\227\213over.md" @@ -1,27 +1,29 @@ -Circle (`β—‹`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/β—‹over.html).* + +# Circle (`β—‹`) `𝔽○𝔾 𝕩`: Atop Apply `𝔾` to `𝕩`, then apply `𝔽` (`𝔽 𝔾 𝕩`). `𝔽` and `𝔾` must be monadic. -``` - -β—‹- 5 -5 - - - 5 -5 -``` + + -β—‹- 5 + 5 + - - 5 + 5 + `𝕨 𝔽○𝔾 𝕩`: Over Apply `𝔾` to `𝕨` and `𝕩`, then apply `𝔽` to them (`(𝔾 𝕨) 𝔽 (𝔾 𝕩)`). `𝔽` must be dyadic, `𝔾` must be monadic. -``` - 1 +β—‹- 2 -Β―3 - 1 + - 2 -Β―1 - (- 1) + (- 2) -Β―3 -``` \ No newline at end of file + + 1 +β—‹- 2 + Β―3 + 1 + - 2 + Β―1 + (- 1) + (- 2) + Β―3 + diff --git "a/help/\342\227\266choose.md" "b/help/\342\227\266choose.md" index 1b7d81f5..8fd73b99 100644 --- "a/help/\342\227\266choose.md" +++ "b/help/\342\227\266choose.md" @@ -1,17 +1,19 @@ -Circle with Lower Right Quadrant (`β—Ά`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/β—Άchoose.html).* + +# Circle with Lower Right Quadrant (`β—Ά`) `π”½β—Άπ•˜ 𝕩`, `𝕨 π”½β—Άπ•˜ 𝕩`: Choose Apply `𝔽` to the arguments and pick a function from list `π•˜`. Apply the picked function to the arguments. -``` - F ← βŠ’β—Ά+β€Ώ-β€ΏΓ·β€ΏΓ— -βŠ’β—ΆβŸ¨ + - Γ· Γ— ⟩ - F 0 -0 - F 1 -Β―1 - F 2 -0.5 - F 3 -1 -``` \ No newline at end of file + + F ← βŠ’β—Ά+β€Ώ-β€ΏΓ·β€ΏΓ— + βŠ’β—ΆβŸ¨ + - Γ· Γ— ⟩ + F 0 + 0 + F 1 + Β―1 + F 2 + 0.5 + F 3 + 1 + diff --git "a/help/\342\232\207depth.md" "b/help/\342\232\207depth.md" index 14352bd4..b680ba4b 100644 --- "a/help/\342\232\207depth.md" +++ "b/help/\342\232\207depth.md" @@ -1,12 +1,14 @@ -Circle With Two Dots (`βš‡`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/βš‡depth.html).* + +# Circle With Two Dots (`βš‡`) `π”½βš‡π•˜ 𝕩`, `𝕨 π”½βš‡π•˜ 𝕩`: Depth Apply `𝔽` to the cells of the arguments at depth given in `π•˜`. -``` - 1βŠΈβ†“βš‡1 ⟨⟨1,2,3⟩, ⟨4,5,6⟩⟩ -⟨ ⟨ 2 3 ⟩ ⟨ 5 6 ⟩ ⟩ - 1 β†“βš‡1 ⟨⟨1,2,3⟩, ⟨4,5,6⟩⟩ -⟨ ⟨ 2 3 ⟩ ⟨ 5 6 ⟩ ⟩ -``` \ No newline at end of file + + 1βŠΈβ†“βš‡1 ⟨⟨1,2,3⟩, ⟨4,5,6⟩⟩ + ⟨ ⟨ 2 3 ⟩ ⟨ 5 6 ⟩ ⟩ + 1 β†“βš‡1 ⟨⟨1,2,3⟩, ⟨4,5,6⟩⟩ + ⟨ ⟨ 2 3 ⟩ ⟨ 5 6 ⟩ ⟩ + diff --git "a/help/\342\237\234after bindright.md" "b/help/\342\237\234after bindright.md" index b1fa1aa5..00a6de2d 100644 --- "a/help/\342\237\234after bindright.md" +++ "b/help/\342\237\234after bindright.md" @@ -1,41 +1,43 @@ -Left Multimap (`⟜`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/⟜after bindright.html).* + +# Left Multimap (`⟜`) `π”½βŸœπ•˜ 𝕩`: Bind Supply `π•˜` as a right argument to `𝔽` (`𝕩 𝔽 π•˜`). `π•˜` must be a value, `F` must be dyadic. -``` - -⟜3 9 -6 - - 3 9 -Error - 9 - 3 -6 -``` + + -⟜3 9 + 6 + - 3 9 + Error + 9 - 3 + 6 + `π”½βŸœπ”Ύ 𝕩`: After Apply `𝔾` to `𝕩`, and supply it as a right argument to `𝔽` (`𝕩 𝔽 (𝔾 𝕩)`). `𝔽` must be dyadic, `𝔾` must be monadic. -``` - Γ—βŸœ- 9 -Β―81 - Γ— - 9 -Β―1 - 9 Γ— (- 9) -Β―81 -``` + + Γ—βŸœ- 9 + Β―81 + Γ— - 9 + Β―1 + 9 Γ— (- 9) + Β―81 + `𝕨 π”½βŸœπ”Ύ 𝕩`: Dyadic After Apply `𝔾` to `𝕩`, and supply it as a right argument to `𝔽` (`𝕨 𝔽 (𝔾 𝕩)`). `𝔽` must be dyadic, `𝔾` must be monadic. -``` - 2 Γ—βŸœ- 1 -Β―2 - 2 Γ— (- 1) -Β―2 -``` \ No newline at end of file + + 2 Γ—βŸœ- 1 + Β―2 + 2 Γ— (- 1) + Β―2 + diff --git "a/help/\342\245\212deshape reshape.md" "b/help/\342\245\212deshape reshape.md" index f9b4967f..f5fc40a2 100644 --- "a/help/\342\245\212deshape reshape.md" +++ "b/help/\342\245\212deshape reshape.md" @@ -1,14 +1,16 @@ -Barb (`β₯Š`) +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/β₯Šdeshape reshape.html).* + +# Barb (`β₯Š`) `β₯Š 𝕩`: Deshape Put all elements of `𝕩` in a rank 1 array, converting to array if necessary. -``` - β₯Š 1 -⟨ 1 ⟩ - β₯Š 1β€Ώ2 ≍ 3β€Ώ4 -⟨ 1 2 3 4 ⟩ -``` + + β₯Š 1 + ⟨ 1 ⟩ + β₯Š 1β€Ώ2 ≍ 3β€Ώ4 + ⟨ 1 2 3 4 ⟩ + `𝕨 β₯Š 𝕩`: Reshape @@ -19,23 +21,23 @@ A single element in `𝕩` can be a function, which will be replaced with an app - `⌊` Round length down, discarding elements - `⌽` Round length up - `↑` Round length up, and use element fill to add extra elements. -``` - 3β€Ώ3 β₯Š 3 -β”Œβ”€ -β•΅ 3 3 3 - 3 3 3 - 3 3 3 - β”˜ - 2β€ΏβŒ½β€Ώ2 β₯Š 1β€Ώ2β€Ώ3 -β”Œβ”€ -β•Ž 1 2 - - 3 1 - β”˜ - 2‿↑‿2 β₯Š 1β€Ώ2β€Ώ3 -β”Œβ”€ -β•Ž 1 2 - - 3 0 - β”˜ -``` \ No newline at end of file + + 3β€Ώ3 β₯Š 3 + β”Œβ”€ + β•΅ 3 3 3 + 3 3 3 + 3 3 3 + β”˜ + 2β€ΏβŒ½β€Ώ2 β₯Š 1β€Ώ2β€Ώ3 + β”Œβ”€ + β•Ž 1 2 + + 3 1 + β”˜ + 2‿↑‿2 β₯Š 1β€Ώ2β€Ώ3 + β”Œβ”€ + β•Ž 1 2 + + 3 0 + β”˜ + -- cgit v1.2.3 From 2c50d91ec7eb8bc7890befe874a0b93729c2437e Mon Sep 17 00:00:00 2001 From: razetime Date: Wed, 19 Jan 2022 22:48:16 +0530 Subject: add h2s remove copied output, ascii filenames --- help/!assert assertwithmsg.md | 33 -------------- help/+conjugate add.md | 24 ---------- help/-negate subtract.md | 30 ------------- help/merge great.md | 40 ----------------- help/`scan.md | 31 ------------- help/abs_modulus.md | 27 +++++++++++ help/after_bindright.md | 43 ++++++++++++++++++ help/assert_assertwithmsg.md | 29 ++++++++++++ help/atop.md | 29 ++++++++++++ help/before_bindleft.md | 43 ++++++++++++++++++ help/catch.md | 17 +++++++ help/ceiling_maximum.md | 25 +++++++++++ help/cells.md | 17 +++++++ help/choose.md | 19 ++++++++ help/classify_indexof.md | 30 +++++++++++++ help/conjugate_add.md | 24 ++++++++++ help/constant.md | 13 ++++++ help/deduplicate_find.md | 33 ++++++++++++++ help/depth.md | 14 ++++++ help/depth_match.md | 25 +++++++++++ help/deshape_reshape.md | 31 +++++++++++++ help/each.md | 13 ++++++ help/enclose_less.md | 27 +++++++++++ help/enlist_pair.md | 25 +++++++++++ help/exponential_power.md | 27 +++++++++++ help/first_pick.md | 27 +++++++++++ help/firstcell_select.md | 27 +++++++++++ help/floor_minimum.md | 25 +++++++++++ help/fold.md | 30 +++++++++++++ help/gradedown_binsdown.md | 29 ++++++++++++ help/gradeup_binsup.md | 28 ++++++++++++ help/greatequal.md | 15 +++++++ help/groupindices_group.md | 31 +++++++++++++ help/identity_left.md | 21 +++++++++ help/identity_right.md | 21 +++++++++ help/indices_replicate.md | 25 +++++++++++ help/join_jointo.md | 31 +++++++++++++ help/length_notequal.md | 32 ++++++++++++++ help/lessequal.md | 15 +++++++ help/markfirst_memberof.md | 29 ++++++++++++ help/merge_great.md | 37 ++++++++++++++++ help/negate_subtract.md | 30 +++++++++++++ help/not_span.md | 27 +++++++++++ help/occcount_progindex.md | 23 ++++++++++ help/over.md | 29 ++++++++++++ help/prefixes_take.md | 35 +++++++++++++++ help/range_windows.md | 27 +++++++++++ help/rank.md | 20 +++++++++ help/rank_equal.md | 30 +++++++++++++ help/reciprocal_divide.md | 26 +++++++++++ help/repeat.md | 17 +++++++ help/reverse_rotate.md | 27 +++++++++++ help/scan.md | 31 +++++++++++++ help/self_swap.md | 23 ++++++++++ help/shape_notmatch.md | 25 +++++++++++ help/shiftafter.md | 27 +++++++++++ help/shiftbefore.md | 27 +++++++++++ help/sign_multiply.md | 28 ++++++++++++ help/sindices replicate.md | 25 ----------- help/solo_couple.md | 33 ++++++++++++++ help/sortdown_or.md | 25 +++++++++++ help/sortup_and.md | 23 ++++++++++ help/squareroot_root.md | 23 ++++++++++ help/suffixes_drop.md | 34 ++++++++++++++ help/table.md | 13 ++++++ help/template.md.tmp | 47 -------------------- help/transpose_dyadtranspose.md | 27 +++++++++++ help/under.md | 22 +++++++++ help/undo.md | 22 +++++++++ help/valences.md | 23 ++++++++++ help/|abs modulus.md | 27 ----------- "help/\302\250each.md" | 17 ------- "help/\302\253shiftbefore.md" | 39 ---------------- "help/\302\254not span.md" | 27 ----------- "help/\302\264fold.md" | 30 ------------- "help/\302\273shiftafter.md" | 39 ---------------- "help/\303\227sign multiply.md" | 28 ------------ "help/\303\267reciprocal divide.md" | 22 --------- "help/\313\230cells.md" | 28 ------------ "help/\313\231constant.md" | 13 ------ "help/\313\234self swap.md" | 23 ---------- "help/\342\201\274undo.md" | 22 --------- "help/\342\206\221prefixes take.md" | 64 --------------------------- "help/\342\206\223suffixes drop.md" | 53 ---------------------- "help/\342\206\225range windows.md" | 53 ---------------------- "help/\342\210\212markfirst memberof.md" | 39 ---------------- "help/\342\210\230atop.md" | 29 ------------ "help/\342\210\232squareroot root.md" | 23 ---------- "help/\342\210\247sortup and.md" | 23 ---------- "help/\342\210\250sortdown or.md" | 25 ----------- "help/\342\210\276join jointo.md" | 62 -------------------------- "help/\342\211\215solo couple.md" | 44 ------------------ "help/\342\211\240length notequal.md" | 32 -------------- "help/\342\211\241depth match.md" | 25 ----------- "help/\342\211\242shape notmatch.md" | 25 ----------- "help/\342\211\244lessequal.md" | 15 ------- "help/\342\211\245greatequal.md" | 15 ------- "help/\342\212\217firstcell select.md" | 40 ----------------- "help/\342\212\220classify indexof.md" | 39 ---------------- "help/\342\212\221first pick.md" | 35 --------------- "help/\342\212\222occcount progindex.md" | 26 ----------- "help/\342\212\224groupindices group.md" | 34 -------------- "help/\342\212\230valences.md" | 23 ---------- "help/\342\212\242identity right.md" | 21 --------- "help/\342\212\243identity left.md" | 21 --------- "help/\342\212\270before bindleft.md" | 43 ------------------ "help/\342\213\206exponential power.md" | 27 ----------- "help/\342\213\210enlist pair.md" | 38 ---------------- "help/\342\214\210ceiling maximum.md" | 25 ----------- "help/\342\214\212floor minimum.md" | 25 ----------- "help/\342\214\234table.md" | 22 --------- "help/\342\214\275reverse rotate.md" | 43 ------------------ "help/\342\214\276under.md" | 22 --------- "help/\342\215\211transpose dyadtranspose.md" | 38 ---------------- "help/\342\215\213gradeup binsup.md" | 30 ------------- "help/\342\215\222gradedown binsdown.md" | 31 ------------- "help/\342\215\237repeat.md" | 17 ------- "help/\342\215\267deduplicate find.md" | 58 ------------------------ "help/\342\216\211rank.md" | 38 ---------------- "help/\342\216\212catch.md" | 17 ------- "help/\342\227\213over.md" | 29 ------------ "help/\342\227\266choose.md" | 19 -------- "help/\342\232\207depth.md" | 14 ------ "help/\342\237\234after bindright.md" | 43 ------------------ "help/\342\245\212deshape reshape.md" | 43 ------------------ 127 files changed, 1631 insertions(+), 1992 deletions(-) delete mode 100644 help/!assert assertwithmsg.md delete mode 100644 help/+conjugate add.md delete mode 100644 help/-negate subtract.md delete mode 100644 help/merge great.md delete mode 100644 help/`scan.md create mode 100644 help/abs_modulus.md create mode 100644 help/after_bindright.md create mode 100644 help/assert_assertwithmsg.md create mode 100644 help/atop.md create mode 100644 help/before_bindleft.md create mode 100644 help/catch.md create mode 100644 help/ceiling_maximum.md create mode 100644 help/cells.md create mode 100644 help/choose.md create mode 100644 help/classify_indexof.md create mode 100644 help/conjugate_add.md create mode 100644 help/constant.md create mode 100644 help/deduplicate_find.md create mode 100644 help/depth.md create mode 100644 help/depth_match.md create mode 100644 help/deshape_reshape.md create mode 100644 help/each.md create mode 100644 help/enclose_less.md create mode 100644 help/enlist_pair.md create mode 100644 help/exponential_power.md create mode 100644 help/first_pick.md create mode 100644 help/firstcell_select.md create mode 100644 help/floor_minimum.md create mode 100644 help/fold.md create mode 100644 help/gradedown_binsdown.md create mode 100644 help/gradeup_binsup.md create mode 100644 help/greatequal.md create mode 100644 help/groupindices_group.md create mode 100644 help/identity_left.md create mode 100644 help/identity_right.md create mode 100644 help/indices_replicate.md create mode 100644 help/join_jointo.md create mode 100644 help/length_notequal.md create mode 100644 help/lessequal.md create mode 100644 help/markfirst_memberof.md create mode 100644 help/merge_great.md create mode 100644 help/negate_subtract.md create mode 100644 help/not_span.md create mode 100644 help/occcount_progindex.md create mode 100644 help/over.md create mode 100644 help/prefixes_take.md create mode 100644 help/range_windows.md create mode 100644 help/rank.md create mode 100644 help/rank_equal.md create mode 100644 help/reciprocal_divide.md create mode 100644 help/repeat.md create mode 100644 help/reverse_rotate.md create mode 100644 help/scan.md create mode 100644 help/self_swap.md create mode 100644 help/shape_notmatch.md create mode 100644 help/shiftafter.md create mode 100644 help/shiftbefore.md create mode 100644 help/sign_multiply.md delete mode 100644 help/sindices replicate.md create mode 100644 help/solo_couple.md create mode 100644 help/sortdown_or.md create mode 100644 help/sortup_and.md create mode 100644 help/squareroot_root.md create mode 100644 help/suffixes_drop.md create mode 100644 help/table.md delete mode 100644 help/template.md.tmp create mode 100644 help/transpose_dyadtranspose.md create mode 100644 help/under.md create mode 100644 help/undo.md create mode 100644 help/valences.md delete mode 100644 help/|abs modulus.md delete mode 100644 "help/\302\250each.md" delete mode 100644 "help/\302\253shiftbefore.md" delete mode 100644 "help/\302\254not span.md" delete mode 100644 "help/\302\264fold.md" delete mode 100644 "help/\302\273shiftafter.md" delete mode 100644 "help/\303\227sign multiply.md" delete mode 100644 "help/\303\267reciprocal divide.md" delete mode 100644 "help/\313\230cells.md" delete mode 100644 "help/\313\231constant.md" delete mode 100644 "help/\313\234self swap.md" delete mode 100644 "help/\342\201\274undo.md" delete mode 100644 "help/\342\206\221prefixes take.md" delete mode 100644 "help/\342\206\223suffixes drop.md" delete mode 100644 "help/\342\206\225range windows.md" delete mode 100644 "help/\342\210\212markfirst memberof.md" delete mode 100644 "help/\342\210\230atop.md" delete mode 100644 "help/\342\210\232squareroot root.md" delete mode 100644 "help/\342\210\247sortup and.md" delete mode 100644 "help/\342\210\250sortdown or.md" delete mode 100644 "help/\342\210\276join jointo.md" delete mode 100644 "help/\342\211\215solo couple.md" delete mode 100644 "help/\342\211\240length notequal.md" delete mode 100644 "help/\342\211\241depth match.md" delete mode 100644 "help/\342\211\242shape notmatch.md" delete mode 100644 "help/\342\211\244lessequal.md" delete mode 100644 "help/\342\211\245greatequal.md" delete mode 100644 "help/\342\212\217firstcell select.md" delete mode 100644 "help/\342\212\220classify indexof.md" delete mode 100644 "help/\342\212\221first pick.md" delete mode 100644 "help/\342\212\222occcount progindex.md" delete mode 100644 "help/\342\212\224groupindices group.md" delete mode 100644 "help/\342\212\230valences.md" delete mode 100644 "help/\342\212\242identity right.md" delete mode 100644 "help/\342\212\243identity left.md" delete mode 100644 "help/\342\212\270before bindleft.md" delete mode 100644 "help/\342\213\206exponential power.md" delete mode 100644 "help/\342\213\210enlist pair.md" delete mode 100644 "help/\342\214\210ceiling maximum.md" delete mode 100644 "help/\342\214\212floor minimum.md" delete mode 100644 "help/\342\214\234table.md" delete mode 100644 "help/\342\214\275reverse rotate.md" delete mode 100644 "help/\342\214\276under.md" delete mode 100644 "help/\342\215\211transpose dyadtranspose.md" delete mode 100644 "help/\342\215\213gradeup binsup.md" delete mode 100644 "help/\342\215\222gradedown binsdown.md" delete mode 100644 "help/\342\215\237repeat.md" delete mode 100644 "help/\342\215\267deduplicate find.md" delete mode 100644 "help/\342\216\211rank.md" delete mode 100644 "help/\342\216\212catch.md" delete mode 100644 "help/\342\227\213over.md" delete mode 100644 "help/\342\227\266choose.md" delete mode 100644 "help/\342\232\207depth.md" delete mode 100644 "help/\342\237\234after bindright.md" delete mode 100644 "help/\342\245\212deshape reshape.md" (limited to 'help') diff --git a/help/!assert assertwithmsg.md b/help/!assert assertwithmsg.md deleted file mode 100644 index 80dfb851..00000000 --- a/help/!assert assertwithmsg.md +++ /dev/null @@ -1,33 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/!assert assertwithmsg.html).* - -# Exclamation Mark (`!`) - -`! 𝕩`: Assert - -Throw an error if `𝕩` is not 1. - - ! 1 - 1 - ! 2 - Error: Assertion error - at ! 2 - ^ - ! "hello" - Error: hello - at ! "hello" - - -`𝕨 ! 𝕩`: Dyad - -Throw an error with message `𝕨` if `𝕩` is not 1. - - "hi" ! 1 - 1 - "two" ! 2 - Error: two - at "two" ! 2 - ^ - "hello error" ! "hello" - Error: hello error - at "hello error" ! "hello" - diff --git a/help/+conjugate add.md b/help/+conjugate add.md deleted file mode 100644 index 37c32295..00000000 --- a/help/+conjugate add.md +++ /dev/null @@ -1,24 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/+conjugate add.html).* - -# Plus (`+`) - -`+ 𝕩`: Conjugate - - + 1 - 1 - + Β―1 - Β―1 - -`𝕨 + 𝕩`: Add - -`𝕨` added to `𝕩`. Either `𝕨` or `𝕩` can be a character, and if so, the other has to be a number. - -[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) - - 1 + 2 - 3 - 1 + 2β€Ώ3β€Ώ4 - ⟨ 3 4 5 ⟩ - 'a' + 4 - 'e' - diff --git a/help/-negate subtract.md b/help/-negate subtract.md deleted file mode 100644 index 10403db4..00000000 --- a/help/-negate subtract.md +++ /dev/null @@ -1,30 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/-negate subtract.html).* - -# Minus (`-`) - -`- 𝕩`: Negate - -Additive Inverse of `𝕩`. - -[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) - - - 1 - Β―1 - - Β―1 - 1 - -`𝕨 - 𝕩`: Subtract - -Subtract `𝕩` from `𝕨`. `𝕨` and `𝕩` can be characters or numbers. - -[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) - - 1 - 2 - Β―1 - 1 - 2β€Ώ3β€Ώ4 - ⟨ Β―1 Β―2 Β―3 ⟩ - 'a' - 4 - ']' - 'b' - 'a' - 1 - diff --git a/help/merge great.md b/help/>merge great.md deleted file mode 100644 index a90e1d5d..00000000 --- a/help/>merge great.md +++ /dev/null @@ -1,40 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/>merge great.html).* - -# Greater Than (`>`) - -`> 𝕩`: Merge - -Add the rank of an element of `𝕩` to the rank of `𝕩`. - -All elements must have the same rank. - -Returns atomic values as is. - - - a ← ⟨⟨1, 2⟩, ⟨3, 4⟩⟩ - ⟨ ⟨ 1 2 ⟩ ⟨ 3 4 ⟩ ⟩ - >a - β”Œβ”€ - β•΅ 1 2 - 3 4 - β”˜ - β‰’a - ⟨ 2 ⟩ - β‰’>a - ⟨ 2 2 ⟩ - - - -`𝕨 > 𝕩`: Greater Than - -`𝕨` and `𝕩` can both be either numbers or characters. - -[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) - - 1 > 3 - 0 - 2β€Ώ3β€Ώ0 > 3β€Ώ1β€Ώ0 - ⟨ 0 1 0 ⟩ - 'a' > 'b' - 1 - diff --git a/help/`scan.md b/help/`scan.md deleted file mode 100644 index 5f255d70..00000000 --- a/help/`scan.md +++ /dev/null @@ -1,31 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/`scan.html).* - -# Acute Accent (`` ` ``) - -``𝔽` 𝕩``: Fold - -Scan over `𝕩` with `𝔽` from left to right, producing intermediate values. - - - +` 1β€Ώ2β€Ώ3 - ⟨ 1 3 6 ⟩ - ⟨1, 1+2, (1+2)+3⟩ - ⟨ 1 3 6 ⟩ - -` 1β€Ώ2β€Ώ3 - ⟨ 1 Β―1 Β―4 ⟩ - ⟨1, 1-2, (1-2)-3⟩ - ⟨ 1 Β―1 Β―4 ⟩ - -``𝕨 𝔽` 𝕩``: Scan With initial - -Monadic scan, but use `𝕨` as initial left argument. - - 5 +` 1β€Ώ2β€Ώ3 - ⟨ 6 8 11 ⟩ - ⟨5+1, (5+1)+2, ((5+1)+2)+3⟩ - ⟨ 6 8 11 ⟩ - 5 -` 1β€Ώ2β€Ώ3 - ⟨ 4 2 Β―1 ⟩ - ⟨5-1, (5-1)-2, ((5-1)-2)-3⟩ - ⟨ 4 2 Β―1 ⟩ - diff --git a/help/abs_modulus.md b/help/abs_modulus.md new file mode 100644 index 00000000..1e015d37 --- /dev/null +++ b/help/abs_modulus.md @@ -0,0 +1,27 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/abs_modulus.html).* + +# Pipe (`|`) + +## `| 𝕩`: Absolute Value + +Absolute Value of `𝕩`. + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) + + | Β―2 + + | 1β€Ώ3β€ΏΒ―4β€Ώ3 + + + +## `𝕨 | 𝕩`: Modulus + +Remainder of `𝕩` divided by `𝕨`. + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) + + 1 | 3 + + 2 | 3β€Ώ4β€Ώ5 + + diff --git a/help/after_bindright.md b/help/after_bindright.md new file mode 100644 index 00000000..653b5f55 --- /dev/null +++ b/help/after_bindright.md @@ -0,0 +1,43 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/after_bindright.html).* + +# Left Multimap (`⟜`) + +## `π”½βŸœπ•˜ 𝕩`: Bind + +Supply `π•˜` as a right argument to `𝔽` (`𝕩 𝔽 π•˜`). + +## `π•˜` must be a value, `F` must be dyadic. + + -⟜3 9 + + - 3 9 + + 9 - 3 + + + +## `π”½βŸœπ”Ύ 𝕩`: After + +Apply `𝔾` to `𝕩`, and supply it as a right argument to `𝔽` (`𝕩 𝔽 (𝔾 𝕩)`). + +## `𝔽` must be dyadic, `𝔾` must be monadic. + + Γ—βŸœ- 9 + + Γ— - 9 + + 9 Γ— (- 9) + + + +## `𝕨 π”½βŸœπ”Ύ 𝕩`: Dyadic After + +Apply `𝔾` to `𝕩`, and supply it as a right argument to `𝔽` (`𝕨 𝔽 (𝔾 𝕩)`). + +## `𝔽` must be dyadic, `𝔾` must be monadic. + + 2 Γ—βŸœ- 1 + + 2 Γ— (- 1) + + diff --git a/help/assert_assertwithmsg.md b/help/assert_assertwithmsg.md new file mode 100644 index 00000000..4a7e26cf --- /dev/null +++ b/help/assert_assertwithmsg.md @@ -0,0 +1,29 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/assert_assertwithmsg.html).* + +# Exclamation Mark (`!`) + +## `! 𝕩`: Assert + +Throw an error if `𝕩` is not 1. + + ! 1 + + ! 2 + + ! "hello" + + + + +## `𝕨 ! 𝕩`: Dyad + +Throw an error with message `𝕨` if `𝕩` is not 1. + + "hi" ! 1 + + "two" ! 2 + + "hello error" ! "hello" + + + diff --git a/help/atop.md b/help/atop.md new file mode 100644 index 00000000..98073c0f --- /dev/null +++ b/help/atop.md @@ -0,0 +1,29 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/atop.html).* + +# Ring Operator (`∘`) + +## `π”½βˆ˜π”Ύ 𝕩`: Atop + +Apply `𝔾` to `𝕩`, then apply `𝔽` (`𝔽 𝔾 𝕩`). + +## `𝔽` and `𝔾` must be monadic. + + -∘- 5 + + - - 5 + + + +## `𝕨 π”½βˆ˜π”Ύ 𝕩`: Dyadic Atop + +Apply `𝔾` to `𝕨` and `𝕩`, then apply `𝔽` (`𝔽 (𝕨 𝔾 𝕩)`). + +## `𝔽` must be monadic, and `𝔾` must be dyadic. + + 1 -∘+ 2 + + 1 - + 2 + + - 1 + 2 + + diff --git a/help/before_bindleft.md b/help/before_bindleft.md new file mode 100644 index 00000000..2ebbf8e7 --- /dev/null +++ b/help/before_bindleft.md @@ -0,0 +1,43 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/before_bindleft.html).* + +# Multimap (`⊸`) + +## `π•—βŠΈπ”Ύ 𝕩`: Bind Left + +Supply `𝕗` as a left argument to `𝔾` (`𝕗 𝔾 𝕩`). + +## `𝕗` must be a value, `𝔾` must be dyadic. + + 3⊸- 9 + + 3 - 9 + + + +## `π”½βŠΈπ”Ύ 𝕩`: Before + +Apply `𝔽` to `𝕩`, and supply it as a left argument to `𝔾` (`(𝔽 𝕩) 𝔾 𝕩`). + +## `𝔽` must be monadic, `𝔾` must be dyadic. + + -⊸+ 9 + + - + 9 + + (- 9) + 9 + + + +## `𝕨 π”½βŠΈπ”Ύ 𝕩`: Dyadic Before + +Apply `𝔽` to `𝕨`, and supply it as a left argument to `𝔾` (`(𝔽 𝕨) 𝔾 𝕩`). + +## `𝔽` must be monadic, `𝔾` must be dyadic. + + 2 -⊸+ 1 + + 2 - + 1 + + (- 2) + 1 + + diff --git a/help/catch.md b/help/catch.md new file mode 100644 index 00000000..5f1b3087 --- /dev/null +++ b/help/catch.md @@ -0,0 +1,17 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/catch.html).* + +# Circled Triangle Down (`⎊`) + +## `π”½βŽŠπ”Ύ 𝕩`, `𝕨 π”½βŽŠπ”Ύ 𝕩`: Catch + +Apply `𝔽` to the arguments. + +If an error happens when `𝔽` is applied, cancel its execution, apply `𝔾` to the arguments and return the results. + +Otherwise, return the results of `𝔽`. + + ∾⎊{"error occurred with argument: "βˆΎβ€’Fmt 𝕩} 1 + + ∾⎊{"error occurred with argument: "βˆΎβ€’Fmt 𝕩} ⟨⟨1,2⟩, ⟨3,4⟩⟩ + + diff --git a/help/ceiling_maximum.md b/help/ceiling_maximum.md new file mode 100644 index 00000000..a0ac5282 --- /dev/null +++ b/help/ceiling_maximum.md @@ -0,0 +1,25 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/ceiling_maximum.html).* + +# Left Ceiling (`⌈`) + +## `⌈ 𝕩`: Ceiling + +Round `𝕩` up. + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) + + ⌈ 1.2β€ΏΟ€β€Ώ3β€Ώ7.89 + + + +## `𝕨 ⌈ 𝕩`: Maximum + +Maximum of `𝕨` and `𝕩`. + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) + + 1 ⌈ 2 + + 2β€Ώ3 ⌈ 4β€Ώ2 + + diff --git a/help/cells.md b/help/cells.md new file mode 100644 index 00000000..6f21a19f --- /dev/null +++ b/help/cells.md @@ -0,0 +1,17 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/cells.html).* + +# Breve (`˘`) + +## `π”½Λ˜ 𝕩`, `𝕨 π”½Λ˜ 𝕩`: Cells + +Apply `𝔽` to/between the major cells of the arguments. (`π”½βŽ‰Β―1`) + + a ← 3β€Ώ3 β₯Š ↕9 + + + <˘ a + + a β‰Λ˜ a + + + diff --git a/help/choose.md b/help/choose.md new file mode 100644 index 00000000..c6af346b --- /dev/null +++ b/help/choose.md @@ -0,0 +1,19 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/choose.html).* + +# Circle with Lower Right Quadrant (`β—Ά`) + +## `π”½β—Άπ•˜ 𝕩`, `𝕨 π”½β—Άπ•˜ 𝕩`: Choose + +Apply `𝔽` to the arguments and pick a function from list `π•˜`. Apply the picked function to the arguments. + + F ← βŠ’β—Ά+β€Ώ-β€ΏΓ·β€ΏΓ— + + F 0 + + F 1 + + F 2 + + F 3 + + diff --git a/help/classify_indexof.md b/help/classify_indexof.md new file mode 100644 index 00000000..0aa3b0d6 --- /dev/null +++ b/help/classify_indexof.md @@ -0,0 +1,30 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/classify_indexof.html).* + +# Square Original Of (`⊐`) + +## `⊐ 𝕩`: Classify + +First index of each major cell of `𝕩` in `𝕩`. + + ⊐ 5β€Ώ6β€Ώ2β€Ώ2β€Ώ5β€Ώ1 + + a ← 3β€Ώ3 β₯Š 0β€Ώ1β€Ώ2β€Ώ9β€Ώ0β€Ώ9β€Ώ0β€Ώ1β€Ώ2 + + ⊐ a + + + +## `𝕨 ⊐ 𝕩`: Index Of + +First index of each major cell of `𝕩` in `𝕨`. Rank of `𝕩` must be at least cell rank of 𝕨`. + +If a cell is not found in `𝕨`, that position will contain the length of `𝕨` (`≠𝕨`). + + 5β€Ώ6β€Ώ2β€Ώ2β€Ώ5β€Ώ1 ⊐ 5β€Ώ2β€Ώ1β€Ώ6 + + a ← 3β€Ώ3 β₯Š 0β€Ώ1β€Ώ2β€Ώ9β€Ώ0β€Ώ9β€Ώ0β€Ώ1β€Ώ2 + + a ⊐ ⟨9β€Ώ0β€Ώ9⟩ + + + diff --git a/help/conjugate_add.md b/help/conjugate_add.md new file mode 100644 index 00000000..0ed0c332 --- /dev/null +++ b/help/conjugate_add.md @@ -0,0 +1,24 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/conjugate_add.html).* + +# Plus (`+`) + +## `+ 𝕩`: Conjugate + + + 1 + + + Β―1 + + +## `𝕨 + 𝕩`: Add + +## `𝕨` added to `𝕩`. Either `𝕨` or `𝕩` can be a character, and if so, the other has to be an integer. + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) + + 1 + 2 + + 1 + 2β€Ώ3β€Ώ4 + + 'a' + 4 + + diff --git a/help/constant.md b/help/constant.md new file mode 100644 index 00000000..0939831c --- /dev/null +++ b/help/constant.md @@ -0,0 +1,13 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/constant.html).* + +# Dot Above (`Λ™`) + +## `𝔽˙ 𝕩`, `𝕨 𝔽˙ 𝕩`: Constant + +Returns a function that will always return `𝕗`. + + "hello" (1 Λ™) 2 + + "hello" ({𝕨+𝕩} Λ™) 2 + + diff --git a/help/deduplicate_find.md b/help/deduplicate_find.md new file mode 100644 index 00000000..631638c4 --- /dev/null +++ b/help/deduplicate_find.md @@ -0,0 +1,33 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/deduplicate_find.html).* + +# Epsilon Underbar (`⍷`) + +## `⍷ 𝕩`: Deduplicate + +Unique major cells of `𝕩`. + + ⍷ 4β€Ώ5β€Ώ6β€Ώ6β€Ώ4β€Ώ7β€Ώ5 + + a ← 3β€Ώ3 β₯Š ↕6 + + ⍷ a + + + +## `𝕨 ⍷ 𝕩`: Find + +Mark the top left location of the occurrences of `𝕨` in `𝕩` with a 1, and other locations with 0. + +Result is the same shape as `(≒𝕨)↕x`. + + "string" ⍷ "substring" + + "loooooong" ⍷ "short" + + a ← 7 (4|β‹†Λœ)βŒœβ—‹β†• 9 + + b ← (0β€Ώ3β€Ώ0≍0β€Ώ1β€Ώ0) + + b ⍷ a + + diff --git a/help/depth.md b/help/depth.md new file mode 100644 index 00000000..45be27e8 --- /dev/null +++ b/help/depth.md @@ -0,0 +1,14 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/depth.html).* + +# Circle With Two Dots (`βš‡`) + +## `π”½βš‡π•˜ 𝕩`, `𝕨 π”½βš‡π•˜ 𝕩`: Depth + +Apply `𝔽` to the cells of the arguments at depth given in `π•˜`. + + + 1βŠΈβ†“βš‡1 ⟨⟨1,2,3⟩, ⟨4,5,6⟩⟩ + + 1 β†“βš‡1 ⟨⟨1,2,3⟩, ⟨4,5,6⟩⟩ + + diff --git a/help/depth_match.md b/help/depth_match.md new file mode 100644 index 00000000..99c9dfdf --- /dev/null +++ b/help/depth_match.md @@ -0,0 +1,25 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/depth_match.html).* + +# Identical To (`≑`) + +## `≑ 𝕩`: Depth + +Highest level of nesting in `𝕩`. + + ≑ 2β€Ώ3β€Ώ4 + + ≑ ⟨2,<3,4,<<<5⟩ + + ≑ 9 + + + +## `𝕨 ≑ 𝕩`: Match + +Does `𝕨` exactly match `𝕩`? + + 1 ≑ ⟨1⟩ + + ⟨1⟩ ≑ ⟨1⟩ + + diff --git a/help/deshape_reshape.md b/help/deshape_reshape.md new file mode 100644 index 00000000..98e930b3 --- /dev/null +++ b/help/deshape_reshape.md @@ -0,0 +1,31 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/deshape_reshape.html).* + +# Barb (`β₯Š`) + +## `β₯Š 𝕩`: Deshape + +Put all elements of `𝕩` in a rank 1 array, converting to array if necessary. + + β₯Š 1 + + β₯Š 1β€Ώ2 ≍ 3β€Ώ4 + + + +## `𝕨 β₯Š 𝕩`: Reshape + +Put all elements of `𝕩` in an array of shape `𝕨`, adding or removing elements if necessary. + +A single element in `𝕩` can be a function, which will be replaced with an appropriate length: +- `∘` Exact fit +- `⌊` Round length down, discarding elements +- `⌽` Round length up +- `↑` Round length up, and use element fill to add extra elements. + + 3β€Ώ3 β₯Š 3 + + 2β€ΏβŒ½β€Ώ2 β₯Š 1β€Ώ2β€Ώ3 + + 2‿↑‿2 β₯Š 1β€Ώ2β€Ώ3 + + diff --git a/help/each.md b/help/each.md new file mode 100644 index 00000000..a34392c6 --- /dev/null +++ b/help/each.md @@ -0,0 +1,13 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/each.html).* + +# Diaresis (`Β¨`) + +## `𝔽¨ 𝕩`, `𝕨 𝔽¨ 𝕩`: Each + +Apply `𝔽` to/between the major elements of the arguments. (`π”½βš‡Β―1`) + + <Β¨ 1β€Ώ2β€Ώ3 + + 4β€Ώ5β€Ώ6 ∾¨ 1β€Ώ2β€Ώ3 + + diff --git a/help/enclose_less.md b/help/enclose_less.md new file mode 100644 index 00000000..0417b703 --- /dev/null +++ b/help/enclose_less.md @@ -0,0 +1,27 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/enclose_less.html).* + +# Lesser Than (`<`) + +## `< 𝕩`: Enclose + +Create a unit array containing `𝕩`. (`(≒𝕩) ≑ ⟨⟩`) + + + <1 + + + β‰’<1 + + + +## `𝕨 < 𝕩`: Lesser Than + +## `𝕨` and `𝕩` can both be either numbers or characters. + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) + + 1 < 3 + + 2β€Ώ3β€Ώ0 < 3β€Ώ1β€Ώ0 + + diff --git a/help/enlist_pair.md b/help/enlist_pair.md new file mode 100644 index 00000000..88168860 --- /dev/null +++ b/help/enlist_pair.md @@ -0,0 +1,25 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/enlist_pair.html).* + +# Bow Tie (`β‹ˆ`) + +## `β‹ˆ 𝕩`: Enlist + +Put `𝕩` in a single element list. (`βŸ¨π•©βŸ©`) + + β‹ˆ 1 + + β‹ˆ 4β€Ώ4 β₯Š 3β€Ώ67β€Ώ8β€Ώ0 + + + +## `𝕨 β‹ˆ 𝕩`: Pair + +Put `𝕨` and `𝕩` in a two element list. (`βŸ¨π•¨, π•©βŸ©`) + + 1 β‹ˆ 2 + + 1 β‹ˆ "dsdasdas" + + (3β€Ώ3 β₯Š 3) β‹ˆ 67β€Ώ'a'β€Ώ"example" + + diff --git a/help/exponential_power.md b/help/exponential_power.md new file mode 100644 index 00000000..c253f2b3 --- /dev/null +++ b/help/exponential_power.md @@ -0,0 +1,27 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/exponential_power.html).* + +# Star (`⋆`) + +## `⋆ 𝕩`: Exponential + +## `e` (Euler's constant) to the power of `𝕩`. + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) + + ⋆ 0β€Ώ1β€Ώ2β€Ώ3 + + + +## `𝕨 ⋆ 𝕩`: Power + +## `𝕨` to the power of `𝕩`. + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) + + 2 ⋆ 5 + + 8β€Ώ5β€Ώ9 ⋆ 2 + + 2β€Ώ3 ⋆ 3β€ΏΒ―4 + + diff --git a/help/first_pick.md b/help/first_pick.md new file mode 100644 index 00000000..c415b8f9 --- /dev/null +++ b/help/first_pick.md @@ -0,0 +1,27 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/first_pick.html).* + +# Square Image Of Or Equal To (`βŠ‘`) + +## `βŠ‘ 𝕩`: First + +First element of `𝕩`. + + βŠ‘ ⟨1, 2, 3⟩ + + a ← 3β€Ώ3 β₯Š ↕9 + + βŠ‘ a + + + +## `𝕨 βŠ‘ 𝕩`: Pick + +Pick the element of `𝕨` at index `𝕩`. + + 2 βŠ‘ ⟨1, 2, 3⟩ + + a ← 3β€Ώ3 β₯Š ↕9 + + 2β€Ώ0 βŠ‘ a + + diff --git a/help/firstcell_select.md b/help/firstcell_select.md new file mode 100644 index 00000000..94c82357 --- /dev/null +++ b/help/firstcell_select.md @@ -0,0 +1,27 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/firstcell_select.html).* + +# Square Image Of (`⊏`) + +## `⊏ 𝕩`: First Cell + +First major cell of `𝕩`. + + ⊏ ⟨1, 2, 3⟩ + + a ← 3β€Ώ3 β₯Š ↕9 + + ⊏ a + + + +## `𝕨 ⊏ 𝕩`: Select + +Select the major cells of `𝕨` at the indices in `𝕩`. + + 2β€Ώ0 ⊏ ⟨1, 2, 3⟩ + + a ← 3β€Ώ3 β₯Š ↕9 + + 2β€Ώ0 ⊏ a + + diff --git a/help/floor_minimum.md b/help/floor_minimum.md new file mode 100644 index 00000000..95bb5976 --- /dev/null +++ b/help/floor_minimum.md @@ -0,0 +1,25 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/floor_minimum.html).* + +# Left Floor (`⌊`) + +## `⌊ 𝕩`: Floor + +Round `𝕩` down. + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) + + ⌊ 1.2β€ΏΟ€β€Ώ3β€Ώ7.89 + + + +## `𝕨 ⌊ 𝕩`: Minimum + +Minimum of `𝕨` and `𝕩`. + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) + + 1 ⌊ 2 + + 2β€Ώ3 ⌊ 4β€Ώ2 + + diff --git a/help/fold.md b/help/fold.md new file mode 100644 index 00000000..3684d96c --- /dev/null +++ b/help/fold.md @@ -0,0 +1,30 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/fold.html).* + +# Acute Accent (`Β΄`) + +## `𝔽´ 𝕩`: Fold + +Fold over `𝕩` with `𝔽` from right to left i.e. Insert `𝔽` between the elements of `𝕩`. + + +Β΄ 1β€Ώ2β€Ώ3 + + 1+2+3 + + -Β΄ 1β€Ώ2β€Ώ3 + + 1-2-3 + + +## `𝕨 𝔽´ 𝕩`: Fold With initial + +Monadic fold, but use `𝕨` as initial right argument. + + 5 +Β΄ 1β€Ώ2β€Ώ3 + + 1+2+3+5 + + 5 -Β΄ 1β€Ώ2β€Ώ3 + + 1-2-3-5 + + diff --git a/help/gradedown_binsdown.md b/help/gradedown_binsdown.md new file mode 100644 index 00000000..8568293d --- /dev/null +++ b/help/gradedown_binsdown.md @@ -0,0 +1,29 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/gradedown_binsdown.html).* + +# Del Stile (`⍒`) + +## `⍒ 𝕩`: Grade Down + +Indices of `𝕩` that would sort its major cells in descending order. + + a ← 1β€Ώ2β€Ώ3 + + ⍒ a + + (⍒a) ⊏ a + + + +## `𝕨 ⍒ 𝕩`: Bins Down + +Binary search for each element of `𝕩` in `𝕨`, and return the index found, if any. + +## `𝕨` must be sorted in descending order. + +[Right Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) + + 7β€Ώ5β€Ώ4β€Ώ3 ⍒ 2 + + 7β€Ώ5β€Ώ4β€Ώ3 ⍒ 2β€Ώ6 + + diff --git a/help/gradeup_binsup.md b/help/gradeup_binsup.md new file mode 100644 index 00000000..1ddd891a --- /dev/null +++ b/help/gradeup_binsup.md @@ -0,0 +1,28 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/gradeup_binsup.html).* + +# Delta Stile (`⍋`) + +## `⍋ 𝕩`: Grade Up + +Indices of `𝕩` that would sort its major cells in ascending order. + + a ← 3β€Ώ2β€Ώ1 + + ⍋ a + + (⍋a) ⊏ a + + + + +## `𝕨 ⍋ 𝕩`: Bins Up + +Binary search for each element of `𝕩` in `𝕨`, and return the index found, if any. + +## `𝕨` must be sorted in ascending order. + + 3β€Ώ4β€Ώ5β€Ώ7 ⍋ 2 + + 3β€Ώ4β€Ώ5β€Ώ7 ⍋ 2β€Ώ6 + + diff --git a/help/greatequal.md b/help/greatequal.md new file mode 100644 index 00000000..f1b8b4f8 --- /dev/null +++ b/help/greatequal.md @@ -0,0 +1,15 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/greatequal.html).* + +# Greater Than or Equal To (`β‰₯`) + +## `𝕨 β‰₯ 𝕩`: Greater Than or Equal To + +## `𝕨` and `𝕩` can both be either numbers or characters. + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) + + 1 β‰₯ 3 + + 2β€Ώ3β€Ώ0 β‰₯ 3β€Ώ1β€Ώ0 + + diff --git a/help/groupindices_group.md b/help/groupindices_group.md new file mode 100644 index 00000000..ee0e9762 --- /dev/null +++ b/help/groupindices_group.md @@ -0,0 +1,31 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/groupindices_group.html).* + +# Square Cup (`βŠ”`) + +## `βŠ” 𝕩`: Group Indices + +Group the indices of the major cells of `𝕩` by their respective values. + +## `𝕩` must consist of integers. Groups start from 0. + + βŠ” 4β€Ώ5β€Ώ6β€Ώ6β€Ώ4β€Ώ7β€Ώ5 + + (↕8) ≍ βŠ” 4β€Ώ5β€Ώ6β€Ώ6β€Ώ4β€Ώ7β€Ώ5 + + + +## `𝕨 βŠ” 𝕩`: Group + +Group the major cells of `𝕩` by their respective indices in `𝕨`. + +If an element corresponds to `Β―1`, it is excluded from grouping. + +An extra element can be added to the end of `𝕨` to specify length of the result. + + 1β€Ώ0β€Ώ1β€Ώ2β€Ώ2β€Ώ3β€Ώ3 βŠ” 4β€Ώ5β€Ώ6β€Ώ6β€Ώ4β€Ώ7β€Ώ5 + + 1β€Ώ0β€Ώ1β€ΏΒ―1β€ΏΒ―1β€Ώ3β€Ώ3 βŠ” 4β€Ώ5β€Ώ6β€Ώ6β€Ώ4β€Ώ7β€Ώ5 + + 1β€Ώ0β€Ώ1β€ΏΒ―1β€ΏΒ―1β€Ώ3β€Ώ3β€Ώ10 βŠ” 4β€Ώ5β€Ώ6β€Ώ6β€Ώ4β€Ώ7β€Ώ5 + + diff --git a/help/identity_left.md b/help/identity_left.md new file mode 100644 index 00000000..dabe6cc7 --- /dev/null +++ b/help/identity_left.md @@ -0,0 +1,21 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/identity_left.html).* + +# Left Tack (`⊣`) + +## `⊣ 𝕩`: + +Return `𝕩`. + + ⊣ 5 + + + +## `𝕨 ⊣ 𝕩`: Left + +Return `𝕨`. + + 5 ⊣ 8 + + 'a' ⊣ 1β€Ώ2β€Ώ3 + + diff --git a/help/identity_right.md b/help/identity_right.md new file mode 100644 index 00000000..a0844a8f --- /dev/null +++ b/help/identity_right.md @@ -0,0 +1,21 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/identity_right.html).* + +# Right Tack (`⊒`) + +## `⊒ 𝕩`: + +Return `𝕩`. + + ⊒ 5 + + + +## `𝕨 ⊒ 𝕩`: Right + +Return `𝕩`. + + 5 ⊒ 8 + + 'a' ⊒ 1β€Ώ2β€Ώ3 + + diff --git a/help/indices_replicate.md b/help/indices_replicate.md new file mode 100644 index 00000000..9ffad842 --- /dev/null +++ b/help/indices_replicate.md @@ -0,0 +1,25 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/indices_replicate.html).* + +# Solidus (`/`) + +## `/ 𝕩`: Indices + +Repeat the index of each element in `𝕩` by the element's value. `𝕩` must be rank 1. + + / 1β€Ώ2β€Ώ3 + + / 1β€Ώ0β€Ώ1 + + + +## `𝕨 / 𝕩`: Replicate + +Repeat each major cell in `𝕩` by the corresponding element in `𝕨`. + +Atomic `𝕨` applies to all elements. + + 3 / "copy" + + 1β€Ώ0β€Ώ1 / 1β€Ώ2β€Ώ3 + + diff --git a/help/join_jointo.md b/help/join_jointo.md new file mode 100644 index 00000000..13419744 --- /dev/null +++ b/help/join_jointo.md @@ -0,0 +1,31 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/join_jointo.html).* + +# Lazy S (`∾`) + +## `∾ 𝕩`: Join + +Join all elements of `𝕩` together. + +Element ranks must be compatible. + + ∾ ⟨1β€Ώ2, 3, 4β€Ώ5⟩ + + m ← (3β€Ώ1β‰βŒœ4β€Ώ2β€Ώ5) β₯ŠΒ¨ 2β€Ώ3β₯Šβ†•6 + + ∾ m + + + +## `𝕨 ∾ 𝕩`: Join + +Join `𝕨` to `𝕩` along the first axis. + + "abcd" ∾ "EFG" + + a ← 3β€Ώ3 β₯Š ↕9 + + c ← 4β€Ώ3 β₯Š ↕12 + + a∾c + + diff --git a/help/length_notequal.md b/help/length_notequal.md new file mode 100644 index 00000000..057247c9 --- /dev/null +++ b/help/length_notequal.md @@ -0,0 +1,32 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/length_notequal.html).* + +# Not Equal (`β‰ `) + +## `β‰  𝕩`: Length + +Length of the first dimension of `𝕩`. + + + β‰  3 + + β‰  ⟨1, 2, 3⟩ + + β‰  3β€Ώ4β€Ώ5β₯Š0 + + β‰  1β€Ώ4β€Ώ5β₯Š0 + + β‰  4β€Ώ4β€Ώ5β₯Š0 + + + +## `𝕨 β‰  𝕩`: Not Equal To + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) + + 1 β‰  3 + + 2β€Ώ3β€Ώ0 β‰  3β€Ώ1β€Ώ0 + + 'a' β‰  'a' + + diff --git a/help/lessequal.md b/help/lessequal.md new file mode 100644 index 00000000..4d77dbfc --- /dev/null +++ b/help/lessequal.md @@ -0,0 +1,15 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/lessequal.html).* + +# Lesser Than or Equal To (`≀`) + +## `𝕨 ≀ 𝕩`: Lesser Than or Equal To + +## `𝕨` and `𝕩` can both be either numbers or characters. + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) + + 1 ≀ 3 + + 2β€Ώ3β€Ώ0 ≀ 3β€Ώ1β€Ώ0 + + diff --git a/help/markfirst_memberof.md b/help/markfirst_memberof.md new file mode 100644 index 00000000..228d6a50 --- /dev/null +++ b/help/markfirst_memberof.md @@ -0,0 +1,29 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/markfirst_memberof.html).* + +# Element Of (`∊`) + +## `∊ 𝕩`: Unique Mask + +Mark the first occurrence of each major cell in `𝕩` with a 1, and all other occurrences with a 0. + + ∊ 4β€Ώ5β€Ώ6β€Ώ6β€Ώ4β€Ώ7β€Ώ5 + + a ← 3β€Ώ3 β₯Š ↕9 + + ∊ a + + + +## `𝕨 ∊ 𝕩`: Member Of + +Is each element in `𝕨` a major cell of `𝕩`? + + ⟨1⟩ ∊ ↕9 + + a ← 3β€Ώ3 β₯Š ↕9 + + ⟨0β€Ώ1β€Ώ2⟩ ∊ a + + ⟨1β€Ώ3 β₯Š 0β€Ώ1β€Ώ2⟩ ∊ a + + diff --git a/help/merge_great.md b/help/merge_great.md new file mode 100644 index 00000000..c91b3b8b --- /dev/null +++ b/help/merge_great.md @@ -0,0 +1,37 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/merge_great.html).* + +# Greater Than (`>`) + +## `> 𝕩`: Merge + +Add the rank of an element of `𝕩` to the rank of `𝕩`. + +All elements must have the same rank. + +Returns atomic values as is. + + + a ← ⟨⟨1, 2⟩, ⟨3, 4⟩⟩ + + >a + + β‰’a + + β‰’>a + + + + +## `𝕨 > 𝕩`: Greater Than + +`𝕨` and `𝕩` can both be either numbers or characters. + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) + + 1 > 3 + + 2β€Ώ3β€Ώ0 > 3β€Ώ1β€Ώ0 + + 'a' > 'b' + + diff --git a/help/negate_subtract.md b/help/negate_subtract.md new file mode 100644 index 00000000..8a70e1bf --- /dev/null +++ b/help/negate_subtract.md @@ -0,0 +1,30 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/negate_subtract.html).* + +# Minus (`-`) + +## `- 𝕩`: Negate + +Additive Inverse of `𝕩`. + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) + + - 1 + + - Β―1 + + +## `𝕨 - 𝕩`: Subtract + +Subtract `𝕩` from `𝕨`. `𝕨` and `𝕩` can be characters or integers. + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) + + 1 - 2 + + 1 - 2β€Ώ3β€Ώ4 + + 'a' - 4 + + 'b' - 'a' + + diff --git a/help/not_span.md b/help/not_span.md new file mode 100644 index 00000000..7b099699 --- /dev/null +++ b/help/not_span.md @@ -0,0 +1,27 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/not_span.html).* + +# Not (`Β¬`) + +## `Β¬ 𝕩`: Logical Not + +Logical Not of `𝕩`. + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) + + Β¬ 0 + + Β¬ 1β€Ώ0 + + + +## `𝕨 Β¬ 𝕩`: Span + +Count of numbers in the inclusive range from `𝕩` to `𝕨`. + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) + + 3 Β¬ 1 + + 3β€Ώ4 Β¬ 0β€Ώ2 + + diff --git a/help/occcount_progindex.md b/help/occcount_progindex.md new file mode 100644 index 00000000..649869c8 --- /dev/null +++ b/help/occcount_progindex.md @@ -0,0 +1,23 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/occcount_progindex.html).* + +# Square Original Of or Equal To (`βŠ’`) + +## `βŠ’ 𝕩`: Occurrence Count + +Number of times each major cell of `𝕩` appears before itself. + + βŠ’ 2β€Ώ7β€Ώ1β€Ώ8β€Ώ1β€Ώ7β€Ώ1β€Ώ8β€Ώ2β€Ώ8β€Ώ4 + + β‰βŸœβŠ’ 2β€Ώ7β€Ώ1β€Ώ8β€Ώ1β€Ώ7β€Ώ1β€Ώ8β€Ώ2β€Ώ8β€Ώ4 + + + +## `𝕨 βŠ’ 𝕩`: Progressive Index Of + +Index of the first unused match of each major cell of `𝕩` in `𝕨`. If there are no more matches left, length of `𝕨` is placed in that position. + + "aaa" βŠ’ "aaaaa" + + "aaabb" βŠ’ "ababababab" + + diff --git a/help/over.md b/help/over.md new file mode 100644 index 00000000..d6086037 --- /dev/null +++ b/help/over.md @@ -0,0 +1,29 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/over.html).* + +# Circle (`β—‹`) + +## `𝔽○𝔾 𝕩`: Atop + +Apply `𝔾` to `𝕩`, then apply `𝔽` (`𝔽 𝔾 𝕩`). + +## `𝔽` and `𝔾` must be monadic. + + -β—‹- 5 + + - - 5 + + + +## `𝕨 𝔽○𝔾 𝕩`: Over + +Apply `𝔾` to `𝕨` and `𝕩`, then apply `𝔽` to them (`(𝔾 𝕨) 𝔽 (𝔾 𝕩)`). + +## `𝔽` must be dyadic, `𝔾` must be monadic. + + 1 +β—‹- 2 + + 1 + - 2 + + (- 1) + (- 2) + + diff --git a/help/prefixes_take.md b/help/prefixes_take.md new file mode 100644 index 00000000..636574fa --- /dev/null +++ b/help/prefixes_take.md @@ -0,0 +1,35 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/prefixes_take.html).* + +# Up Arrow (`↑`) + +## `↑ 𝕩`: Prefixes + +Prefixes of array `𝕩` along its first axis. + + ↑ 1β€Ώ2β€Ώ3β€Ώ4 + + a ← 3β€Ώ3 β₯Š ↕9 + + ↑ a + + + +## `𝕨 ↑ 𝕩`: Take + +For each integer in `𝕨`, take that many elements from each dimension of `𝕩`. + +Negative numbers take from the end. + +If any of the elements in `𝕨` are greater than the length of their respective dimension, the dimension is extended with a fill value. + + 3 ↑ 1β€Ώ3β€Ώ5β€Ώ67 + + a ← 4β€Ώ4 β₯Š ↕16 + + 3β€Ώ3 ↑ a + + 5β€Ώ5 ↑ a + + 3β€ΏΒ―3 ↑ a + + diff --git a/help/range_windows.md b/help/range_windows.md new file mode 100644 index 00000000..d4f82a1c --- /dev/null +++ b/help/range_windows.md @@ -0,0 +1,27 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/range_windows.html).* + +# Up Down Arrow (`↕`) + +## `↕ 𝕩`: Range + +Return all indices to index into an array of shape `𝕩`, in the shape described by `𝕩`. + +When given a single number, range from 0 to `𝕩-1`. + + ↕ 4 + + ↕ 4β€Ώ5 + + + +## `𝕨 ↕ 𝕩`: Windows + +Overlapping slices of `𝕩` which are of shape `𝕨`. + + 5 ↕ "abcdefg" + + a ← 3β€Ώ3β₯Šβ†•9 + + 2β€Ώ2 ↕ a + + diff --git a/help/rank.md b/help/rank.md new file mode 100644 index 00000000..0bbab822 --- /dev/null +++ b/help/rank.md @@ -0,0 +1,20 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/rank.html).* + +# Circled Horizontal Bar With Notch (`βŽ‰`) + +## `π”½βŽ‰π•˜ 𝕩`, `𝕨 π”½βŽ‰π•˜ 𝕩`: Rank + +Apply `𝔽` to cells at ranks given in `π•˜`. + +The ranks applied are given by the following: + +- `βŽ‰ c` Rank-c cells of `𝕩` (monadic) or both arguments (dyadic) +- `βŽ‰ bβ€Ώc` ⍝ Rank-b cells of `𝕨` and rank-c cells of `𝕩` (dyadic) +- `βŽ‰ aβ€Ώbβ€Ώc` ⍝ Rank-a cells of `𝕩` (monadic), b-cells of `𝕨` and c-cells of `𝕩` (dyadic) + + + a ← 3β€Ώ2β€Ώ4β₯Š"ABCDEFGHIJKLMNOPQRSTUVWXYZ" + + βŒ½βŽ‰2 a + + diff --git a/help/rank_equal.md b/help/rank_equal.md new file mode 100644 index 00000000..1663df7d --- /dev/null +++ b/help/rank_equal.md @@ -0,0 +1,30 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/rank_equal.html).* + +# Equal (`=`) + +## `= 𝕩`: Rank + +Returns the number of dimensions in `𝕩`. + + + = 0 + + = 3β₯Š0 + + = 3β€Ώ3β₯Š0 + + 3β€Ώ3β€Ώ3 β₯Š ⟨⟨0⟩⟩ + + + +## `𝕨 = 𝕩`: Equal To + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) + + 1 = 3 + + 2β€Ώ3β€Ώ0 = 3β€Ώ1β€Ώ0 + + 'a' = 'a' + + diff --git a/help/reciprocal_divide.md b/help/reciprocal_divide.md new file mode 100644 index 00000000..d0630205 --- /dev/null +++ b/help/reciprocal_divide.md @@ -0,0 +1,26 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/reciprocal_divide.html).* + +# Divide (`Γ·`) + +## `Γ· 𝕩`: Reciprocal + +Gives `1 Γ· 𝕩`. + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) + + Γ· 5 + + + +## `𝕨 Γ· 𝕩`: Divide + +## `𝕨` divided by `𝕩`. + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) + + 5 Γ· 4 + + 14 Γ· 7 + + + diff --git a/help/repeat.md b/help/repeat.md new file mode 100644 index 00000000..4a94ac57 --- /dev/null +++ b/help/repeat.md @@ -0,0 +1,17 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/repeat.html).* + +# Circle Star (`⍟`) + +## `π”½βŸπ”Ύ 𝕩`, `𝕨 π”½βŸπ”Ύ 𝕩`: Repeat + +Apply `𝔾` to `𝕨` and `𝕩` and apply `𝔽` to `𝕩` that may times. If `𝕨` is given, keep it as a constant left argument. + +If `𝔾` returns an array, give `π”½βŸπ•©` for each element. + + 1 +⍟⊒ 4 + + 1 +⍟1β€Ώ2β€Ώ3 4 + + 3 ∾⍟{≠𝕩} ⟨4,5,6⟩ + + diff --git a/help/reverse_rotate.md b/help/reverse_rotate.md new file mode 100644 index 00000000..a7ec430b --- /dev/null +++ b/help/reverse_rotate.md @@ -0,0 +1,27 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/reverse_rotate.html).* + +# Circle Stile (`⌽`) + +## `⌽ 𝕩`: Reverse + +Reverse the first axis of `𝕩`. + + ⌽ 1β€Ώ2β€Ώ3 + + a ← 3β€Ώ3 β₯Š ↕9 + + ⌽ a + + + +## `𝕨 ⌽ 𝕩`: Dyad + +Move the first `𝕨` elements of `𝕩` to its end. Negative `𝕨` reverses the direction of rotation. + + 2 ⌽ 1β€Ώ2β€Ώ3 + + a ← 3β€Ώ3 β₯Š ↕9 + + 2 ⌽ a + + diff --git a/help/scan.md b/help/scan.md new file mode 100644 index 00000000..c2e92f67 --- /dev/null +++ b/help/scan.md @@ -0,0 +1,31 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/scan.html).* + +# Grave (`` ` ``) + +## ``𝔽` 𝕩``: Fold + +Scan over `𝕩` with `𝔽` from left to right, producing intermediate values. + + + +` 1β€Ώ2β€Ώ3 + + ⟨1, 1+2, (1+2)+3⟩ + + -` 1β€Ώ2β€Ώ3 + + ⟨1, 1-2, (1-2)-3⟩ + + +## ``𝕨 𝔽` 𝕩``: Scan With initial + +Monadic scan, but use `𝕨` as initial left argument. + + 5 +` 1β€Ώ2β€Ώ3 + + ⟨5+1, (5+1)+2, ((5+1)+2)+3⟩ + + 5 -` 1β€Ώ2β€Ώ3 + + ⟨5-1, (5-1)-2, ((5-1)-2)-3⟩ + + diff --git a/help/self_swap.md b/help/self_swap.md new file mode 100644 index 00000000..fdd4dcc8 --- /dev/null +++ b/help/self_swap.md @@ -0,0 +1,23 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/self_swap.html).* + +# Small Tilde (`˜`) + +## `π”½Λœ 𝕩`: Self + +Supplies `𝕩` as a left argument to `𝔽` (`𝕩 𝔽 𝕩`). + + 1 + 1 + + +˜ 1 + + + +## `𝕨 π”½Λœ 𝕩`: Swap + +Swaps the arguments of `𝔽` (`𝕩 𝔽 𝕨`). + + 1 - 2 + + 1 -˜ 2 + + diff --git a/help/shape_notmatch.md b/help/shape_notmatch.md new file mode 100644 index 00000000..663d1d61 --- /dev/null +++ b/help/shape_notmatch.md @@ -0,0 +1,25 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/shape_notmatch.html).* + +# Not Identical To (`β‰’`) + +## `β‰’ 𝕩`: Shape + +Length of each dimension of x. + + β‰’ 1 + + β‰’ 1β€Ώ2 + + β‰’ 1β€Ώ2 ≍ 3β€Ώ4 + + + +## `𝕨 β‰’ 𝕩`: Not Match + +Does `𝕨` not exactly match `𝕩`? + + 1 β‰’ ⟨1⟩ + + ⟨1⟩ β‰’ ⟨1⟩ + + diff --git a/help/shiftafter.md b/help/shiftafter.md new file mode 100644 index 00000000..08e42a89 --- /dev/null +++ b/help/shiftafter.md @@ -0,0 +1,27 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/shiftafter.html).* + +# Right Pointing Double Angle Quotation (`Β»`) + +## `Β» 𝕩`: Shift After + +Remove the last element of `𝕩`, add a cell of fill values to the start of the first axis of `𝕩`. + + Β» 1β€Ώ2β€Ώ3 + + Β» 3β€Ώ3 β₯Š 9 + + + +## `𝕨 Β» 𝕩`: Shift After + +Remove the last `≠𝕨` (length) major cells from `𝕩`, join `𝕨` to the start of `𝕩`. Ranks must match. + + 78 Β» 1β€Ώ2β€Ώ3 + + 1β€Ώ2 Β» 1β€Ώ2β€Ώ3 + + a ← 3β€Ώ3 β₯Š 9 + + 1β€Ώ2β€Ώ3 Β» a + + diff --git a/help/shiftbefore.md b/help/shiftbefore.md new file mode 100644 index 00000000..ca32833f --- /dev/null +++ b/help/shiftbefore.md @@ -0,0 +1,27 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/shiftbefore.html).* + +# Left Pointing Double Angle Quotation (`Β«`) + +## `Β« 𝕩`: Shift Before + +Remove the first element of `𝕩`, add a cell of fill values to the end of the first axis of `𝕩`. + + 78 Β« 1β€Ώ2β€Ώ3 + + Β« 1β€Ώ2β€Ώ3 + + Β« 3β€Ώ3 β₯Š 9 + + + +## `𝕨 Β« 𝕩`: Shift Before + +Remove the first `≠𝕨` (length) major cells from `𝕩`, join `𝕨` to the end of `𝕩`. Ranks must match. + + 8β€Ώ5 Β« 1β€Ώ2β€Ώ3 + + a ← 3β€Ώ3 β₯Š 9 + + 1β€Ώ2β€Ώ3 Β« a + + diff --git a/help/sign_multiply.md b/help/sign_multiply.md new file mode 100644 index 00000000..53a87654 --- /dev/null +++ b/help/sign_multiply.md @@ -0,0 +1,28 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/sign_multiply.html).* + +# Times (`Γ—`) + +## `Γ— 𝕩`: Sign + +Sign of `𝕩`. +- `Β―1` if `𝕩 < 0` +- `0` if `𝕩 = 0` +- `1` if `𝕩 > 0` + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) + + Γ— Β―5β€Ώ0β€Ώ5β€Ώ1 + + + +## `𝕨 Γ— 𝕩`: Multiply + +## `𝕨` multiplied by `𝕩`. + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) + + 1 Γ— 2 + + 2 Γ— 2β€Ώ3β€Ώ4 + + diff --git a/help/sindices replicate.md b/help/sindices replicate.md deleted file mode 100644 index c0040925..00000000 --- a/help/sindices replicate.md +++ /dev/null @@ -1,25 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/sindices replicate.html).* - -# Solidus (`/`) - -`/ 𝕩`: Indices - -Repeat the index of each element in `𝕩` by the element's value. `𝕩` must be rank 1. - - / 1β€Ώ2β€Ώ3 - ⟨ 0 1 1 2 2 2 ⟩ - / 1β€Ώ0β€Ώ1 - ⟨ 0 2 ⟩ - - -`𝕨 / 𝕩`: Replicate - -Repeat each major cell in `𝕩` by the corresponding element in `𝕨`. - -Atomic `𝕨` applies to all elements. - - 3 / "copy" - "cccooopppyyy" - 1β€Ώ0β€Ώ1 / 1β€Ώ2β€Ώ3 - ⟨ 1 3 ⟩ - diff --git a/help/solo_couple.md b/help/solo_couple.md new file mode 100644 index 00000000..ac66e5c2 --- /dev/null +++ b/help/solo_couple.md @@ -0,0 +1,33 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/solo_couple.html).* + +# Tape (`≍`) + +## `≍ 𝕩`: Solo + +Add a dimension to `𝕩`. + + ≍ 1 + + + ≍≍ 1 + + + ≍≍≍ 1 + + + ≍≍ 1β€Ώ2β€Ώ3β€Ώ4 + + + ≍≍≍ 1β€Ώ2β€Ώ3β€Ώ4 + + + +## `𝕨 ≍ 𝕩`: Couple + +Join `𝕨` and `𝕩` along a newly created axis. + + 1 ≍ 3 + + 1β€Ώ2 ≍ 2β€Ώ3 + + diff --git a/help/sortdown_or.md b/help/sortdown_or.md new file mode 100644 index 00000000..03982acd --- /dev/null +++ b/help/sortdown_or.md @@ -0,0 +1,25 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/sortdown_or.html).* + +# Logical Or (`∨`) + +## `∨ 𝕩`: Sort Down + +Sort array `𝕩` in descending order. + + ∨ 3β€Ώ1β€Ώ4β€Ώ1β€Ώ5 + + + +## `𝕨 ∨ 𝕩`: Logical Or + +Logical Or of `𝕨` and `𝕩`. + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) + + 1 ∨ 0 + + 1β€Ώ0 ∨ 1β€Ώ1 + + 0 ∨ 0 + + diff --git a/help/sortup_and.md b/help/sortup_and.md new file mode 100644 index 00000000..bf727848 --- /dev/null +++ b/help/sortup_and.md @@ -0,0 +1,23 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/sortup_and.html).* + +# Logical And (`∧`) + +## `∧ 𝕩`: Sort Up + +Sort array `𝕩` in ascending order. + + ∧ 3β€Ώ1β€Ώ4β€Ώ1β€Ώ5 + + + +## `𝕨 ∧ 𝕩`: Logical And + +Logical And of `𝕨` and `𝕩`. + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) + + 1 ∧ 1 + + 1β€Ώ0 ∧ 1β€Ώ1 + + diff --git a/help/squareroot_root.md b/help/squareroot_root.md new file mode 100644 index 00000000..02e4f74d --- /dev/null +++ b/help/squareroot_root.md @@ -0,0 +1,23 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/squareroot_root.html).* + +# Root (`√`) + +## `√ 𝕩`: Square root + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) + + √ 2 + + + +## `𝕨 √ 𝕩`: Root + +## `𝕨`th root of `𝕩`. + +[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) + + 2 √ 2 + + 1β€Ώ2β€Ώ3β€Ώ4 √ 4 + + diff --git a/help/suffixes_drop.md b/help/suffixes_drop.md new file mode 100644 index 00000000..10c93520 --- /dev/null +++ b/help/suffixes_drop.md @@ -0,0 +1,34 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/suffixes_drop.html).* + +# Down Arrow (`↓`) + +## `↓ 𝕩`: Suffixes + +Suffixes of array `𝕩` along its first axis. + + ↓ 1β€Ώ2β€Ώ3β€Ώ4 + + a ← 3β€Ώ3 β₯Š ↕9 + + ↓ a + + + +## `𝕨 ↓ 𝕩`: Drop + +For each integer in `𝕨`, drop that many elements from the beginning of each dimension of `𝕩`. + +Negative numbers drop from the end. + + 3 ↓ 1β€Ώ3β€Ώ5β€Ώ67 + + a ← 4β€Ώ4 β₯Š ↕16 + + 3β€Ώ3 ↓ a + + 5β€Ώ5 ↓ a + + + 3β€ΏΒ―3 ↓ a + + diff --git a/help/table.md b/help/table.md new file mode 100644 index 00000000..dd190660 --- /dev/null +++ b/help/table.md @@ -0,0 +1,13 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/table.html).* + +# Top Left Corner (`⌜`) + +## `𝕨 π”½βŒœ 𝕩`: Each + +Apply `𝔽` between every possible pair of the elements of the arguments. + + 1β€Ώ2β€Ώ3β€Ώ4 +⌜ 4β€Ώ5β€Ώ6β€Ώ7 + + "abc" ∾⌜ "xyz" + + diff --git a/help/template.md.tmp b/help/template.md.tmp deleted file mode 100644 index 5b994159..00000000 --- a/help/template.md.tmp +++ /dev/null @@ -1,47 +0,0 @@ -SymN (`S`) - -`S 𝕩`: Monad - -Description -``` -Ex -``` - -`𝕨 S 𝕩`: Dyad - -Description -``` -Ex -``` - -SymN (`S`) - -`𝔽 S 𝕩`: 1mod - -Description -``` -Ex -``` -`𝕨 𝔽 S 𝕩`: 1mod - -Description -``` -Ex -``` - - -SymN (`S`) - -`𝔽 S 𝔾 𝕩`: 2mod - -Description -``` -Ex -``` - -`𝕨 𝔽 S 𝔾 𝕩`: 2mod - -Description -``` -Ex -``` \ No newline at end of file diff --git a/help/transpose_dyadtranspose.md b/help/transpose_dyadtranspose.md new file mode 100644 index 00000000..d3db90ab --- /dev/null +++ b/help/transpose_dyadtranspose.md @@ -0,0 +1,27 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/transpose_dyadtranspose.html).* + +# Circle Backslash (`⍉`) + +## `⍉ 𝕩`: Transpose + +Move the first axis of `𝕩` to the end. + + a ← 3β€Ώ3 β₯Š ↕9 + + ⍉ a + + b ← 1β€Ώ2β€Ώ3 β₯Š ↕6 + + ≒⍉ b + + + +## `𝕨 ⍉ 𝕩`: Dyad + +Rearrange the axes of `𝕩` as per the axis indices in `𝕨`. + + β‰’ a ← 2β€Ώ3β€Ώ4β€Ώ5β€Ώ6 β₯Š1 + + β‰’ 1β€Ώ3β€Ώ2β€Ώ0β€Ώ4 ⍉ a + + diff --git a/help/under.md b/help/under.md new file mode 100644 index 00000000..0eb86091 --- /dev/null +++ b/help/under.md @@ -0,0 +1,22 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/under.html).* + +# Circle Jot (`⌾`) + +## `π”½βŒΎπ”Ύ 𝕩`, `𝕨 π”½βŒΎπ”Ύ 𝕩`: Under + +- Apply transformation `𝔾` to all arguments +- Apply `𝔽` to the transformed arguments +- Undo transformation `𝔾` + +Where `𝔾` must be + +1. A function invertible by `⁼` (Undo) +2. A structural modification + + 9⌾(1βŠΈβŠ‘) 1β€Ώ2β€Ώ3 + + √⁼ (√1) + (√9) + + 1 +⌾√ 9 + + diff --git a/help/undo.md b/help/undo.md new file mode 100644 index 00000000..0daa6469 --- /dev/null +++ b/help/undo.md @@ -0,0 +1,22 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/undo.html).* + +# Superscript Equals Sign (`⁼`) + +## `𝔽⁼ 𝕩`, `𝕨 𝔽⁼ 𝕩`: Undo + +Invert the function `𝔽`, or use its defined inverse. Not all functions have inverses. + + + 1 - 2 + + 1 -⁼ 2 + + √ 16 + + √⁼ 4 + + ⋆ 1 + + ⋆⁼ 2.718281828459045 + + diff --git a/help/valences.md b/help/valences.md new file mode 100644 index 00000000..d7ef83b8 --- /dev/null +++ b/help/valences.md @@ -0,0 +1,23 @@ +*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/valences.html).* + +# Circled Division Slash (`⊘`) + +## `π”½βŠ˜π”Ύ 𝕩`: Valences + +Apply `𝔽` to `𝕩`. + + +⊘- 5 + + -⊘+ 5 + + + +## `𝕨 π”½βŠ˜π”Ύ 𝕩`: Valences + +Apply `𝔾` to `𝕨` and `𝕩`. + + 4 +⊘- 5 + + 4 -⊘+ 5 + + diff --git a/help/|abs modulus.md b/help/|abs modulus.md deleted file mode 100644 index 7a67ad86..00000000 --- a/help/|abs modulus.md +++ /dev/null @@ -1,27 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/|abs modulus.html).* - -# Pipe (`|`) - -`| 𝕩`: Absolute Value - -Absolute Value of `𝕩`. - -[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) - - | Β―2 - 2 - | 1β€Ώ3β€ΏΒ―4β€Ώ3 - ⟨ 1 3 4 3 ⟩ - - -`𝕨 | 𝕩`: Modulus - -Remainder of `𝕩` divided by `𝕨`. - -[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) - - 1 | 3 - 0 - 2 | 3β€Ώ4β€Ώ5 - ⟨ 1 0 1 ⟩ - diff --git "a/help/\302\250each.md" "b/help/\302\250each.md" deleted file mode 100644 index 1ec3504d..00000000 --- "a/help/\302\250each.md" +++ /dev/null @@ -1,17 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/Β¨each.html).* - -# Diaresis (`Β¨`) - -`𝔽¨ 𝕩`, `𝕨 𝔽¨ 𝕩`: Each - -Apply `𝔽` to/between the major elements of the arguments. (`π”½βš‡Β―1`) - - <Β¨ 1β€Ώ2β€Ώ3 - β”Œβ”€ - Β· β”ŒΒ· β”ŒΒ· β”ŒΒ· - Β· 1 Β· 2 Β· 3 - β”˜ β”˜ β”˜ - β”˜ - 4β€Ώ5β€Ώ6 ∾¨ 1β€Ώ2β€Ώ3 - ⟨ ⟨ 4 1 ⟩ ⟨ 5 2 ⟩ ⟨ 6 3 ⟩ ⟩ - diff --git "a/help/\302\253shiftbefore.md" "b/help/\302\253shiftbefore.md" deleted file mode 100644 index ae9ec2ce..00000000 --- "a/help/\302\253shiftbefore.md" +++ /dev/null @@ -1,39 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/Β«shiftbefore.html).* - -# Left Pointing Double Angle Quotation (`Β«`) - -`Β« 𝕩`: Shift Before - -Remove the first element of `𝕩`, add a cell of fill values to the end of the first axis of `𝕩`. - - 78 Β« 1β€Ώ2β€Ώ3 - ⟨ 1 2 78 ⟩ - Β« 1β€Ώ2β€Ώ3 - ⟨ 2 3 0 ⟩ - Β« 3β€Ώ3 β₯Š 9 - β”Œβ”€ - β•΅ 9 9 9 - 9 9 9 - 0 0 0 - β”˜ - - -`𝕨 Β« 𝕩`: Shift Before - -Remove the first `≠𝕨` (length) major cells from `𝕩`, join `𝕨` to the end of `𝕩`. Ranks must match. - - 8β€Ώ5 Β« 1β€Ώ2β€Ώ3 - ⟨ 3 8 5 ⟩ - a ← 3β€Ώ3 β₯Š 9 - β”Œβ”€ - β•΅ 9 9 9 - 9 9 9 - 9 9 9 - β”˜ - 1β€Ώ2β€Ώ3 Β« a - β”Œβ”€ - β•΅ 9 9 9 - 9 9 9 - 1 2 3 - β”˜ - diff --git "a/help/\302\254not span.md" "b/help/\302\254not span.md" deleted file mode 100644 index 26349704..00000000 --- "a/help/\302\254not span.md" +++ /dev/null @@ -1,27 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/Β¬not span.html).* - -# Not (`Β¬`) - -`Β¬ 𝕩`: Logical Not - -Logical Not of `𝕩`. - -[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) - - Β¬ 0 - 1 - Β¬ 1β€Ώ0 - ⟨ 0 1 ⟩ - - -`𝕨 Β¬ 𝕩`: Span - -Count of numbers in the inclusive range from `𝕩` to `𝕨`. - -[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) - - 3 Β¬ 1 - 3 - 3β€Ώ4 Β¬ 0β€Ώ2 - ⟨ 4 3 ⟩ - diff --git "a/help/\302\264fold.md" "b/help/\302\264fold.md" deleted file mode 100644 index 2561bd89..00000000 --- "a/help/\302\264fold.md" +++ /dev/null @@ -1,30 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/Β΄fold.html).* - -# Acute Accent (`Β΄`) - -`𝔽´ 𝕩`: Fold - -Fold over `𝕩` with `𝔽` from right to left i.e. Insert `𝔽` between the elements of `𝕩`. - - +Β΄ 1β€Ώ2β€Ώ3 - 6 - 1+2+3 - 6 - -Β΄ 1β€Ώ2β€Ώ3 - 2 - 1-2-3 - 2 - -`𝕨 𝔽´ 𝕩`: Fold With initial - -Monadic fold, but use `𝕨` as initial right argument. - - 5 +Β΄ 1β€Ώ2β€Ώ3 - 11 - 1+2+3+5 - 11 - 5 -Β΄ 1β€Ώ2β€Ώ3 - Β―3 - 1-2-3-5 - Β―3 - diff --git "a/help/\302\273shiftafter.md" "b/help/\302\273shiftafter.md" deleted file mode 100644 index 0d0bf6ff..00000000 --- "a/help/\302\273shiftafter.md" +++ /dev/null @@ -1,39 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/Β»shiftafter.html).* - -# Right Pointing Double Angle Quotation (`Β»`) - -`Β» 𝕩`: Shift After - -Remove the last element of `𝕩`, add a cell of fill values to the start of the first axis of `𝕩`. - - Β» 1β€Ώ2β€Ώ3 - ⟨ 0 1 2 ⟩ - Β» 3β€Ώ3 β₯Š 9 - β”Œβ”€ - β•΅ 0 0 0 - 9 9 9 - 9 9 9 - β”˜ - - -`𝕨 Β» 𝕩`: Shift After - -Remove the last `≠𝕨` (length) major cells from `𝕩`, join `𝕨` to the start of `𝕩`. Ranks must match. - - 78 Β» 1β€Ώ2β€Ώ3 - ⟨ 78 1 2 ⟩ - 1β€Ώ2 Β» 1β€Ώ2β€Ώ3 - ⟨ 1 2 1 ⟩ - a ← 3β€Ώ3 β₯Š 9 - β”Œβ”€ - β•΅ 9 9 9 - 9 9 9 - 9 9 9 - β”˜ - 1β€Ώ2β€Ώ3 Β» a - β”Œβ”€ - β•΅ 1 2 3 - 9 9 9 - 9 9 9 - β”˜ - diff --git "a/help/\303\227sign multiply.md" "b/help/\303\227sign multiply.md" deleted file mode 100644 index ea513dbe..00000000 --- "a/help/\303\227sign multiply.md" +++ /dev/null @@ -1,28 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/Γ—sign multiply.html).* - -# Times (`Γ—`) - -`Γ— 𝕩`: Sign - -Sign of `𝕩`. -- `Β―1` if `𝕩 < 0` -- `0` if `𝕩 = 0` -- `1` if `𝕩 > 0` - -[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) - - Γ— Β―5β€Ώ0β€Ώ5β€Ώ1 - ⟨ Β―1 0 1 1 ⟩ - - -`𝕨 Γ— 𝕩`: Multiply - -`𝕨` multiplied by `𝕩`. - -[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) - - 1 Γ— 2 - 2 - 2 Γ— 2β€Ώ3β€Ώ4 - ⟨ 4 6 8 ⟩ - diff --git "a/help/\303\267reciprocal divide.md" "b/help/\303\267reciprocal divide.md" deleted file mode 100644 index d55fb14b..00000000 --- "a/help/\303\267reciprocal divide.md" +++ /dev/null @@ -1,22 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/Γ·reciprocal divide.html).* - -# Divide (`Γ·`) - -`Γ· 𝕩`: Reciprocal - -Gives `1 Γ· 𝕩`. - -[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) - - Γ· 5 - 0.2 - - -`𝕨 Γ· 𝕩`: Divide - -`𝕨` divided by `𝕩`. - -[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) - - ExamplesIfAny - diff --git "a/help/\313\230cells.md" "b/help/\313\230cells.md" deleted file mode 100644 index 39a686f2..00000000 --- "a/help/\313\230cells.md" +++ /dev/null @@ -1,28 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/˘cells.html).* - -# Breve (`˘`) - -`π”½Λ˜ 𝕩`, `𝕨 π”½Λ˜ 𝕩`: Cells - -Apply `𝔽` to/between the major cells of the arguments. (`π”½βŽ‰Β―1`) - - a ← 3β€Ώ3 β₯Š ↕9 - β”Œβ”€ - β•΅ 0 1 2 - 3 4 5 - 6 7 8 - β”˜ - <˘ a - ⟨ ⟨ 0 1 2 ⟩ ⟨ 3 4 5 ⟩ ⟨ 6 7 8 ⟩ ⟩ - a β‰Λ˜ a - β”Œβ”€ - β•Ž 0 1 2 - 0 1 2 - - 3 4 5 - 3 4 5 - - 6 7 8 - 6 7 8 - β”˜ - diff --git "a/help/\313\231constant.md" "b/help/\313\231constant.md" deleted file mode 100644 index f34e7ca4..00000000 --- "a/help/\313\231constant.md" +++ /dev/null @@ -1,13 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/Λ™constant.html).* - -# Dot Above (`Λ™`) - -`𝔽˙ 𝕩`, `𝕨 𝔽˙ 𝕩`: Constant - -Returns a function that will always return `𝕗`. - - "hello" (1 Λ™) 2 - 1 - "hello" ({𝕨+𝕩} Λ™) 2 - (function block) - diff --git "a/help/\313\234self swap.md" "b/help/\313\234self swap.md" deleted file mode 100644 index dcef5130..00000000 --- "a/help/\313\234self swap.md" +++ /dev/null @@ -1,23 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/˜self swap.html).* - -# Small Tilde (`˜`) - -`π”½Λœ 𝕩`: Self - -Supplies `𝕩` as a left argument to `𝔽` (`𝕩 𝔽 𝕩`). - - 1 + 1 - 2 - +˜ 1 - 2 - - -`𝕨 π”½Λœ 𝕩`: Swap - -Swaps the arguments of `𝔽` (`𝕩 𝔽 𝕨`). - - 1 - 2 - Β―1 - 1 -˜ 2 - 1 - diff --git "a/help/\342\201\274undo.md" "b/help/\342\201\274undo.md" deleted file mode 100644 index 10b622b3..00000000 --- "a/help/\342\201\274undo.md" +++ /dev/null @@ -1,22 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/⁼undo.html).* - -# Superscript Equals Sign (`⁼`) - -`𝔽⁼ 𝕩`, `𝕨 𝔽⁼ 𝕩`: Undo - -Invert the function `𝔽`, or use its defined inverse. Not all functions have inverses. - - - 1 - 2 - Β―1 - 1 -⁼ 2 - Β―1 - √ 16 - 4 - √⁼ 4 - 16 - ⋆ 1 - 2.718281828459045 - ⋆⁼ 2.718281828459045 - 1 - diff --git "a/help/\342\206\221prefixes take.md" "b/help/\342\206\221prefixes take.md" deleted file mode 100644 index 73530b51..00000000 --- "a/help/\342\206\221prefixes take.md" +++ /dev/null @@ -1,64 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/↑prefixes take.html).* - -# Up Arrow (`↑`) - -`↑ 𝕩`: Prefixes - -Prefixes of array `𝕩` along its first axis. - - ↑ 1β€Ώ2β€Ώ3β€Ώ4 - ⟨ ⟨⟩ ⟨ 1 ⟩ ⟨ 1 2 ⟩ ⟨ 1 2 3 ⟩ ⟨ 1 2 3 4 ⟩ ⟩ - a ← 3β€Ώ3 β₯Š ↕9 - β”Œβ”€ - β•΅ 0 1 2 - 3 4 5 - 6 7 8 - β”˜ - ↑ a - β”Œβ”€ - Β· ↕0β€Ώ3 β”Œβ”€ β”Œβ”€ β”Œβ”€ - β•΅ 0 1 2 β•΅ 0 1 2 β•΅ 0 1 2 - β”˜ 3 4 5 3 4 5 - β”˜ 6 7 8 - β”˜ - β”˜ - - -`𝕨 ↑ 𝕩`: Take - -For each integer in `𝕨`, take that many elements from each dimension of `𝕩`. - -Negative numbers take from the end. - -If any of the elements in `𝕨` are greater than the length of their respective dimension, the dimension is extended with a fill value. - - 3 ↑ 1β€Ώ3β€Ώ5β€Ώ67 - ⟨ 1 3 5 ⟩ - a ← 4β€Ώ4 β₯Š ↕16 - β”Œβ”€ - β•΅ 0 1 2 3 - 4 5 6 7 - 8 9 10 11 - 12 13 14 15 - β”˜ - 3β€Ώ3 ↑ a - β”Œβ”€ - β•΅ 0 1 2 - 4 5 6 - 8 9 10 - β”˜ - 5β€Ώ5 ↑ a - β”Œβ”€ - β•΅ 0 1 2 3 0 - 4 5 6 7 0 - 8 9 10 11 0 - 12 13 14 15 0 - 0 0 0 0 0 - β”˜ - 3β€ΏΒ―3 ↑ a - β”Œβ”€ - β•΅ 1 2 3 - 5 6 7 - 9 10 11 - β”˜ - diff --git "a/help/\342\206\223suffixes drop.md" "b/help/\342\206\223suffixes drop.md" deleted file mode 100644 index 39648ccd..00000000 --- "a/help/\342\206\223suffixes drop.md" +++ /dev/null @@ -1,53 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/↓suffixes drop.html).* - -# Down Arrow (`↓`) - -`↓ 𝕩`: Suffixes - -Suffixes of array `𝕩` along its first axis. - - ↓ 1β€Ώ2β€Ώ3β€Ώ4 - ⟨ ⟨ 1 2 3 4 ⟩ ⟨ 2 3 4 ⟩ ⟨ 3 4 ⟩ ⟨ 4 ⟩ ⟨⟩ ⟩ - a ← 3β€Ώ3 β₯Š ↕9 - β”Œβ”€ - β•΅ 0 1 2 - 3 4 5 - 6 7 8 - β”˜ - ↓ a - β”Œβ”€ - Β· β”Œβ”€ β”Œβ”€ β”Œβ”€ ↕0β€Ώ3 - β•΅ 0 1 2 β•΅ 3 4 5 β•΅ 6 7 8 - 3 4 5 6 7 8 β”˜ - 6 7 8 β”˜ - β”˜ - β”˜ - - -`𝕨 ↓ 𝕩`: Drop - -For each integer in `𝕨`, drop that many elements from the beginning of each dimension of `𝕩`. - -Negative numbers drop from the end. - - 3 ↓ 1β€Ώ3β€Ώ5β€Ώ67 - ⟨ 67 ⟩ - a ← 4β€Ώ4 β₯Š ↕16 - β”Œβ”€ - β•΅ 0 1 2 3 - 4 5 6 7 - 8 9 10 11 - 12 13 14 15 - β”˜ - 3β€Ώ3 ↓ a - β”Œβ”€ - β•΅ 15 - β”˜ - 5β€Ώ5 ↓ a - β”Œβ” - β””β”˜ - 3β€ΏΒ―3 ↓ a - β”Œβ”€ - β•΅ 12 - β”˜ - diff --git "a/help/\342\206\225range windows.md" "b/help/\342\206\225range windows.md" deleted file mode 100644 index d052bce0..00000000 --- "a/help/\342\206\225range windows.md" +++ /dev/null @@ -1,53 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/↕range windows.html).* - -# Up Down Arrow (`↕`) - -`↕ 𝕩`: Range - -Return all indices to index into an array of shape `𝕩`, in the shape described by `𝕩`. - -When given a single number, range from 0 to `𝕩-1`. - - ↕ 4 - ⟨ 0 1 2 3 ⟩ - ↕ 4β€Ώ5 - β”Œβ”€ - β•΅ ⟨ 0 0 ⟩ ⟨ 0 1 ⟩ ⟨ 0 2 ⟩ ⟨ 0 3 ⟩ ⟨ 0 4 ⟩ - ⟨ 1 0 ⟩ ⟨ 1 1 ⟩ ⟨ 1 2 ⟩ ⟨ 1 3 ⟩ ⟨ 1 4 ⟩ - ⟨ 2 0 ⟩ ⟨ 2 1 ⟩ ⟨ 2 2 ⟩ ⟨ 2 3 ⟩ ⟨ 2 4 ⟩ - ⟨ 3 0 ⟩ ⟨ 3 1 ⟩ ⟨ 3 2 ⟩ ⟨ 3 3 ⟩ ⟨ 3 4 ⟩ - β”˜ - - -`𝕨 ↕ 𝕩`: Windows - -Overlapping slices of `𝕩` which are of shape `𝕨`. - - 5 ↕ "abcdefg" - β”Œβ”€ - β•΅"abcde - bcdef - cdefg" - β”˜ - a ← 3β€Ώ3β₯Šβ†•9 - β”Œβ”€ - β•΅ 0 1 2 - 3 4 5 - 6 7 8 - β”˜ - 2β€Ώ2 ↕ a - β”Œβ”€ - ┆ 0 1 - 3 4 - - 1 2 - 4 5 - - - 3 4 - 6 7 - - 4 5 - 7 8 - β”˜ - diff --git "a/help/\342\210\212markfirst memberof.md" "b/help/\342\210\212markfirst memberof.md" deleted file mode 100644 index 04d4a940..00000000 --- "a/help/\342\210\212markfirst memberof.md" +++ /dev/null @@ -1,39 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/∊markfirst memberof.html).* - -# Element Of (`∊`) - -`∊ 𝕩`: Unique Mask - -Mark the first occurrence of each major cell in `𝕩` with a 1, and all other occurrences with a 0. - - ∊ 4β€Ώ5β€Ώ6β€Ώ6β€Ώ4β€Ώ7β€Ώ5 - ⟨ 1 1 1 0 0 1 0 ⟩ - a ← 3β€Ώ3 β₯Š ↕9 - β”Œβ”€ - β•΅ 0 1 2 - 3 4 5 - 6 7 8 - β”˜ - ∊ a - ⟨ 1 1 1 ⟩ - - -`𝕨 ∊ 𝕩`: Member Of - -Is each element in `𝕨` a major cell of `𝕩`? - - ⟨1⟩ ∊ ↕9 - ⟨ 1 ⟩ - a ← 3β€Ώ3 β₯Š ↕9 - β”Œβ”€ - β•΅ 0 1 2 - 3 4 5 - 6 7 8 - β”˜ - ⟨0β€Ώ1β€Ώ2⟩ ∊ a - β”ŒΒ· - Β· 0 - β”˜ - ⟨1β€Ώ3 β₯Š 0β€Ώ1β€Ώ2⟩ ∊ a - ⟨ 1 ⟩ - diff --git "a/help/\342\210\230atop.md" "b/help/\342\210\230atop.md" deleted file mode 100644 index 9a713560..00000000 --- "a/help/\342\210\230atop.md" +++ /dev/null @@ -1,29 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/∘atop.html).* - -# Ring Operator (`∘`) - -`π”½βˆ˜π”Ύ 𝕩`: Atop - -Apply `𝔾` to `𝕩`, then apply `𝔽` (`𝔽 𝔾 𝕩`). - -`𝔽` and `𝔾` must be monadic. - - -∘- 5 - 5 - - - 5 - 5 - - -`𝕨 π”½βˆ˜π”Ύ 𝕩`: Dyadic Atop - -Apply `𝔾` to `𝕨` and `𝕩`, then apply `𝔽` (`𝔽 (𝕨 𝔾 𝕩)`). - -`𝔽` must be monadic, and `𝔾` must be dyadic. - - 1 -∘+ 2 - Β―3 - 1 - + 2 - Β―1 - - 1 + 2 - Β―3 - diff --git "a/help/\342\210\232squareroot root.md" "b/help/\342\210\232squareroot root.md" deleted file mode 100644 index b7a30406..00000000 --- "a/help/\342\210\232squareroot root.md" +++ /dev/null @@ -1,23 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/√squareroot root.html).* - -# Root (`√`) - -`√ 𝕩`: Square root - -[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) - - √ 2 - 1.4142135623730951 - - -`𝕨 √ 𝕩`: Root - -`𝕨`th root of `𝕩`. - -[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) - - 2 √ 2 - 1.4142135623730951 - 1β€Ώ2β€Ώ3β€Ώ4 √ 4 - ⟨ 4 2 1.5874010519681994 1.414213562373095 ⟩ - diff --git "a/help/\342\210\247sortup and.md" "b/help/\342\210\247sortup and.md" deleted file mode 100644 index 9b23d4ac..00000000 --- "a/help/\342\210\247sortup and.md" +++ /dev/null @@ -1,23 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/∧sortup and.html).* - -# Logical And (`∧`) - -`∧ 𝕩`: Sort Up - -Sort array `𝕩` in ascending order. - - ∧ 3β€Ώ1β€Ώ4β€Ώ1β€Ώ5 - ⟨ 1 1 3 4 5 ⟩ - - -`𝕨 ∧ 𝕩`: Logical And - -Logical And of `𝕨` and `𝕩`. - -[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) - - 1 ∧ 1 - 1 - 1β€Ώ0 ∧ 1β€Ώ1 - ⟨ 1 0 ⟩ - diff --git "a/help/\342\210\250sortdown or.md" "b/help/\342\210\250sortdown or.md" deleted file mode 100644 index 78eebef9..00000000 --- "a/help/\342\210\250sortdown or.md" +++ /dev/null @@ -1,25 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/∨sortdown or.html).* - -# Logical Or (`∨`) - -`∨ 𝕩`: Sort Down - -Sort array `𝕩` in descending order. - - ∨ 3β€Ώ1β€Ώ4β€Ώ1β€Ώ5 - ⟨ 5 4 3 1 1 ⟩ - - -`𝕨 ∨ 𝕩`: Logical Or - -Logical Or of `𝕨` and `𝕩`. - -[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) - - 1 ∨ 0 - 1 - 1β€Ώ0 ∨ 1β€Ώ1 - ⟨ 1 1 ⟩ - 0 ∨ 0 - 0 - diff --git "a/help/\342\210\276join jointo.md" "b/help/\342\210\276join jointo.md" deleted file mode 100644 index b69f5a45..00000000 --- "a/help/\342\210\276join jointo.md" +++ /dev/null @@ -1,62 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/∾join jointo.html).* - -# Lazy S (`∾`) - -`∾ 𝕩`: Join - -Join all elements of `𝕩` together. - -Element ranks must be compatible. - - ∾ ⟨1β€Ώ2, 3, 4β€Ώ5⟩ - ⟨ 1 2 3 4 5 ⟩ - m ← (3β€Ώ1β‰βŒœ4β€Ώ2β€Ώ5) β₯ŠΒ¨ 2β€Ώ3β₯Šβ†•6 - β”Œβ”€ - β•΅ β”Œβ”€ β”Œβ”€ β”Œβ”€ - β•΅ 0 0 0 0 β•΅ 1 1 β•΅ 2 2 2 2 2 - 0 0 0 0 1 1 2 2 2 2 2 - 0 0 0 0 1 1 2 2 2 2 2 - β”˜ β”˜ β”˜ - β”Œβ”€ β”Œβ”€ β”Œβ”€ - β•΅ 3 3 3 3 β•΅ 4 4 β•΅ 5 5 5 5 5 - β”˜ β”˜ β”˜ - β”˜ - ∾ m - β”Œβ”€ - β•΅ 0 0 0 0 1 1 2 2 2 2 2 - 0 0 0 0 1 1 2 2 2 2 2 - 0 0 0 0 1 1 2 2 2 2 2 - 3 3 3 3 4 4 5 5 5 5 5 - β”˜ - - -`𝕨 ∾ 𝕩`: Join - -Join `𝕨` to `𝕩` along the first axis. - - "abcd" ∾ "EFG" - "abcdEFG" - a ← 3β€Ώ3 β₯Š ↕9 - β”Œβ”€ - β•΅ 0 1 2 - 3 4 5 - 6 7 8 - β”˜ - c ← 4β€Ώ3 β₯Š ↕12 - β”Œβ”€ - β•΅ 0 1 2 - 3 4 5 - 6 7 8 - 9 10 11 - β”˜ - a∾c - β”Œβ”€ - β•΅ 0 1 2 - 3 4 5 - 6 7 8 - 0 1 2 - 3 4 5 - 6 7 8 - 9 10 11 - β”˜ - diff --git "a/help/\342\211\215solo couple.md" "b/help/\342\211\215solo couple.md" deleted file mode 100644 index 03b8fe03..00000000 --- "a/help/\342\211\215solo couple.md" +++ /dev/null @@ -1,44 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/≍solo couple.html).* - -# Tape (`≍`) - -`≍ 𝕩`: Solo - -Add a dimension to `𝕩`. - - ≍ 1 - ⟨ 1 ⟩ - - ≍≍ 1 - β”Œβ”€ - β•΅ 1 - β”˜ - - ≍≍≍ 1 - β”Œβ”€ - β•Ž 1 - β”˜ - - ≍≍ 1β€Ώ2β€Ώ3β€Ώ4 - β”Œβ”€ - β•΅ 1 2 3 4 - β”˜ - - ≍≍≍ 1β€Ώ2β€Ώ3β€Ώ4 - β”Œβ”€ - β•Ž 1 2 3 4 - β”˜ - - -`𝕨 ≍ 𝕩`: Couple - -Join `𝕨` and `𝕩` along a newly created axis. - - 1 ≍ 3 - ⟨ 1 3 ⟩ - 1β€Ώ2 ≍ 2β€Ώ3 - β”Œβ”€ - β•΅ 1 2 - 2 3 - β”˜ - diff --git "a/help/\342\211\240length notequal.md" "b/help/\342\211\240length notequal.md" deleted file mode 100644 index e5696435..00000000 --- "a/help/\342\211\240length notequal.md" +++ /dev/null @@ -1,32 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/β‰ length notequal.html).* - -# Not Equal (`β‰ `) - -`β‰  𝕩`: Length - -Length of the first dimension of `𝕩`. - - - β‰  3 - 1 - β‰  ⟨1, 2, 3⟩ - 3 - β‰  3β€Ώ4β€Ώ5β₯Š0 - 3 - β‰  1β€Ώ4β€Ώ5β₯Š0 - 1 - β‰  4β€Ώ4β€Ώ5β₯Š0 - 4 - - -`𝕨 β‰  𝕩`: Not Equal To - -[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) - - 1 β‰  3 - 1 - 2β€Ώ3β€Ώ0 β‰  3β€Ώ1β€Ώ0 - ⟨ 1 1 0 ⟩ - 'a' β‰  'a' - 0 - diff --git "a/help/\342\211\241depth match.md" "b/help/\342\211\241depth match.md" deleted file mode 100644 index 32d8960b..00000000 --- "a/help/\342\211\241depth match.md" +++ /dev/null @@ -1,25 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/≑depth match.html).* - -# Identical To (`≑`) - -`≑ 𝕩`: Depth - -Highest level of nesting in `𝕩`. - - ≑ 2β€Ώ3β€Ώ4 - 1 - ≑ ⟨2,<3,4,<<<5⟩ - 4 - ≑ 9 - 0 - - -`𝕨 ≑ 𝕩`: Match - -Does `𝕨` exactly match `𝕩`? - - 1 ≑ ⟨1⟩ - 0 - ⟨1⟩ ≑ ⟨1⟩ - 1 - diff --git "a/help/\342\211\242shape notmatch.md" "b/help/\342\211\242shape notmatch.md" deleted file mode 100644 index 826aa2f4..00000000 --- "a/help/\342\211\242shape notmatch.md" +++ /dev/null @@ -1,25 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/β‰’shape notmatch.html).* - -# Not Identical To (`β‰’`) - -`β‰’ 𝕩`: Shape - -Length of each dimension of x. - - β‰’ 1 - ⟨⟩ - β‰’ 1β€Ώ2 - ⟨ 2 ⟩ - β‰’ 1β€Ώ2 ≍ 3β€Ώ4 - ⟨ 2 2 ⟩ - - -`𝕨 β‰’ 𝕩`: Not Match - -Does `𝕨` not exactly match `𝕩`? - - 1 β‰’ ⟨1⟩ - 1 - ⟨1⟩ β‰’ ⟨1⟩ - 0 - diff --git "a/help/\342\211\244lessequal.md" "b/help/\342\211\244lessequal.md" deleted file mode 100644 index 35e3bbef..00000000 --- "a/help/\342\211\244lessequal.md" +++ /dev/null @@ -1,15 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/≀lessequal.html).* - -# Lesser Than or Equal To (`≀`) - -`𝕨 ≀ 𝕩`: Lesser Than or Equal To - -`𝕨` and `𝕩` can both be either numbers or characters. - -[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) - - 1 ≀ 3 - 1 - 2β€Ώ3β€Ώ0 ≀ 3β€Ώ1β€Ώ0 - ⟨ 1 0 1 ⟩ - diff --git "a/help/\342\211\245greatequal.md" "b/help/\342\211\245greatequal.md" deleted file mode 100644 index 129478a9..00000000 --- "a/help/\342\211\245greatequal.md" +++ /dev/null @@ -1,15 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/β‰₯greatequal.html).* - -# Greater Than or Equal To (`β‰₯`) - -`𝕨 β‰₯ 𝕩`: Greater Than or Equal To - -`𝕨` and `𝕩` can both be either numbers or characters. - -[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) - - 1 β‰₯ 3 - 0 - 2β€Ώ3β€Ώ0 β‰₯ 3β€Ώ1β€Ώ0 - ⟨ 0 1 1 ⟩ - diff --git "a/help/\342\212\217firstcell select.md" "b/help/\342\212\217firstcell select.md" deleted file mode 100644 index e1f41e98..00000000 --- "a/help/\342\212\217firstcell select.md" +++ /dev/null @@ -1,40 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/⊏firstcell select.html).* - -# Square Image Of (`⊏`) - -`⊏ 𝕩`: First Cell - -First major cell of `𝕩`. - - ⊏ ⟨1, 2, 3⟩ - β”ŒΒ· - Β· 1 - β”˜ - a ← 3β€Ώ3 β₯Š ↕9 - β”Œβ”€ - β•΅ 0 1 2 - 3 4 5 - 6 7 8 - β”˜ - ⊏ a - ⟨ 0 1 2 ⟩ - - -`𝕨 ⊏ 𝕩`: Select - -Select the major cells of `𝕨` at the indices in `𝕩`. - - 2β€Ώ0 ⊏ ⟨1, 2, 3⟩ - ⟨ 3 1 ⟩ - a ← 3β€Ώ3 β₯Š ↕9 - β”Œβ”€ - β•΅ 0 1 2 - 3 4 5 - 6 7 8 - β”˜ - 2β€Ώ0 ⊏ a - β”Œβ”€ - β•΅ 6 7 8 - 0 1 2 - β”˜ - diff --git "a/help/\342\212\220classify indexof.md" "b/help/\342\212\220classify indexof.md" deleted file mode 100644 index b7fe2072..00000000 --- "a/help/\342\212\220classify indexof.md" +++ /dev/null @@ -1,39 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/⊐classify indexof.html).* - -# Square Original Of (`⊐`) - -`⊐ 𝕩`: Classify - -First index of each major cell of `𝕩` in `𝕩`. - - ⊐ 5β€Ώ6β€Ώ2β€Ώ2β€Ώ5β€Ώ1 - ⟨ 0 1 2 2 0 3 ⟩ - a ← 3β€Ώ3 β₯Š 0β€Ώ1β€Ώ2β€Ώ9β€Ώ0β€Ώ9β€Ώ0β€Ώ1β€Ώ2 - β”Œβ”€ - β•΅ 0 1 2 - 9 0 9 - 0 1 2 - β”˜ - ⊐ a - ⟨ 0 1 0 ⟩ - - -`𝕨 ⊐ 𝕩`: Index Of - -First index of each major cell of `𝕩` in `𝕨`. Rank of `𝕩` must be at least cell rank of 𝕨`. - -If a cell is not found in `𝕨`, that position will contain the length of `𝕨` (`≠𝕨`). - - 5β€Ώ6β€Ώ2β€Ώ2β€Ώ5β€Ώ1 ⊐ 5β€Ώ2β€Ώ1β€Ώ6 - ⟨ 0 2 5 1 ⟩ - a ← 3β€Ώ3 β₯Š 0β€Ώ1β€Ώ2β€Ώ9β€Ώ0β€Ώ9β€Ώ0β€Ώ1β€Ώ2 - β”Œβ”€ - β•΅ 0 1 2 - 9 0 9 - 0 1 2 - β”˜ - a ⊐ ⟨9β€Ώ0β€Ώ9⟩ - β”ŒΒ· - Β· 3 - β”˜ - diff --git "a/help/\342\212\221first pick.md" "b/help/\342\212\221first pick.md" deleted file mode 100644 index 8023466c..00000000 --- "a/help/\342\212\221first pick.md" +++ /dev/null @@ -1,35 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/βŠ‘first pick.html).* - -# Square Image Of Or Equal To (`βŠ‘`) - -`βŠ‘ 𝕩`: First - -First element of `𝕩`. - - βŠ‘ ⟨1, 2, 3⟩ - 1 - a ← 3β€Ώ3 β₯Š ↕9 - β”Œβ”€ - β•΅ 0 1 2 - 3 4 5 - 6 7 8 - β”˜ - βŠ‘ a - 0 - - -`𝕨 βŠ‘ 𝕩`: Pick - -Pick the element of `𝕨` at index `𝕩`. - - 2 βŠ‘ ⟨1, 2, 3⟩ - 3 - a ← 3β€Ώ3 β₯Š ↕9 - β”Œβ”€ - β•΅ 0 1 2 - 3 4 5 - 6 7 8 - β”˜ - 2β€Ώ0 βŠ‘ a - 6 - diff --git "a/help/\342\212\222occcount progindex.md" "b/help/\342\212\222occcount progindex.md" deleted file mode 100644 index 6ac22c80..00000000 --- "a/help/\342\212\222occcount progindex.md" +++ /dev/null @@ -1,26 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/βŠ’occcount progindex.html).* - -# Square Original Of or Equal To (`βŠ’`) - -`βŠ’ 𝕩`: Occurrence Count - -Number of times each major cell of `𝕩` appears before itself. - - βŠ’ 2β€Ώ7β€Ώ1β€Ώ8β€Ώ1β€Ώ7β€Ώ1β€Ώ8β€Ώ2β€Ώ8β€Ώ4 - ⟨ 0 0 0 0 1 1 2 1 1 2 0 ⟩ - β‰βŸœβŠ’ 2β€Ώ7β€Ώ1β€Ώ8β€Ώ1β€Ώ7β€Ώ1β€Ώ8β€Ώ2β€Ώ8β€Ώ4 - β”Œβ”€ - β•΅ 2 7 1 8 1 7 1 8 2 8 4 - 0 0 0 0 1 1 2 1 1 2 0 - β”˜ - - -`𝕨 βŠ’ 𝕩`: Progressive Index Of - -Index of the first unused match of each major cell of `𝕩` in `𝕨`. If there are no more matches left, length of `𝕨` is placed in that position. - - "aaa" βŠ’ "aaaaa" - ⟨ 0 1 2 3 3 ⟩ - "aaabb" βŠ’ "ababababab" - ⟨ 0 3 1 4 2 5 5 5 5 5 ⟩ - diff --git "a/help/\342\212\224groupindices group.md" "b/help/\342\212\224groupindices group.md" deleted file mode 100644 index 689ed6c1..00000000 --- "a/help/\342\212\224groupindices group.md" +++ /dev/null @@ -1,34 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/βŠ”groupindices group.html).* - -# Square Cup (`βŠ”`) - -`βŠ” 𝕩`: Group Indices - -Group the indices of the major cells of `𝕩` by their respective values. - -`𝕩` must consist of integers. Groups start from 0. - - βŠ” 4β€Ώ5β€Ώ6β€Ώ6β€Ώ4β€Ώ7β€Ώ5 - ⟨ ⟨⟩ ⟨⟩ ⟨⟩ ⟨⟩ ⟨ 0 4 ⟩ ⟨ 1 6 ⟩ ⟨ 2 3 ⟩ ⟨ 5 ⟩ ⟩ - (↕8) ≍ βŠ” 4β€Ώ5β€Ώ6β€Ώ6β€Ώ4β€Ώ7β€Ώ5 - β”Œβ”€ - β•΅ 0 1 2 3 4 5 6 7 - ⟨⟩ ⟨⟩ ⟨⟩ ⟨⟩ ⟨ 0 4 ⟩ ⟨ 1 6 ⟩ ⟨ 2 3 ⟩ ⟨ 5 ⟩ - β”˜ - - -`𝕨 βŠ” 𝕩`: Group - -Group the major cells of `𝕩` by their respective indices in `𝕨`. - -If an element corresponds to `Β―1`, it is excluded from grouping. - -An extra element can be added to the end of `𝕨` to specify length of the result. - - 1β€Ώ0β€Ώ1β€Ώ2β€Ώ2β€Ώ3β€Ώ3 βŠ” 4β€Ώ5β€Ώ6β€Ώ6β€Ώ4β€Ώ7β€Ώ5 - ⟨ ⟨ 5 ⟩ ⟨ 4 6 ⟩ ⟨ 6 4 ⟩ ⟨ 7 5 ⟩ ⟩ - 1β€Ώ0β€Ώ1β€ΏΒ―1β€ΏΒ―1β€Ώ3β€Ώ3 βŠ” 4β€Ώ5β€Ώ6β€Ώ6β€Ώ4β€Ώ7β€Ώ5 - ⟨ ⟨ 5 ⟩ ⟨ 4 6 ⟩ ⟨⟩ ⟨ 7 5 ⟩ ⟩ - 1β€Ώ0β€Ώ1β€ΏΒ―1β€ΏΒ―1β€Ώ3β€Ώ3β€Ώ10 βŠ” 4β€Ώ5β€Ώ6β€Ώ6β€Ώ4β€Ώ7β€Ώ5 - ⟨ ⟨ 5 ⟩ ⟨ 4 6 ⟩ ⟨⟩ ⟨ 7 5 ⟩ ⟨⟩ ⟨⟩ ⟨⟩ ⟨⟩ ⟨⟩ ⟨⟩ ⟩ - diff --git "a/help/\342\212\230valences.md" "b/help/\342\212\230valences.md" deleted file mode 100644 index d1079210..00000000 --- "a/help/\342\212\230valences.md" +++ /dev/null @@ -1,23 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/⊘valences.html).* - -# Circled Division Slash (`⊘`) - -`π”½βŠ˜π”Ύ 𝕩`: Valences - -Apply `𝔽` to `𝕩`. - - +⊘- 5 - 5 - -⊘+ 5 - Β―5 - - -`𝕨 π”½βŠ˜π”Ύ 𝕩`: Valences - -Apply `𝔾` to `𝕨` and `𝕩`. - - 4 +⊘- 5 - Β―1 - 4 -⊘+ 5 - 9 - diff --git "a/help/\342\212\242identity right.md" "b/help/\342\212\242identity right.md" deleted file mode 100644 index 2edca7c5..00000000 --- "a/help/\342\212\242identity right.md" +++ /dev/null @@ -1,21 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/⊒identity right.html).* - -# Right Tack (`⊒`) - -`⊒ 𝕩`: - -Return `𝕩`. - - ⊒ 5 - 5 - - -`𝕨 ⊒ 𝕩`: Right - -Return `𝕩`. - - 5 ⊒ 8 - 8 - 'a' ⊒ 1β€Ώ2β€Ώ3 - ⟨ 1 2 3 ⟩ - diff --git "a/help/\342\212\243identity left.md" "b/help/\342\212\243identity left.md" deleted file mode 100644 index 2af385a6..00000000 --- "a/help/\342\212\243identity left.md" +++ /dev/null @@ -1,21 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/⊣identity left.html).* - -# Left Tack (`⊣`) - -`⊣ 𝕩`: - -Return `𝕩`. - - ⊣ 5 - 5 - - -`𝕨 ⊣ 𝕩`: Left - -Return `𝕨`. - - 5 ⊣ 8 - 5 - 'a' ⊣ 1β€Ώ2β€Ώ3 - 'a' - diff --git "a/help/\342\212\270before bindleft.md" "b/help/\342\212\270before bindleft.md" deleted file mode 100644 index 0dfe86e5..00000000 --- "a/help/\342\212\270before bindleft.md" +++ /dev/null @@ -1,43 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/⊸before bindleft.html).* - -# Multimap (`⊸`) - -`π•—βŠΈπ”Ύ 𝕩`: Bind Left - -Supply `𝕗` as a left argument to `𝔾` (`𝕗 𝔾 𝕩`). - -`𝕗` must be a value, `𝔾` must be dyadic. - - 3⊸- 9 - Β―6 - 3 - 9 - Β―6 - - -`π”½βŠΈπ”Ύ 𝕩`: Before - -Apply `𝔽` to `𝕩`, and supply it as a left argument to `𝔾` (`(𝔽 𝕩) 𝔾 𝕩`). - -`𝔽` must be monadic, `𝔾` must be dyadic. - - -⊸+ 9 - 0 - - + 9 - Β―9 - (- 9) + 9 - 0 - - -`𝕨 π”½βŠΈπ”Ύ 𝕩`: Dyadic Before - -Apply `𝔽` to `𝕨`, and supply it as a left argument to `𝔾` (`(𝔽 𝕨) 𝔾 𝕩`). - -`𝔽` must be monadic, `𝔾` must be dyadic. - - 2 -⊸+ 1 - Β―1 - 2 - + 1 - 1 - (- 2) + 1 - Β―1 - diff --git "a/help/\342\213\206exponential power.md" "b/help/\342\213\206exponential power.md" deleted file mode 100644 index 51a16e05..00000000 --- "a/help/\342\213\206exponential power.md" +++ /dev/null @@ -1,27 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/⋆exponential power.html).* - -# Star (`⋆`) - -`⋆ 𝕩`: Exponential - -`e` (Euler's constant) to the power of `𝕩`. - -[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) - - ⋆ 0β€Ώ1β€Ώ2β€Ώ3 - ⟨ 1 2.718281828459045 7.38905609893065 20.085536923187668 ⟩ - - -`𝕨 ⋆ 𝕩`: Power - -`𝕨` to the power of `𝕩`. - -[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) - - 2 ⋆ 5 - 32 - 8β€Ώ5β€Ώ9 ⋆ 2 - ⟨ 64 25 81 ⟩ - 2β€Ώ3 ⋆ 3β€ΏΒ―4 - ⟨ 8 0.012345679012345678 ⟩ - diff --git "a/help/\342\213\210enlist pair.md" "b/help/\342\213\210enlist pair.md" deleted file mode 100644 index da631346..00000000 --- "a/help/\342\213\210enlist pair.md" +++ /dev/null @@ -1,38 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/β‹ˆenlist pair.html).* - -# Bow Tie (`β‹ˆ`) - -`β‹ˆ 𝕩`: Enlist - -Put `𝕩` in a single element list. (`βŸ¨π•©βŸ©`) - - β‹ˆ 1 - ⟨ 1 ⟩ - β‹ˆ 4β€Ώ4 β₯Š 3β€Ώ67β€Ώ8β€Ώ0 - β”Œβ”€ - Β· β”Œβ”€ - β•΅ 3 67 8 0 - 3 67 8 0 - 3 67 8 0 - 3 67 8 0 - β”˜ - β”˜ - - -`𝕨 β‹ˆ 𝕩`: Pair - -Put `𝕨` and `𝕩` in a two element list. (`βŸ¨π•¨, π•©βŸ©`) - - 1 β‹ˆ 2 - ⟨ 1 2 ⟩ - 1 β‹ˆ "dsdasdas" - ⟨ 1 "dsdasdas" ⟩ - (3β€Ώ3 β₯Š 3) β‹ˆ 67β€Ώ'a'β€Ώ"example" - β”Œβ”€ - Β· β”Œβ”€ ⟨ 67 'a' "example" ⟩ - β•΅ 3 3 3 - 3 3 3 - 3 3 3 - β”˜ - β”˜ - diff --git "a/help/\342\214\210ceiling maximum.md" "b/help/\342\214\210ceiling maximum.md" deleted file mode 100644 index 13bff822..00000000 --- "a/help/\342\214\210ceiling maximum.md" +++ /dev/null @@ -1,25 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/⌈ceiling maximum.html).* - -# Left Ceiling (`⌈`) - -`⌈ 𝕩`: Ceiling - -Round `𝕩` up. - -[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) - - ⌈ 1.2β€ΏΟ€β€Ώ3β€Ώ7.89 - ⟨ 2 4 3 8 ⟩ - - -`𝕨 ⌈ 𝕩`: Maximum - -Maximum of `𝕨` and `𝕩`. - -[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) - - 1 ⌈ 2 - 2 - 2β€Ώ3 ⌈ 4β€Ώ2 - ⟨ 4 3 ⟩ - diff --git "a/help/\342\214\212floor minimum.md" "b/help/\342\214\212floor minimum.md" deleted file mode 100644 index 8075e901..00000000 --- "a/help/\342\214\212floor minimum.md" +++ /dev/null @@ -1,25 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/⌊floor minimum.html).* - -# Left Floor (`⌊`) - -`⌊ 𝕩`: Floor - -Round `𝕩` down. - -[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) - - ⌊ 1.2β€ΏΟ€β€Ώ3β€Ώ7.89 - ⟨ 1 3 3 7 ⟩ - - -`𝕨 ⌊ 𝕩`: Minimum - -Minimum of `𝕨` and `𝕩`. - -[Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) - - 1 ⌊ 2 - 1 - 2β€Ώ3 ⌊ 4β€Ώ2 - ⟨ 2 2 ⟩ - diff --git "a/help/\342\214\234table.md" "b/help/\342\214\234table.md" deleted file mode 100644 index 6d7727fc..00000000 --- "a/help/\342\214\234table.md" +++ /dev/null @@ -1,22 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/⌜table.html).* - -# Top Left Corner (`⌜`) - -`𝕨 π”½βŒœ 𝕩`: Each - -Apply `𝔽` between every possible pair of the elements of the arguments. - - 1β€Ώ2β€Ώ3β€Ώ4 +⌜ 4β€Ώ5β€Ώ6β€Ώ7 - β”Œβ”€ - β•΅ 5 6 7 8 - 6 7 8 9 - 7 8 9 10 - 8 9 10 11 - β”˜ - "abc" ∾⌜ "xyz" - β”Œβ”€ - β•΅ "ax" "ay" "az" - "bx" "by" "bz" - "cx" "cy" "cz" - β”˜ - diff --git "a/help/\342\214\275reverse rotate.md" "b/help/\342\214\275reverse rotate.md" deleted file mode 100644 index f451d266..00000000 --- "a/help/\342\214\275reverse rotate.md" +++ /dev/null @@ -1,43 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/⌽reverse rotate.html).* - -# Circle Stile (`⌽`) - -`⌽ 𝕩`: Reverse - -Reverse the first axis of `𝕩`. - - ⌽ 1β€Ώ2β€Ώ3 - ⟨ 3 2 1 ⟩ - a ← 3β€Ώ3 β₯Š ↕9 - β”Œβ”€ - β•΅ 0 1 2 - 3 4 5 - 6 7 8 - β”˜ - ⌽ a - β”Œβ”€ - β•΅ 6 7 8 - 3 4 5 - 0 1 2 - β”˜ - - -`𝕨 ⌽ 𝕩`: Dyad - -Move the first `𝕨` elements of `𝕩` to its end. Negative `𝕨` reverses the direction of rotation. - - 2 ⌽ 1β€Ώ2β€Ώ3 - ⟨ 3 1 2 ⟩ - a ← 3β€Ώ3 β₯Š ↕9 - β”Œβ”€ - β•΅ 0 1 2 - 3 4 5 - 6 7 8 - β”˜ - 2 ⌽ a - β”Œβ”€ - β•΅ 6 7 8 - 0 1 2 - 3 4 5 - β”˜ - diff --git "a/help/\342\214\276under.md" "b/help/\342\214\276under.md" deleted file mode 100644 index 8a70afe9..00000000 --- "a/help/\342\214\276under.md" +++ /dev/null @@ -1,22 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/⌾under.html).* - -# Circle Jot (`⌾`) - -`π”½βŒΎπ”Ύ 𝕩`, `𝕨 π”½βŒΎπ”Ύ 𝕩`: Under - -- Apply transformation `𝔾` to all arguments -- Apply `𝔽` to the transformed arguments -- Undo transformation `𝔾` - -Where `𝔾` must be - -1. A function invertible by `⁼` (Undo) -2. A structural modification - - 9⌾(1βŠΈβŠ‘) 1β€Ώ2β€Ώ3 - ⟨ 1 9 3 ⟩ - √⁼ (√1) + (√9) - 16 - 1 +⌾√ 9 - 16 - diff --git "a/help/\342\215\211transpose dyadtranspose.md" "b/help/\342\215\211transpose dyadtranspose.md" deleted file mode 100644 index b8641803..00000000 --- "a/help/\342\215\211transpose dyadtranspose.md" +++ /dev/null @@ -1,38 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/⍉transpose dyadtranspose.html).* - -# Circle Backslash (`⍉`) - -`⍉ 𝕩`: Transpose - -Move the first axis of `𝕩` to the end. - - a ← 3β€Ώ3 β₯Š ↕9 - β”Œβ”€ - β•΅ 0 1 2 - 3 4 5 - 6 7 8 - β”˜ - ⍉ a - β”Œβ”€ - β•΅ 0 3 6 - 1 4 7 - 2 5 8 - β”˜ - b ← 1β€Ώ2β€Ώ3 β₯Š ↕6 - β”Œβ”€ - β•Ž 0 1 2 - 3 4 5 - β”˜ - ≒⍉ b - ⟨ 2 3 1 ⟩ - - -`𝕨 ⍉ 𝕩`: Dyad - -Rearrange the axes of `𝕩` as per the axis indices in `𝕨`. - - β‰’ a ← 2β€Ώ3β€Ώ4β€Ώ5β€Ώ6 β₯Š1 - ⟨ 2 3 4 5 6 ⟩ - β‰’ 1β€Ώ3β€Ώ2β€Ώ0β€Ώ4 ⍉ a - ⟨ 5 2 4 3 6 ⟩ - diff --git "a/help/\342\215\213gradeup binsup.md" "b/help/\342\215\213gradeup binsup.md" deleted file mode 100644 index c633a5d8..00000000 --- "a/help/\342\215\213gradeup binsup.md" +++ /dev/null @@ -1,30 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/⍋gradeup binsup.html).* - -# Delta Stile (`⍋`) - -`⍋ 𝕩`: Grade Up - -Indices of `𝕩` that would sort its major cells in ascending order. - - a ← 3β€Ώ2β€Ώ1 - ⟨ 3 2 1 ⟩ - ⍋ a - ⟨ 2 1 0 ⟩ - (⍋a) ⊏ a - ⟨ 1 2 3 ⟩ - - - -`𝕨 ⍋ 𝕩`: Bins Up - -Binary search for each element of `𝕩` in `𝕨`, and return the index found, if any. - -`𝕨` must be sorted in ascending order. - - 3β€Ώ4β€Ώ5β€Ώ7 ⍋ 2 - β”ŒΒ· - Β· 0 - β”˜ - 3β€Ώ4β€Ώ5β€Ώ7 ⍋ 2β€Ώ6 - ⟨ 0 3 ⟩ - diff --git "a/help/\342\215\222gradedown binsdown.md" "b/help/\342\215\222gradedown binsdown.md" deleted file mode 100644 index 970fcce9..00000000 --- "a/help/\342\215\222gradedown binsdown.md" +++ /dev/null @@ -1,31 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/⍒gradedown binsdown.html).* - -# Del Stile (`⍒`) - -`⍒ 𝕩`: Grade Down - -Indices of `𝕩` that would sort its major cells in descending order. - - a ← 1β€Ώ2β€Ώ3 - ⟨ 1 2 3 ⟩ - ⍒ a - ⟨ 2 1 0 ⟩ - (⍒a) ⊏ a - ⟨ 3 2 1 ⟩ - - -`𝕨 ⍒ 𝕩`: Bins Down - -Binary search for each element of `𝕩` in `𝕨`, and return the index found, if any. - -`𝕨` must be sorted in descending order. - -[Right Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) - - 7β€Ώ5β€Ώ4β€Ώ3 ⍒ 2 - β”ŒΒ· - Β· 4 - β”˜ - 7β€Ώ5β€Ώ4β€Ώ3 ⍒ 2β€Ώ6 - ⟨ 4 1 ⟩ - diff --git "a/help/\342\215\237repeat.md" "b/help/\342\215\237repeat.md" deleted file mode 100644 index 9f190991..00000000 --- "a/help/\342\215\237repeat.md" +++ /dev/null @@ -1,17 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/⍟repeat.html).* - -# Circle Star (`⍟`) - -`π”½βŸπ”Ύ 𝕩`, `𝕨 π”½βŸπ”Ύ 𝕩`: Repeat - -Apply `𝔾` to `𝕨` and `𝕩` and apply `𝔽` to `𝕩` that may times. If `𝕨` is given, keep it as a constant left argument. - -If `𝔾` returns an array, give `π”½βŸπ•©` for each element. - - 1 +⍟⊒ 4 - 8 - 1 +⍟1β€Ώ2β€Ώ3 4 - ⟨ 5 6 7 ⟩ - 3 ∾⍟{≠𝕩} ⟨4,5,6⟩ - ⟨ 3 3 3 4 5 6 ⟩ - diff --git "a/help/\342\215\267deduplicate find.md" "b/help/\342\215\267deduplicate find.md" deleted file mode 100644 index 52c560bb..00000000 --- "a/help/\342\215\267deduplicate find.md" +++ /dev/null @@ -1,58 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/⍷deduplicate find.html).* - -# Epsilon Underbar (`⍷`) - -`⍷ 𝕩`: Deduplicate - -Unique major cells of `𝕩`. - - ⍷ 4β€Ώ5β€Ώ6β€Ώ6β€Ώ4β€Ώ7β€Ώ5 - ⟨ 4 5 6 7 ⟩ - a ← 3β€Ώ3 β₯Š ↕6 - β”Œβ”€ - β•΅ 0 1 2 - 3 4 5 - 0 1 2 - β”˜ - ⍷ a - β”Œβ”€ - β•΅ 0 1 2 - 3 4 5 - β”˜ - - -`𝕨 ⍷ 𝕩`: Find - -Mark the top left location of the occurrences of `𝕨` in `𝕩` with a 1, and other locations with 0. - -Result is the same shape as `(≒𝕨)↕x`. - - "string" ⍷ "substring" - ⟨ 0 0 0 1 ⟩ - "loooooong" ⍷ "short" - ⟨⟩ - a ← 7 (4|β‹†Λœ)βŒœβ—‹β†• 9 - β”Œβ”€ - β•΅ 1 1 1 1 1 1 1 1 1 - 0 1 2 3 0 1 2 3 0 - 0 1 0 1 0 1 0 1 0 - 0 1 0 3 0 1 0 3 0 - 0 1 0 1 0 1 0 1 0 - 0 1 0 3 0 1 0 3 0 - 0 1 0 1 0 1 0 1 0 - β”˜ - b ← (0β€Ώ3β€Ώ0≍0β€Ώ1β€Ώ0) - β”Œβ”€ - β•΅ 0 3 0 - 0 1 0 - β”˜ - b ⍷ a - β”Œβ”€ - β•΅ 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 - 0 0 0 0 0 0 0 - 0 0 1 0 0 0 1 - 0 0 0 0 0 0 0 - 0 0 1 0 0 0 1 - β”˜ - diff --git "a/help/\342\216\211rank.md" "b/help/\342\216\211rank.md" deleted file mode 100644 index 153f1839..00000000 --- "a/help/\342\216\211rank.md" +++ /dev/null @@ -1,38 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/βŽ‰rank.html).* - -# Circled Horizontal Bar With Notch (`βŽ‰`) - -`π”½βŽ‰π•˜ 𝕩`, `𝕨 π”½βŽ‰π•˜ 𝕩`: Rank - -Apply `𝔽` to cells at ranks given in `π•˜`. - -The ranks applied are given by the following: - -- `βŽ‰ c` Rank-c cells of `𝕩` (monadic) or both arguments (dyadic) -- `βŽ‰ bβ€Ώc` ⍝ Rank-b cells of `𝕨` and rank-c cells of `𝕩` (dyadic) -- `βŽ‰ aβ€Ώbβ€Ώc` ⍝ Rank-a cells of `𝕩` (monadic), b-cells of `𝕨` and c-cells of `𝕩` (dyadic) - - - a ← 3β€Ώ2β€Ώ4β₯Š"ABCDEFGHIJKLMNOPQRSTUVWXYZ" - β”Œβ”€ - β•Ž"ABCD - EFGH - - Β·IJKL - MNOP - - Β·QRST - UVWX" - β”˜ - βŒ½βŽ‰2 a - β”Œβ”€ - β•Ž"EFGH - ABCD - - Β·MNOP - IJKL - - Β·UVWX - QRST" - β”˜ - diff --git "a/help/\342\216\212catch.md" "b/help/\342\216\212catch.md" deleted file mode 100644 index 9f95659c..00000000 --- "a/help/\342\216\212catch.md" +++ /dev/null @@ -1,17 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/⎊catch.html).* - -# Circled Triangle Down (`⎊`) - -`π”½βŽŠπ”Ύ 𝕩`, `𝕨 π”½βŽŠπ”Ύ 𝕩`: Catch - -Apply `𝔽` to the arguments. - -If an error happens when `𝔽` is applied, cancel its execution, apply `𝔾` to the arguments and return the results. - -Otherwise, return the results of `𝔽`. - - ∾⎊{"error occurred with argument: "βˆΎβ€’Fmt 𝕩} 1 - "error occurred with argument: 1" - ∾⎊{"error occurred with argument: "βˆΎβ€’Fmt 𝕩} ⟨⟨1,2⟩, ⟨3,4⟩⟩ - ⟨ 1 2 3 4 ⟩ - diff --git "a/help/\342\227\213over.md" "b/help/\342\227\213over.md" deleted file mode 100644 index 0c84d9bc..00000000 --- "a/help/\342\227\213over.md" +++ /dev/null @@ -1,29 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/β—‹over.html).* - -# Circle (`β—‹`) - -`𝔽○𝔾 𝕩`: Atop - -Apply `𝔾` to `𝕩`, then apply `𝔽` (`𝔽 𝔾 𝕩`). - -`𝔽` and `𝔾` must be monadic. - - -β—‹- 5 - 5 - - - 5 - 5 - - -`𝕨 𝔽○𝔾 𝕩`: Over - -Apply `𝔾` to `𝕨` and `𝕩`, then apply `𝔽` to them (`(𝔾 𝕨) 𝔽 (𝔾 𝕩)`). - -`𝔽` must be dyadic, `𝔾` must be monadic. - - 1 +β—‹- 2 - Β―3 - 1 + - 2 - Β―1 - (- 1) + (- 2) - Β―3 - diff --git "a/help/\342\227\266choose.md" "b/help/\342\227\266choose.md" deleted file mode 100644 index 8fd73b99..00000000 --- "a/help/\342\227\266choose.md" +++ /dev/null @@ -1,19 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/β—Άchoose.html).* - -# Circle with Lower Right Quadrant (`β—Ά`) - -`π”½β—Άπ•˜ 𝕩`, `𝕨 π”½β—Άπ•˜ 𝕩`: Choose - -Apply `𝔽` to the arguments and pick a function from list `π•˜`. Apply the picked function to the arguments. - - F ← βŠ’β—Ά+β€Ώ-β€ΏΓ·β€ΏΓ— - βŠ’β—ΆβŸ¨ + - Γ· Γ— ⟩ - F 0 - 0 - F 1 - Β―1 - F 2 - 0.5 - F 3 - 1 - diff --git "a/help/\342\232\207depth.md" "b/help/\342\232\207depth.md" deleted file mode 100644 index b680ba4b..00000000 --- "a/help/\342\232\207depth.md" +++ /dev/null @@ -1,14 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/βš‡depth.html).* - -# Circle With Two Dots (`βš‡`) - -`π”½βš‡π•˜ 𝕩`, `𝕨 π”½βš‡π•˜ 𝕩`: Depth - -Apply `𝔽` to the cells of the arguments at depth given in `π•˜`. - - - 1βŠΈβ†“βš‡1 ⟨⟨1,2,3⟩, ⟨4,5,6⟩⟩ - ⟨ ⟨ 2 3 ⟩ ⟨ 5 6 ⟩ ⟩ - 1 β†“βš‡1 ⟨⟨1,2,3⟩, ⟨4,5,6⟩⟩ - ⟨ ⟨ 2 3 ⟩ ⟨ 5 6 ⟩ ⟩ - diff --git "a/help/\342\237\234after bindright.md" "b/help/\342\237\234after bindright.md" deleted file mode 100644 index 00a6de2d..00000000 --- "a/help/\342\237\234after bindright.md" +++ /dev/null @@ -1,43 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/⟜after bindright.html).* - -# Left Multimap (`⟜`) - -`π”½βŸœπ•˜ 𝕩`: Bind - -Supply `π•˜` as a right argument to `𝔽` (`𝕩 𝔽 π•˜`). - -`π•˜` must be a value, `F` must be dyadic. - - -⟜3 9 - 6 - - 3 9 - Error - 9 - 3 - 6 - - -`π”½βŸœπ”Ύ 𝕩`: After - -Apply `𝔾` to `𝕩`, and supply it as a right argument to `𝔽` (`𝕩 𝔽 (𝔾 𝕩)`). - -`𝔽` must be dyadic, `𝔾` must be monadic. - - Γ—βŸœ- 9 - Β―81 - Γ— - 9 - Β―1 - 9 Γ— (- 9) - Β―81 - - -`𝕨 π”½βŸœπ”Ύ 𝕩`: Dyadic After - -Apply `𝔾` to `𝕩`, and supply it as a right argument to `𝔽` (`𝕨 𝔽 (𝔾 𝕩)`). - -`𝔽` must be dyadic, `𝔾` must be monadic. - - 2 Γ—βŸœ- 1 - Β―2 - 2 Γ— (- 1) - Β―2 - diff --git "a/help/\342\245\212deshape reshape.md" "b/help/\342\245\212deshape reshape.md" deleted file mode 100644 index f5fc40a2..00000000 --- "a/help/\342\245\212deshape reshape.md" +++ /dev/null @@ -1,43 +0,0 @@ -*View this file with results and syntax highlighting [here](https://mlochbaum.github.io/BQN/help/β₯Šdeshape reshape.html).* - -# Barb (`β₯Š`) - -`β₯Š 𝕩`: Deshape - -Put all elements of `𝕩` in a rank 1 array, converting to array if necessary. - - β₯Š 1 - ⟨ 1 ⟩ - β₯Š 1β€Ώ2 ≍ 3β€Ώ4 - ⟨ 1 2 3 4 ⟩ - - -`𝕨 β₯Š 𝕩`: Reshape - -Put all elements of `𝕩` in an array of shape `𝕨`, adding or removing elements if necessary. - -A single element in `𝕩` can be a function, which will be replaced with an appropriate length: -- `∘` Exact fit -- `⌊` Round length down, discarding elements -- `⌽` Round length up -- `↑` Round length up, and use element fill to add extra elements. - - 3β€Ώ3 β₯Š 3 - β”Œβ”€ - β•΅ 3 3 3 - 3 3 3 - 3 3 3 - β”˜ - 2β€ΏβŒ½β€Ώ2 β₯Š 1β€Ώ2β€Ώ3 - β”Œβ”€ - β•Ž 1 2 - - 3 1 - β”˜ - 2‿↑‿2 β₯Š 1β€Ώ2β€Ώ3 - β”Œβ”€ - β•Ž 1 2 - - 3 0 - β”˜ - -- cgit v1.2.3 From edddb9be0aa1f03c8608d3dabf7ccfea3fdde206 Mon Sep 17 00:00:00 2001 From: razetime Date: Wed, 19 Jan 2022 22:52:35 +0530 Subject: fix erratic h2s --- help/after_bindright.md | 4 ++-- help/atop.md | 4 ++-- help/before_bindleft.md | 4 ++-- help/conjugate_add.md | 2 +- help/enclose_less.md | 2 +- help/exponential_power.md | 4 ++-- help/gradedown_binsdown.md | 2 +- help/gradeup_binsup.md | 2 +- help/greatequal.md | 2 +- help/lessequal.md | 2 +- help/over.md | 4 ++-- help/reciprocal_divide.md | 2 +- help/sign_multiply.md | 2 +- help/squareroot_root.md | 2 +- 14 files changed, 19 insertions(+), 19 deletions(-) (limited to 'help') diff --git a/help/after_bindright.md b/help/after_bindright.md index 653b5f55..e8cb2bcb 100644 --- a/help/after_bindright.md +++ b/help/after_bindright.md @@ -20,7 +20,7 @@ Supply `π•˜` as a right argument to `𝔽` (`𝕩 𝔽 π•˜`). Apply `𝔾` to `𝕩`, and supply it as a right argument to `𝔽` (`𝕩 𝔽 (𝔾 𝕩)`). -## `𝔽` must be dyadic, `𝔾` must be monadic. +`𝔽` must be dyadic, `𝔾` must be monadic. Γ—βŸœ- 9 @@ -34,7 +34,7 @@ Apply `𝔾` to `𝕩`, and supply it as a right argument to `𝔽` (`𝕩 𝔽 Apply `𝔾` to `𝕩`, and supply it as a right argument to `𝔽` (`𝕨 𝔽 (𝔾 𝕩)`). -## `𝔽` must be dyadic, `𝔾` must be monadic. +`𝔽` must be dyadic, `𝔾` must be monadic. 2 Γ—βŸœ- 1 diff --git a/help/atop.md b/help/atop.md index 98073c0f..525c4800 100644 --- a/help/atop.md +++ b/help/atop.md @@ -6,7 +6,7 @@ Apply `𝔾` to `𝕩`, then apply `𝔽` (`𝔽 𝔾 𝕩`). -## `𝔽` and `𝔾` must be monadic. +`𝔽` and `𝔾` must be monadic. -∘- 5 @@ -18,7 +18,7 @@ Apply `𝔾` to `𝕩`, then apply `𝔽` (`𝔽 𝔾 𝕩`). Apply `𝔾` to `𝕨` and `𝕩`, then apply `𝔽` (`𝔽 (𝕨 𝔾 𝕩)`). -## `𝔽` must be monadic, and `𝔾` must be dyadic. +#`𝔽` must be monadic, and `𝔾` must be dyadic. 1 -∘+ 2 diff --git a/help/before_bindleft.md b/help/before_bindleft.md index 2ebbf8e7..eeeb1fcf 100644 --- a/help/before_bindleft.md +++ b/help/before_bindleft.md @@ -18,7 +18,7 @@ Supply `𝕗` as a left argument to `𝔾` (`𝕗 𝔾 𝕩`). Apply `𝔽` to `𝕩`, and supply it as a left argument to `𝔾` (`(𝔽 𝕩) 𝔾 𝕩`). -## `𝔽` must be monadic, `𝔾` must be dyadic. +`𝔽` must be monadic, `𝔾` must be dyadic. -⊸+ 9 @@ -32,7 +32,7 @@ Apply `𝔽` to `𝕩`, and supply it as a left argument to `𝔾` (`(𝔽 𝕩) Apply `𝔽` to `𝕨`, and supply it as a left argument to `𝔾` (`(𝔽 𝕨) 𝔾 𝕩`). -## `𝔽` must be monadic, `𝔾` must be dyadic. +`𝔽` must be monadic, `𝔾` must be dyadic. 2 -⊸+ 1 diff --git a/help/conjugate_add.md b/help/conjugate_add.md index 0ed0c332..5ac05396 100644 --- a/help/conjugate_add.md +++ b/help/conjugate_add.md @@ -11,7 +11,7 @@ ## `𝕨 + 𝕩`: Add -## `𝕨` added to `𝕩`. Either `𝕨` or `𝕩` can be a character, and if so, the other has to be an integer. +`𝕨` added to `𝕩`. Either `𝕨` or `𝕩` can be a character, and if so, the other has to be an integer. [Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) diff --git a/help/enclose_less.md b/help/enclose_less.md index 0417b703..1f743fd9 100644 --- a/help/enclose_less.md +++ b/help/enclose_less.md @@ -16,7 +16,7 @@ Create a unit array containing `𝕩`. (`(≒𝕩) ≑ ⟨⟩`) ## `𝕨 < 𝕩`: Lesser Than -## `𝕨` and `𝕩` can both be either numbers or characters. +`𝕨` and `𝕩` can both be either numbers or characters. [Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) diff --git a/help/exponential_power.md b/help/exponential_power.md index c253f2b3..891dba08 100644 --- a/help/exponential_power.md +++ b/help/exponential_power.md @@ -4,7 +4,7 @@ ## `⋆ 𝕩`: Exponential -## `e` (Euler's constant) to the power of `𝕩`. +`e` (Euler's constant) to the power of `𝕩`. [Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) @@ -14,7 +14,7 @@ ## `𝕨 ⋆ 𝕩`: Power -## `𝕨` to the power of `𝕩`. +`𝕨` to the power of `𝕩`. [Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) diff --git a/help/gradedown_binsdown.md b/help/gradedown_binsdown.md index 8568293d..f3906c00 100644 --- a/help/gradedown_binsdown.md +++ b/help/gradedown_binsdown.md @@ -18,7 +18,7 @@ Indices of `𝕩` that would sort its major cells in descending order. Binary search for each element of `𝕩` in `𝕨`, and return the index found, if any. -## `𝕨` must be sorted in descending order. +`𝕨` must be sorted in descending order. [Right Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) diff --git a/help/gradeup_binsup.md b/help/gradeup_binsup.md index 1ddd891a..7a73116d 100644 --- a/help/gradeup_binsup.md +++ b/help/gradeup_binsup.md @@ -19,7 +19,7 @@ Indices of `𝕩` that would sort its major cells in ascending order. Binary search for each element of `𝕩` in `𝕨`, and return the index found, if any. -## `𝕨` must be sorted in ascending order. +`𝕨` must be sorted in ascending order. 3β€Ώ4β€Ώ5β€Ώ7 ⍋ 2 diff --git a/help/greatequal.md b/help/greatequal.md index f1b8b4f8..1772cbaf 100644 --- a/help/greatequal.md +++ b/help/greatequal.md @@ -4,7 +4,7 @@ ## `𝕨 β‰₯ 𝕩`: Greater Than or Equal To -## `𝕨` and `𝕩` can both be either numbers or characters. +`𝕨` and `𝕩` can both be either numbers or characters. [Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) diff --git a/help/lessequal.md b/help/lessequal.md index 4d77dbfc..8fc0000b 100644 --- a/help/lessequal.md +++ b/help/lessequal.md @@ -4,7 +4,7 @@ ## `𝕨 ≀ 𝕩`: Lesser Than or Equal To -## `𝕨` and `𝕩` can both be either numbers or characters. +`𝕨` and `𝕩` can both be either numbers or characters. [Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) diff --git a/help/over.md b/help/over.md index d6086037..38795145 100644 --- a/help/over.md +++ b/help/over.md @@ -6,7 +6,7 @@ Apply `𝔾` to `𝕩`, then apply `𝔽` (`𝔽 𝔾 𝕩`). -## `𝔽` and `𝔾` must be monadic. +`𝔽` and `𝔾` must be monadic. -β—‹- 5 @@ -18,7 +18,7 @@ Apply `𝔾` to `𝕩`, then apply `𝔽` (`𝔽 𝔾 𝕩`). Apply `𝔾` to `𝕨` and `𝕩`, then apply `𝔽` to them (`(𝔾 𝕨) 𝔽 (𝔾 𝕩)`). -## `𝔽` must be dyadic, `𝔾` must be monadic. +`𝔽` must be dyadic, `𝔾` must be monadic. 1 +β—‹- 2 diff --git a/help/reciprocal_divide.md b/help/reciprocal_divide.md index d0630205..c7d8374c 100644 --- a/help/reciprocal_divide.md +++ b/help/reciprocal_divide.md @@ -14,7 +14,7 @@ Gives `1 Γ· 𝕩`. ## `𝕨 Γ· 𝕩`: Divide -## `𝕨` divided by `𝕩`. +`𝕨` divided by `𝕩`. [Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) diff --git a/help/sign_multiply.md b/help/sign_multiply.md index 53a87654..3b8fa8de 100644 --- a/help/sign_multiply.md +++ b/help/sign_multiply.md @@ -17,7 +17,7 @@ Sign of `𝕩`. ## `𝕨 Γ— 𝕩`: Multiply -## `𝕨` multiplied by `𝕩`. +`𝕨` multiplied by `𝕩`. [Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) diff --git a/help/squareroot_root.md b/help/squareroot_root.md index 02e4f74d..c97c92c5 100644 --- a/help/squareroot_root.md +++ b/help/squareroot_root.md @@ -12,7 +12,7 @@ ## `𝕨 √ 𝕩`: Root -## `𝕨`th root of `𝕩`. +`𝕨`th root of `𝕩`. [Pervasive.](https://mlochbaum.github.io/BQN/doc/arithmetic.html#pervasion) -- cgit v1.2.3