Guest User

Code Golf Numbers in Hassium

a guest
Sep 16th, 2015
160
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. func main() {
  2. s = input();
  3. c = "";
  4. for (x = 0; x < s.length; x++){
  5. c = s[Convert.toNumber(Convert.toString(x))].toString();
  6. if (c.toLower() != c)
  7. print(r(c.toLower()) * -1);
  8. else if (r(c) == "")
  9. continue;
  10. else
  11. print(r(c));
  12. print(" ");
  13. }
  14. }
  15.  
  16. func r(c) {
  17. if (c == "a")
  18. return 1;
  19. else if (c == "b")
  20. return 2;
  21. else if (c == "c")
  22. return 3;
  23. else if (c == "d")
  24. return 4;
  25. else if (c == "e")
  26. return 5;
  27. else if (c == "f")
  28. return 6;
  29. else if (c == "g")
  30. return 7;
  31. else if (c == "h")
  32. return 8;
  33. else if (c == "i")
  34. return 9;
  35. else if (c == "j")
  36. return 10;
  37. else if (c == "k")
  38. return 11;
  39. else if (c == "l")
  40. return 12;
  41. else if (c == "m")
  42. return 13;
  43. else if (c == "n")
  44. return 14;
  45. else if (c == "o")
  46. return 15;
  47. else if (c == "p")
  48. return 16;
  49. else if (c == "q")
  50. return 17;
  51. else if (c == "r")
  52. return 18;
  53. else if (c == "s")
  54. return 19;
  55. else if (c == "t")
  56. return 20;
  57. else if (c == "u")
  58. return 21;
  59. else if (c == "v")
  60. return 22;
  61. else if (c == "w")
  62. return 23;
  63. else if (c == "x")
  64. return 24;
  65. else if (c == "y")
  66. return 25;
  67. else if (c == "z")
  68. return 26;
  69. else if (c == " ")
  70. return 0;
  71. else if (c == "1")
  72. return "a";
  73. else if (c == "2")
  74. return "b";
  75. else if (c == "3")
  76. return "c";
  77. else if (c == "4")
  78. return "d";
  79. else if (c == "5")
  80. return "e";
  81. else if (c == "6")
  82. return "f";
  83. else if (c == "7")
  84. return "g";
  85. else if (c == "8")
  86. return "h";
  87. else if (c == "9")
  88. return "i";
  89. else if (c == "0")
  90. return "j";
  91. else
  92. return "";
  93. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×