diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2022-01-19 15:10:38 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-19 15:10:38 -0500 |
| commit | ce364aeae795ca8a8e46e653b8024ac5a9ad0982 (patch) | |
| tree | 7af238dbdb370a768f965066dadadd144cbd70f7 /help | |
| parent | 8f0aa14fa695ff3aa3b3ed96c02fdb2ab99f272c (diff) | |
| parent | edddb9be0aa1f03c8608d3dabf7ccfea3fdde206 (diff) | |
Merge pull request #55 from razetime/master
Simple help pages for Primitive Symbols
Diffstat (limited to 'help')
63 files changed, 1631 insertions, 0 deletions
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..e8cb2bcb --- /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..525c4800 --- /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..eeeb1fcf --- /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..5ac05396 --- /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..1f743fd9 --- /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..891dba08 --- /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..f3906c00 --- /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..7a73116d --- /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..1772cbaf --- /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..8fc0000b --- /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..38795145 --- /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..c7d8374c --- /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..3b8fa8de --- /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/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..c97c92c5 --- /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/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 + + |
