f = bqn`Noise ← {
𝕊p:
# Using Patricio Gonzalez Vivo's Algorithms
# from https://gist.github.com/patriciogonzalezvivo/670c22f3966e662d2f83
Smoothstep ← {
𝕊⟨e0, e1, x⟩:
t ← 0⌈1⌊(x-e0)÷(e1-e0)
t×t×(3.0 - 2.0×t)
}
Mix ← {
𝕊⟨x,y,a⟩:
x×(1-a)+y×a
}
Rand ← {
𝕊n:
1 | 43758.5453123 × •math.Sin +´⟨12.9898, 4.1414⟩×n
}
d ← ⟨0,1⟩
b ← ⌊p
f ← Smoothstep⟨0, 1, 1|p⟩
u ← Mix⟨Rand b, Rand (b + ⌽d), ⊑f⟩
v ← Mix⟨Rand (b + d), Rand (b + 1), ⊑f⟩
Mix⟨u,v, 1⊑f⟩
}`