uCBQN/test/squeezeValid.bqn
2022-11-17 18:56:46 +02:00

34 lines
1.3 KiB
BQN
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# make f='-march=native -O3 -DEEQUAL_NEGZERO' singeli=1 c && ./BQN test/squeeze.bqn
EEqual, ListVariations, ClearRefs, Variation, Squeeze, Info •internal
u 100×(•UnixTime+1|100וMonoTime)@
# u ↩ 123
r •MakeRand •Show u
RandVals, vars, spec, specF64 r •Import "utils.bqn"
TestSq0 {a Squeeze 𝕨 Variation 𝕩 ! 1==a ! 0=a a}
{! 01𝕩 TestSq0 0}¨ 5vars
{! " "1𝕩 TestSq0 ""}¨ 5vars
{𝕩 TestSq0 }¨ ListVariations # {𝕩{•Out "Failed fill for "∾𝕨}⍟⊢ 8 ≠ 1↑⎊8 𝕩 TestSq0 ⟨⟩}¨ ListVariations ⟨⟩
specSpl 5()spec
allSpec specF64 (@+010321271282552563276732768655356553611141101114111) {}+
Do { 𝕊:
at r.Range 8
l 1 + r.Range (at=0)1000300
a l RandVals at
{! a EEqual Squeeze 𝕩 Variation a}¨ ListVariations a
F { 𝕊:
p {r.Range 2? r.Range l; (¯1+l-)(r.Range 2) r.Range (2r.Range 10)l}
b 𝕩˙(p) a
! b EEqual Squeeze b # won't be acceptable with in-place squeezing, but that doesn't exist yet
}
F¨ (at5)specSpl
F¨ allSpec
{𝕊: F¨ @+(at5) r.Range 2r.Range (at5)3320}¨ 10
ClearRefs@
}
Do40000 @