aboutsummaryrefslogtreecommitdiff
path: root/docs/help/prefixes_take.html
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2022-01-19 15:10:38 -0500
committerGitHub <noreply@github.com>2022-01-19 15:10:38 -0500
commitce364aeae795ca8a8e46e653b8024ac5a9ad0982 (patch)
tree7af238dbdb370a768f965066dadadd144cbd70f7 /docs/help/prefixes_take.html
parent8f0aa14fa695ff3aa3b3ed96c02fdb2ab99f272c (diff)
parentedddb9be0aa1f03c8608d3dabf7ccfea3fdde206 (diff)
Merge pull request #55 from razetime/master
Simple help pages for Primitive Symbols
Diffstat (limited to 'docs/help/prefixes_take.html')
-rw-r--r--docs/help/prefixes_take.html56
1 files changed, 56 insertions, 0 deletions
diff --git a/docs/help/prefixes_take.html b/docs/help/prefixes_take.html
new file mode 100644
index 00000000..61d27740
--- /dev/null
+++ b/docs/help/prefixes_take.html
@@ -0,0 +1,56 @@
+<head>
+ <link href="../favicon.ico" rel="shortcut icon" type="image/x-icon"/>
+ <link href="../style.css" rel="stylesheet"/>
+ <title>BQN: Up Arrow (`โ†‘`)</title>
+</head>
+<div class="nav">(<a href="https://github.com/mlochbaum/BQN">github</a>) / <a href="../index.html">BQN</a> / <a href="index.html">help</a></div>
+<h1 id="up-arrow-"><a class="header" href="#up-arrow-">Up Arrow (<code><span class='Function'>โ†‘</span></code>)</a></h1>
+<h2 id="--prefixes"><a class="header" href="#--prefixes"><code><span class='Function'>โ†‘</span> <span class='Value'>๐•ฉ</span></code>: Prefixes</a></h2>
+<p>Prefixes of array <code><span class='Value'>๐•ฉ</span></code> along its first axis.</p>
+<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=ICAg4oaRIDHigL8y4oC/M+KAvzQKCiAgIGEg4oaQIDPigL8zIOKliiDihpU5CgogICDihpEgYQ==">โ†—๏ธ</a><pre> <span class='Function'>โ†‘</span> <span class='Number'>1</span><span class='Ligature'>โ€ฟ</span><span class='Number'>2</span><span class='Ligature'>โ€ฟ</span><span class='Number'>3</span><span class='Ligature'>โ€ฟ</span><span class='Number'>4</span>
+โŸจ โŸจโŸฉ โŸจ 1 โŸฉ โŸจ 1 2 โŸฉ โŸจ 1 2 3 โŸฉ โŸจ 1 2 3 4 โŸฉ โŸฉ
+
+ <span class='Value'>a</span> <span class='Gets'>โ†</span> <span class='Number'>3</span><span class='Ligature'>โ€ฟ</span><span class='Number'>3</span> <span class='Function'>โฅŠ</span> <span class='Function'>โ†•</span><span class='Number'>9</span>
+
+ <span class='Function'>โ†‘</span> <span class='Value'>a</span>
+โ”Œโ”€
+ยท โ†•0โ€ฟ3 โ”Œโ”€ โ”Œโ”€ โ”Œโ”€
+ โ•ต 0 1 2 โ•ต 0 1 2 โ•ต 0 1 2
+ โ”˜ 3 4 5 3 4 5
+ โ”˜ 6 7 8
+ โ”˜
+ โ”˜
+</pre>
+<h2 id="---take"><a class="header" href="#---take"><code><span class='Value'>๐•จ</span> <span class='Function'>โ†‘</span> <span class='Value'>๐•ฉ</span></code>: Take</a></h2>
+<p>For each integer in <code><span class='Value'>๐•จ</span></code>, take that many elements from each dimension of <code><span class='Value'>๐•ฉ</span></code>.</p>
+<p>Negative numbers take from the end.</p>
+<p>If any of the elements in <code><span class='Value'>๐•จ</span></code> are greater than the length of their respective dimension, the dimension is extended with a fill value.</p>
+<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=ICAzIOKGkSAx4oC/M+KAvzXigL82NwoKICBhIOKGkCA04oC/NCDipYog4oaVMTYKCiAgM+KAvzMg4oaRIGEKCiAgNeKAvzUg4oaRIGEKCiAgM+KAv8KvMyDihpEgYQ==">โ†—๏ธ</a><pre> <span class='Number'>3</span> <span class='Function'>โ†‘</span> <span class='Number'>1</span><span class='Ligature'>โ€ฟ</span><span class='Number'>3</span><span class='Ligature'>โ€ฟ</span><span class='Number'>5</span><span class='Ligature'>โ€ฟ</span><span class='Number'>67</span>
+โŸจ 1 3 5 โŸฉ
+
+ <span class='Value'>a</span> <span class='Gets'>โ†</span> <span class='Number'>4</span><span class='Ligature'>โ€ฟ</span><span class='Number'>4</span> <span class='Function'>โฅŠ</span> <span class='Function'>โ†•</span><span class='Number'>16</span>
+<span class='Error'>Error: Redefinition</span>
+
+ <span class='Number'>3</span><span class='Ligature'>โ€ฟ</span><span class='Number'>3</span> <span class='Function'>โ†‘</span> <span class='Value'>a</span>
+โ”Œโ”€
+โ•ต 0 1 2
+ 3 4 5
+ 6 7 8
+ โ”˜
+
+ <span class='Number'>5</span><span class='Ligature'>โ€ฟ</span><span class='Number'>5</span> <span class='Function'>โ†‘</span> <span class='Value'>a</span>
+โ”Œโ”€
+โ•ต 0 1 2 0 0
+ 3 4 5 0 0
+ 6 7 8 0 0
+ 0 0 0 0 0
+ 0 0 0 0 0
+ โ”˜
+
+ <span class='Number'>3</span><span class='Ligature'>โ€ฟ</span><span class='Number'>ยฏ3</span> <span class='Function'>โ†‘</span> <span class='Value'>a</span>
+โ”Œโ”€
+โ•ต 0 1 2
+ 3 4 5
+ 6 7 8
+ โ”˜
+</pre>