aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdc.bqn14
1 files changed, 7 insertions, 7 deletions
diff --git a/dc.bqn b/dc.bqn
index c1011c3e..fb3aa8fe 100755
--- a/dc.bqn
+++ b/dc.bqn
@@ -1,8 +1,5 @@
⍝ Run with spec/dzref
-Base←{+⟜(𝕨⊸×)´⌽𝕩}
-Enc2←{𝕨⥊2(|∾˜(𝕨-1)Enc2⌊∘÷˜)⍟(0<𝕨)𝕩}
-
nl‿tab←•UCS 10‿9
charSet←∾charGroups←⟨
chF←"+-×÷⋆√⌊⌈|¬∧∨<>≠=≤≥≡≢⊣⊢⥊∾≍↑↓↕⌽⍉/⍋⍒⊏⊑⊐⊒∊⍷⊔" ⍝ Function
@@ -52,13 +49,16 @@ Parse←{
sel⊸⊏¨𝕩‿na
}
-Hex←16 Base (•d∾"ABCDEF")⊸⊐
+Base←{+⟜(𝕨⊸×)´𝕩}
+Enc2←{2|⌊∘÷⟜2⍟(↕𝕨)𝕩}
+
+Hex←16 Base⟜⌽ (•d∾"ABCDEF")⊸⊐
-ReadNum←10 Base bD⊸⊐
+ReadNum←10 Base⟜⌽ bD⊸⊐
GenF64←{
0:8⥊0;
l←2(⌊⋆⁼)𝕩
- (Hex"44")∾2 Base˘⌽8‿8(⊣⥊×´⊸↑)∾⟨⥊0,11 Enc2 1023+l,(0⌈l)Enc2𝕩⟩
+ (Hex"44")∾2 Base˘8‿8⥊∾⟨¯52↑(0⌈l)Enc2𝕩,11 Enc2 1023+l,⥊0⟩
}
MakeTab←{{⊑∘(∾⟜0)¨¯1↓(chF⊐𝕨)⊔○(∾⟜(≠chF))𝕩}○∾⟜(⥊¨∘⥊¨)´<˘⍉(2(÷˜∾⊣)≢)⊸⥊𝕩}
tab1←MakeTab⟨
@@ -92,7 +92,7 @@ GenFn←{
}
Gen←{
- LEB←{0:⥊0;(0∾˜128⥊˜1-˜≠)⊸+ 2 Base<˘ ⌽⍉ (⌽·∨`·⌽∨´˘)⊸/ 10‿7(⊣⥊×´⊸↑) ⌽64 Enc2 𝕩}
+ LEB←{0:⥊0;128⊸+⌾(¯1⊸↓) 2 Base˘ (⌽·∨`·⌽∨´˘)⊸/ 10‿7(⊣⥊×´⊸↑) 64 Enc2 𝕩}
C←LEB∘≠⊸∾
S←∾⟜C
V←≠∾∾