blob: 6af8e8ad17c760d6988d6908c8794aaa89825e8b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
<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=4oaRIDHigL8y4oC/M+KAvzQKCmEg4oaQIDPigL8zIOKliiDihpU5CgrihpEgYQ==">โ๏ธ</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=MyDihpEgMeKAvzPigL814oC/NjcKCmIg4oaQIDTigL80IOKliiDihpUxNgoKM+KAvzMg4oaRIGIKCjXigL81IOKGkSBiCgoz4oC/wq8zIOKGkSBi">โ๏ธ</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'>b</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='Number'>3</span><span class='Ligature'>โฟ</span><span class='Number'>3</span> <span class='Function'>โ</span> <span class='Value'>b</span>
โโ
โต 0 1 2
4 5 6
8 9 10
โ
<span class='Number'>5</span><span class='Ligature'>โฟ</span><span class='Number'>5</span> <span class='Function'>โ</span> <span class='Value'>b</span>
โโ
โต 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
โ
<span class='Number'>3</span><span class='Ligature'>โฟ</span><span class='Number'>ยฏ3</span> <span class='Function'>โ</span> <span class='Value'>b</span>
โโ
โต 1 2 3
5 6 7
9 10 11
โ
</pre>
|