Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,22 @@
(de numToString (N Base)
(default Base 10)
(let L NIL
(loop
(let C (% N Base)
(and (> C 9) (inc 'C 39))
(push 'L (char (+ C `(char "0")))) )
(T (=0 (setq N (/ N Base)))) )
(pack L) ) )
(de stringToNum (S Base)
(default Base 10)
(let N 0
(for C (chop S)
(when (> (setq C (- (char C) `(char "0"))) 9)
(dec 'C 39) )
(setq N (+ C (* N Base))) )
N ) )
(prinl (numToString 26 16))
(prinl (stringToNum "1a" 16))
(prinl (numToString 123456789012345678901234567890 36))