Guest User

Cards script

a guest
Apr 19th, 2014
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.08 KB | None | 0 0
  1. local function draw()
  2. local function getCard()
  3. rm = math.random(1, 54)
  4. if rm == 1 then
  5. print("You have drawn the ace of spades")
  6. elseif rm == 2 then
  7. print("You have drawn the 2 of spades")
  8. elseif rm == 3 then
  9. print("You have drawn the 3 of spades")
  10. elseif rm == 4 then
  11. print("You have drawn the 4 of spades")
  12. elseif rm == 5 then
  13. print("You have drawn the 5 of spades")
  14. elseif rm == 6 then
  15. print("You have drawn the 6 of spades")
  16. elseif rm == 7 then
  17. print("You have drawn the 7 of spades")
  18. elseif rm == 8 then
  19. print("You have drawn the 8 of spades")
  20. elseif rm == 9 then
  21. print("You have drawn the 9 of spades")
  22. elseif rm == 10 then
  23. print("You have drawn the 10 of spades")
  24. elseif rm == 11 then
  25. print("You have drawn the jack of spades")
  26. elseif rm == 12 then
  27. print("You have drawn the queen of spades")
  28. elseif rm == 13 then
  29. print("You have drawn the king of spades")
  30. elseif rm == 14 then
  31. print("You have drawn the ace of clubs")
  32. elseif rm == 15 then
  33. print("You have drawn the 2 of clubs")
  34. elseif rm == 16 then
  35. print("You have drawn the 3 of clubs")
  36. elseif rm == 17 then
  37. print("You have drawn the 4 of clubs")
  38. elseif rm == 18 then
  39. print("You have drawn the 5 of clubs")
  40. elseif rm == 19 then
  41. print("You have drawn the 6 of clubs")
  42. elseif rm == 20 then
  43. print("You have drawn the 7 of clubs")
  44. elseif rm == 21 then
  45. print("You have drawn the 8 of clubs")
  46. elseif rm == 22 then
  47. print("You have drawn the 9 of clubs")
  48. elseif rm == 23 then
  49. print("You have drawn the 10 of clubs")
  50. elseif rm == 24 then
  51. print("You have drawn the jack of clubs")
  52. elseif rm == 25 then
  53. print("You have drawn the queen of clubs")
  54. elseif rm == 26 then
  55. print("You have drawn the king of clubs")
  56. elseif rm == 27 then
  57. print("You have drawn the ace of hearts")
  58. elseif rm == 28 then
  59. print("You have drawn the 2 of hearts")
  60. elseif rm == 29 then
  61. print("You have drawn the 3 of hearts")
  62. elseif rm == 30 then
  63. print("You have drawn the 4 of hearts")
  64. elseif rm == 31 then
  65. print("You have drawn the 5 of hearts")
  66. elseif rm == 32 then
  67. print("You have drawn the 6 of hearts")
  68. elseif rm == 33 then
  69. print("You have drawn the 7 of hearts")
  70. elseif rm == 34 then
  71. print("You have drawn the 8 of hearts")
  72. elseif rm == 35 then
  73. print("You have drawn the 9 of hearts")
  74. elseif rm == 36 then
  75. print("You have drawn the 10 of hearts")
  76. elseif rm == 37 then
  77. print("You have drawn the jack of hearts")
  78. elseif rm == 38 then
  79. print("You have drawn the queen of hearts")
  80. elseif rm == 39 then
  81. print("You have drawn the king of hearts")
  82. elseif rm == 40 then
  83. print("You have drawn the ace of diamonds")
  84. elseif rm == 41 then
  85. print("You have drawn the 2 of diamonds")
  86. elseif rm == 42 then
  87. print("You have drawn the 3 of diamonds")
  88. elseif rm == 43 then
  89. print("You have drawn the 4 of diamonds")
  90. elseif rm == 44 then
  91. print("You have drawn the 5 of diamonds")
  92. elseif rm == 45 then
  93. print("You have drawn the 6 of diamonds")
  94. elseif rm == 46 then
  95. print("You have drawn the 7 of diamonds")
  96. elseif rm == 47 then
  97. print("You have drawn the 8 of diamonds")
  98. elseif rm == 48 then
  99. print("You have drawn the 9 of diamonds")
  100. elseif rm == 49 then
  101. print("You have drawn the 10 of diamonds")
  102. elseif rm == 50 then
  103. print("You have drawn the jack of diamonds")
  104. elseif rm == 51 then
  105. print("You have drawn the queen of diamonds")
  106. elseif rm == 52 then
  107. print("You have drawn the king of diamonds")
  108. else
  109. print("You have drawn a joker!")
  110. end
  111. end
  112.  
  113. for i = 0, 5 do --this just draws x amount of cards.
  114. getCard()
  115. end
  116. end
  117.  
  118. term.clear()
  119. term.setCursorPos(1, 1)
  120. input = read()
  121. draw() --this actually draws the cards
Advertisement
Add Comment
Please, Sign In to add comment