aboutsummaryrefslogtreecommitdiff
path: root/help/⎉rank.md
blob: 153f183937b8bd8aab6d201cb1819336e11f084d (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
*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" 
           ┘