Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,41 @@
decode(list l)
{
integer c, e;
data al, s;
al = "abcdefghijklmnopqrstuvwxyz";
for (, e in l) {
s.append(c = al[e]);
al.delete(e).insert(0, c);
}
s;
}
encode(data s)
{
integer c, e;
data al;
list l;
al = "abcdefghijklmnopqrstuvwxyz";
for (, c in s) {
l.append(e = al.place(c));
al.delete(e).insert(0, c);
}
l;
}
main(void)
{
for (, text s in list("broood", "bananaaa", "hiphophiphop")) {
list l;
l = encode(s);
l.ucall(o_, 1, " ");
o_(": ", decode(l), "\n");
}
0;
}