home *** CD-ROM | disk | FTP | other *** search
/ PC User 2001 August / APC_Aug2001_CD2.iso / features / web_dev / files / jext-install.exe / {app} / bin / scripts / Rot13.jext-script < prev    next >
Encoding:
Text File  |  2001-06-19  |  565 b   |  29 lines

  1. ########################
  2. # Rot13 cipher program #
  3. ########################
  4. getText dup
  5. "" res ->
  6. "" char ->
  7.  
  8. size 0 swap I for
  9.   dup I rcl dup 1 + sub
  10.   num char ->
  11.  
  12.   if char rcl 32 == then
  13.     res rcl " " concat res ->
  14.   else
  15.     if "a" num char rcl <= "z" num char rcl >= and then
  16.       res rcl "a" num dup char rcl swap - 13 + 26 % + chr concat res ->
  17.     else
  18.       if "A" num char rcl <= "Z" num char rcl >= and then
  19.         res rcl "A" num dup char rcl swap - 13 + 26 % + chr concat res ->
  20.       end
  21.     end
  22.   end
  23. next
  24.  
  25. drop
  26. res rcl setText
  27.  
  28. # End of script
  29.