-
-
Notifications
You must be signed in to change notification settings - Fork 84
/
bqn.scroll
61 lines (54 loc) · 1.52 KB
/
bqn.scroll
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
56
57
58
59
60
61
import ../code/conceptPage.scroll
id bqn
name BQN
appeared 2020
creators Marshall Lochbaum
tags pl
website https://mlochbaum.github.io/BQN/
standsFor Big Questions Notation
conceptDescription An APL-like programming language. Self-hosted!
writtenIn html markdown vim-script javascript xml autohotkey css svg
influencedBy apl
documentation https://mlochbaum.github.io/BQN/doc/index.html
repoStats
firstCommit 2020
commits 2840
committers 38
files 539
newestCommit 2024
country United States
originCommunity https://github.com/mlochbaum/BQN/issues
example
#! /usr/bin/env bqn
# Case conversion utilities
case ← {
diff ← -´ "Aa"
Lower ⇐ -⟜diff
Upper ⇐ Lower⁼
}
hw ← <˘ 2‿∘ ⥊ "helloworld"
hw case.Upper⌾(⊑¨)↩
•Out hw ↩ ∾ ⥊⍉ [hw, ", "‿"!"] # Hello, World!
# Split at spaces and repeated characters
Split ← {
!1==𝕩 ⋄ (!2=•Type)¨𝕩
Proc ← {
· 𝕊 ' ': spl⇐1 ; # Space: break and delete it
prev Fn cur: ⟨spl,str⟩⇐
spl←0 ⋄ str←⟨cur⟩ # Include and don't break...
{ prev=cur ? spl+↩1 ; @ } # except at equal characters
}
GV‿GS ← {𝕏¨}¨ ⟨ {⟨s⇐str⟩:s;""}
{𝕩.spl} ⟩
r ← Proc{»𝔽¨⊢} 𝕩
(∾¨ GV ⊔˜ ·+`GS) r
}
•Show Split hw # ⟨ "Hel" "lo," "World!" ⟩
githubRepo https://github.com/mlochbaum/BQN
stars 587
forks 46
subscribers 21
created 2020
updated 2023
description An APL-like programming language. Self-hosted!
issues 1