commit 0bce215

zzo38  ·  2025-06-15 18:32:30 +0000 UTC
parent 51ba4db
Add "diceware" program
2 files changed,  +48, -0
+17, -0
 1@@ -0,0 +1,17 @@
 2+% This program make the diceware.data file to use with diceware.tal
 3+/In (eff_large_wordlist.txt) (r) file def
 4+/Out (diceware.data) (w) file def
 5+/S 32 string def
 6+{
 7+  In S readline not {quit} if
 8+  S exch length (`````````) putinterval
 9+  [S 6 3 getinterval S 9 3 getinterval S 12 3 getinterval] {
10+    {
11+      dup 45 eq {pop 27} {96 sub} ifelse
12+    } forall
13+    5 bitshift add 5 bitshift add
14+    Out 1 index -8 bitshift write
15+    Out exch 255 and write
16+  } forall
17+} bind loop
18+
+31, -0
 1@@ -0,0 +1,31 @@
 2+|100
 3+  DUP2rk EOR2rk
 4+  ;input #10 DEO2
 5+  #17 DEI [?
 6+    [; [@ LDAk #18 NEQk JMP BRK DEO INC2 ]! ]@
 7+    "Type 20 "five 20 "numbers 20 "1-6 20 "and 20 "then 20 "enter 0a18
 8+  ]@ BRK
 9+
10+@input
11+  #cf12 DEI ADD
12+  #d9 EQUk ?enter
13+  SWP #06 LTHk JMP BRK
14+  SWP LITr 00 STH ADD2r
15+  LITr 00 STH MUL2r BRK
16+
17+@enter
18+  STH2r ;data ADD2
19+  show show show
20+  DUP2rk EOR2rk
21+  #0a18 DEO
22+  #0417 DEI EQU #0f DEO BRK
23+
24+@show
25+  LDA2k
26+  [@
27+    DUPk [? POP POP2 INC2 INC2 JMP2r ]@
28+    #1f AND #60 ADD DUP #7b EQU #4e MUL SUB #18 DEO
29+    #05 SFT2
30+  ]!
31+
32+@data \~diceware.data