June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
|
|
@ -2,18 +2,16 @@
|
|||
@.1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
||||
L=length(@.1)
|
||||
do j=2 to L; jm=j-1; q=@.jm
|
||||
@.j=substr(q, 2, L-1)left(q, 1)
|
||||
@.j=substr(q, 2, L - 1)left(q, 1)
|
||||
end /*j*/
|
||||
|
||||
cypher = space('WHOOP DE DOO NO BIG DEAL HERE OR THERE', 0)
|
||||
oMsg = 'People solve problems by trial and error; judgement helps pick the trial.'
|
||||
oMsgU = oMsg; upper oMsgU
|
||||
cypher_= copies(cypher, length(oMsg) % length(cypher) )
|
||||
say ' original text =' oMsg
|
||||
xMsg=Ncypher(oMsgU)
|
||||
say ' cyphered text =' xMsg
|
||||
bMsg=Dcypher(xMsg)
|
||||
say 're-cyphered text =' bMsg
|
||||
say ' original text =' oMsg
|
||||
xMsg= Ncypher(oMsgU); say ' cyphered text =' xMsg
|
||||
bMsg= Dcypher(xMsg) ; say 're-cyphered text =' bMsg
|
||||
exit
|
||||
/*──────────────────────────────────────────────────────────────────────────────────────*/
|
||||
Ncypher: parse arg x; nMsg=; #=1 /*unsupported char? ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/
|
||||
|
|
@ -23,7 +21,7 @@ Ncypher: parse arg x; nMsg=; #=1 /*unsupported char? ↓↓↓↓
|
|||
return nMsg
|
||||
/*──────────────────────────────────────────────────────────────────────────────────────*/
|
||||
Dcypher: parse arg x; dMsg=
|
||||
do i=1 for length(x); j=pos(substr(cypher_, i, 1), @.1)
|
||||
dMsg=dMsg || substr(@.1, pos( substr(x, i, 1), @.j), 1)
|
||||
do i=1 for length(x); j=pos(substr(cypher_, i, 1), @.1)
|
||||
dMsg=dMsg || substr(@.1, pos( substr(x, i, 1), @.j), 1 )
|
||||
end /*j*/
|
||||
return dMsg
|
||||
|
|
|
|||
|
|
@ -2,28 +2,26 @@
|
|||
@abc= 'abcdefghijklmnopqrstuvwxyz'; @abcU=@abc; upper @abcU
|
||||
@.1 = @abcU || @abc'0123456789~`!@#$%^&*()_-+={}|[]\:;<>?,./" '''
|
||||
L=length(@.1)
|
||||
do j=2 to length(@.1); jm=j-1; q=@.jm
|
||||
@.j=substr(q, 2, L-1)left(q, 1)
|
||||
do j=2 to length(@.1); jm=j - 1; q=@.jm
|
||||
@.j=substr(q, 2, L - 1)left(q, 1)
|
||||
end /*j*/
|
||||
|
||||
cypher = space('WHOOP DE DOO NO BIG DEAL HERE OR THERE', 0)
|
||||
oMsg = 'Making things easy is just knowing the shortcuts. --- Gerard J. Schildberger'
|
||||
cypher_= copies(cypher, length(oMsg) % length(cypher) )
|
||||
say ' original text =' oMsg
|
||||
xMsg=Ncypher(oMsg)
|
||||
say ' cyphered text =' xMsg
|
||||
bMsg=Dcypher(xMsg)
|
||||
say 're-cyphered text =' bMsg
|
||||
say ' original text =' oMsg
|
||||
xMsg= Ncypher(oMsg); say ' cyphered text =' xMsg
|
||||
bMsg= Dcypher(xMsg); say 're-cyphered text =' bMsg
|
||||
exit
|
||||
/*──────────────────────────────────────────────────────────────────────────────────────*/
|
||||
Ncypher: parse arg x; nMsg=; #=1 /*unsupported char? ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/
|
||||
do i=1 for length(x); j=pos(substr(x,i,1), @.1); if j==0 then iterate
|
||||
nMsg=nMsg || substr(@.j, pos( substr( cypher_, #, 1), @.1), 1); #=#+1
|
||||
nMsg=nMsg || substr(@.j, pos( substr( cypher_, #, 1), @.1), 1); #=# + 1
|
||||
end /*j*/
|
||||
return nMsg
|
||||
/*──────────────────────────────────────────────────────────────────────────────────────*/
|
||||
Dcypher: parse arg x; dMsg=
|
||||
do i=1 for length(x); j=pos(substr(cypher_, i, 1), @.1)
|
||||
dMsg=dMsg || substr(@.1, pos( substr(x, i, 1), @.j), 1)
|
||||
do i=1 for length(x); j=pos(substr(cypher_, i, 1), @.1)
|
||||
dMsg=dMsg || substr(@.1, pos( substr(x, i, 1), @.j), 1 )
|
||||
end /*j*/
|
||||
return dMsg
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue