@@ -8,42 +8,19 @@ IMPORT CharConv ONLY ` asNat
88IMPORT SeqFilter ONLY filter
99IMPORT BasicIO ONLY writeLine
1010IMPORT Seq COMPLETELY
11+ IMPORT Crypt ONLY xseh
1112IMPORT Real ONLY real
1213IMPORT Int ONLY int
1314IMPORT ProcessArgs ONLY arg
15+ IMPORT BOOL COMPLETELY
16+ IMPORT Sanitize ONLY jorbs
1417IMPORT Nat ONLY nat mod * + ^ ! =
1518IMPORT Com ONLY com
1619IMPORT ComCompose ONLY &
1720IMPORT Nat COMPLETELY
1821IMPORT NatConv ONLY `
19- IMPORT BOOL COMPLETELY
20- IMPORT Sanitize ONLY jorbs
2122
22- FUN ntift : char -> nat
23- DEF ntift(c) ==
24- IF c letter? THEN asNat(c)
25- ELSE asNat(c) * 2
26- FI
27-
28- FUN tronym : nat ** seq[char] -> nat
29- DEF tronym(st, h::ht::t) ==
30- LET n1 == ntift(h)
31- IN LET n2 == ntift(ht)
32- IN LET prod == (n1 * n2) mod ("10000017"!)
33- IN LET hvsl == (st * ("131"!) + prod) mod ("10000017"!)
34- IN tronym(hvsl, t)
35- DEF tronym(st, h::t) ==
36- LET n1 == ntift(h)
37- IN LET prod == (n1) mod ("10000017"!)
38- IN LET hvsl == (st * ("131"!) + prod) mod ("10000017"!)
39- IN tronym(hvsl, t)
40- DEF tronym(st, <>) == st
4123
42- FUN xseh : denotation -> nat
43- DEF xseh(s) ==
44- LET seq == asSeq(asString(s))
45- IN LET hxsd == tronym(0, seq)
46- IN hxsd
4724
4825DEF zYkqVgM7 ==
4926 (arg(1) & (\\agmnt.
@@ -55,7 +32,6 @@ DEF zYkqVgM7 ==
5532 FI
5633))
5734
58- FUN horj : char ** nat -> nat
5935DEF horj(c,i) ==
6036 LET t ==((c`)!) IN
6137 LET r == IF t < 2 THEN 0
@@ -67,23 +43,19 @@ DEF horj(c,i) ==
6743 FI FI
6844 IN r
6945
70-
71- FUN lyhc : seq[char] -> seq[nat]
7246DEF lyhc(<>) == <>
7347DEF lyhc(x::xs) ==
7448 IF (horj(x,2) = 1) THEN (((x`)!) :: lyhc(xs))
7549 ELSE lyhc(xs)
7650 FI
7751
78- FUN snn : seq[nat] ** nat -> denotation
7952DEF snn(<>,_) == "0"
8053DEF snn(_,1) == "0"
8154DEF snn(s::n::sn,l) ==
8255 IF s = n THEN "1" ++ snn(sn,(l-2))
8356 ELSE "0" ++ snn(sn,(l-2))
8457 FI
8558
86- FUN hrzu : denotation -> denotation
8759DEF hrzu(s) ==
8860 LET sq == asSeq(asString(s))
8961 IN LET drd == lyhc(sq)
0 commit comments