fork download
  1. #!/usr/bin/perl
  2. # Author: gendou
  3. # Usage: elementcode.pl
  4. # Version: 1.0.0
  5. # Note: This cipher is based on the periodic table of elements.
  6.  
  7. my %ENCODE = (
  8. 'a' => 13, # Aluminum
  9. 'b' => 5, # Phosphorus
  10. 'c' => 6, # Carbon
  11. 'd' => 66, # Dysprosium
  12. 'e' => 63, # Europium
  13. 'f' => 9, # Fluorine
  14. 'g' => 31, # Gallium
  15. 'h' => 1, # Hydrogen
  16. 'i' => 53, # Iodine
  17. 'j' => 0, # [None]
  18. 'k' => 19, # Potassium
  19. 'l' => 3, # Lithium
  20. 'm' => 12, # Magnesium
  21. 'n' => 7, # Nitrogen
  22. 'o' => 8, # Oxygen
  23. 'p' => 15, # Phosphorus
  24. 'q' => 114, # Ununquadium
  25. 'r' => 37, # Rubidium
  26. 's' => 16, # Sulfur
  27. 't' => 22, # Titanium
  28. 'u' => 92, # Uranium
  29. 'v' => 23, # Vanadium
  30. 'w' => 74, # Tungsten
  31. 'x' => 54, # Xenon
  32. 'y' => 39, # Yttrium
  33. 'z' => 30, # Zinc
  34. '1' => 31, # Zinc
  35. '2' => 30, # Zinc
  36. '3' => 30 # Zinc
  37. );
  38. my $tk;
  39. my $counter=1;
  40. my $x;
  41. print "keys count:".keys (%ENCODE)."\n";
  42. foreach my $id ( keys (%ENCODE)) {
  43. if($counter % 5 == 0){
  44. print "\n".$x.$id;
  45. $x='';
  46. }
  47. else{
  48. $x.=$id.',';
  49. }
  50. $tk.=$id.',';
  51. $counter++;
  52. }
  53. #Process the remainder
  54. print "\nRemainder: ";
  55. print substr($x, 0, length($x)-1);
  56.  
  57. print "\n".substr($tk,0,length($tk)-1);
  58.  
  59. my $str="XX y?1";
  60. $str=~s/\?/$x/g;
  61. print "\n".$str;
Success #stdin #stdout 0.01s 5444KB
stdin
Standard input is empty
stdout
keys count:29

q,h,w,f,x
n,1,b,r,m
o,a,u,z,v
s,j,k,2,3
p,g,c,t,l
Remainder: i,e,y,d
q,h,w,f,x,n,1,b,r,m,o,a,u,z,v,s,j,k,2,3,p,g,c,t,l,i,e,y,d
XX yi,e,y,d,1