Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -6,35 +6,35 @@ fun readfile () = readfile []
|
|||
readfile ` ln :: x
|
||||
end
|
||||
|
||||
local
|
||||
val lower_a = ord #"a";
|
||||
val lower_z = ord #"z";
|
||||
val upper_a = ord #"A";
|
||||
val upper_z = ord #"Z";
|
||||
local
|
||||
val lower_a = ord #"a";
|
||||
val lower_z = ord #"z";
|
||||
val upper_a = ord #"A";
|
||||
val upper_z = ord #"Z";
|
||||
|
||||
fun which
|
||||
(c_upper c) = (upper_a, upper_z)
|
||||
| _ = (lower_a, lower_z)
|
||||
;
|
||||
|
||||
fun scale
|
||||
(c, az) where (c > #1 az) = scale( (#0 az + (c - #1 az - 1)), az)
|
||||
| (c, az) = c
|
||||
|
||||
fun which
|
||||
(c_upper c) = (upper_a, upper_z)
|
||||
| _ = (lower_a, lower_z)
|
||||
;
|
||||
|
||||
fun scale
|
||||
(c, az) where (c > #1 az) = scale( (#0 az + (c - #1 az - 1)), az)
|
||||
| (c, az) = c
|
||||
|
||||
in
|
||||
fun encipher
|
||||
([], offset, t) = implode ` rev t
|
||||
| (x :: xs, offset, t) where (c_alphabetic x) = encipher (xs, offset, (chr ` scale (ord x + offset, which x)) :: t)
|
||||
| (x :: xs, offset, t) = encipher (xs, offset, x :: t)
|
||||
| (s, offset) = if (offset < 0) then
|
||||
encipher (explode s, 26 + (offset rem 26), [])
|
||||
else
|
||||
encipher (explode s, offset rem 26, [])
|
||||
fun encipher
|
||||
([], offset, t) = implode ` rev t
|
||||
| (x :: xs, offset, t) where (c_alphabetic x) = encipher (xs, offset, (chr ` scale (ord x + offset, which x)) :: t)
|
||||
| (x :: xs, offset, t) = encipher (xs, offset, x :: t)
|
||||
| (s, offset) = if (offset < 0) then
|
||||
encipher (explode s, 26 + (offset rem 26), [])
|
||||
else
|
||||
encipher (explode s, offset rem 26, [])
|
||||
end
|
||||
|
||||
fun default
|
||||
(false, y) = y
|
||||
| (x, _) = x
|
||||
(false, y) = y
|
||||
| (x, _) = x
|
||||
|
||||
;
|
||||
map println ` map (fn s = encipher (s,ston ` default (argv 0, "1"))) ` readfile ();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue