aboutsummaryrefslogtreecommitdiff
path: root/docs/help/range_windows.html
blob: 7af5a5879b5eadcbe2b0bdc28163366b38e82336 (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
<head>
  <link href="../favicon.ico" rel="shortcut icon" type="image/x-icon"/>
  <link href="../style.css" rel="stylesheet"/>
  <title>BQN: Up Down 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-down-arrow-"><a class="header" href="#up-down-arrow-">Up Down Arrow (<code><span class='Function'></span></code>)</a></h1>
<h2 id="--range--"><a class="header" href="#--range--"><code><span class='Function'></span> <span class='Value'>𝕩</span></code>: Range</a></h2>
<p>Return all indices to index into an array of shape <code><span class='Value'>𝕩</span></code>, in the shape described by <code><span class='Value'>𝕩</span></code>.</p>
<p>When given a single number, range from 0 to <code><span class='Value'>𝕩</span><span class='Function'>-</span><span class='Number'>1</span></code>.</p>
<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=ICAg4oaVIDQKCiAgIOKGlSA04oC/NQ==">↗️</a><pre>       <span class='Function'></span> <span class='Number'>4</span>
⟨ 0 1 2 3 ⟩

       <span class='Function'></span> <span class='Number'>4</span><span class='Ligature'></span><span class='Number'>5</span>
┌─                                         
╵ ⟨ 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 ⟩  
                                          ┘
</pre>
<h2 id="---windows"><a class="header" href="#---windows"><code><span class='Value'>𝕨</span> <span class='Function'></span> <span class='Value'>𝕩</span></code>: Windows</a></h2>
<p>Overlapping slices of <code><span class='Value'>𝕩</span></code> which are of shape <code><span class='Value'>𝕨</span></code>.</p>
<a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=ICAgNSDihpUgImFiY2RlZmciCgogICBhIOKGkCAz4oC/M+KliuKGlTkKCiAgIDLigL8yIOKGlSBh">↗️</a><pre>       <span class='Number'>5</span> <span class='Function'></span> <span class='String'>&quot;abcdefg&quot;</span>
┌─       
╵"abcde  
  bcdef  
  cdefg" 
        ┘

       <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='Number'>9</span>

       <span class='Number'>2</span><span class='Ligature'></span><span class='Number'>2</span> <span class='Function'></span> <span class='Value'>a</span>
┌─     
┆ 0 1  
  3 4  
       
  1 2  
  4 5  
       
       
  3 4  
  6 7  
       
  4 5  
  7 8  
      ┘
</pre>