Advertisement
DirkEdge

RPS^2 Version3 Clean

Mar 25th, 2014
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 7.99 KB | None | 0 0
  1. count = 0
  2. win = 0
  3. tie = 0
  4. lose = 0
  5.  
  6. com_output_list = [
  7.     ["0,0 com Invalid Set!"],
  8.     ["1,0 com Invalid set!", "Com mixed Rock and Fire to make FireStone!", "Com mixed Rock and Water to make Water Stone!", "Com mixed Rock and Grass to make Mossy Stone!"],
  9.     ["2,0 com Invalid Set!", "Com mixed Paper and Fire to make Kindling!", "Com mixed Paper and Water to make Soaking Towel", "Com mixed Paper and Grass to make Oragami Rose"],
  10.     ["3,0 com Invalid Set!", "Com mixed Scissors and Fire to make Plasma Cutter", "Com mixed Scissors and Water to make Water Jet", "Com mixed Scissors and Grass to make Pointy Stick"]]
  11.  
  12. output_list = [
  13.     ["0,0 Invalid Set!"],
  14.     ["1,0 Invalid set!", "You mixed Rock and Fire to make FireStone!", "You mixed Rock and Water to make Water Stone!", "You mixed Rock and Grass to make Mossy Stone!"],
  15.     ["2,0 Invalid Set!", "You mixed Paper and Fire to make Kindling!", "You mixed Paper and Water to make Soaking Towel", "You Mixed Paper and Grass to make Oragami Rose"],
  16.     ["3,0 Invalid Set!", "You mixed Scissors and Fire to make Plasma Cutter", "You mixed Scissors and Water to make Water Jet", "You Mixed Scissors and Grass to make Pointy Stick"]]
  17.  
  18. com_i = 0
  19. com_t = 0
  20. com_combo = [com_i, com_t]  
  21.  
  22. cho_i = 0
  23. cho_t = 0
  24. combo = [cho_i, cho_t]
  25.  
  26.  
  27.  
  28.  
  29. def score():
  30.     print "+------------------+\n|    ~~SCORES~~    |\n+------------------+"
  31.     print "|Total Games: ", count, "  |"
  32.     print "|Total Wins:  ", win, "  |"
  33.     print "|Total Ties:  ", tie, "  |"
  34.     print "|Total Loses: ", lose, "  |\n+------------------+\n"
  35.     raw_input("Press 'Enter' when you're ready to continue")
  36.  
  37. def instructions():
  38.     print """Instructions: Not yet done..."""
  39.  
  40. def choose_item():
  41.     global cho_i
  42.     while count <= 1000:
  43.         cho_item = raw_input("""
  44. +------------------+    +------------------+
  45. |Pick to Start Game| Or | Pick Menu Option |
  46. +------------------+    +------------------+
  47. |  [Rock]          |    |  [Help]          |
  48. |  [Paper]         |    |  [Score]         |
  49. |  [Scissors]      |    |                  |
  50. +------------------+    +------------------+
  51. """).title()
  52.         if cho_item == "Rock":
  53.             cho_i = 1
  54.         elif cho_item == "Paper":
  55.             cho_i = 2
  56.         elif cho_item == "Scissors":
  57.             cho_i = 3
  58.         elif cho_item == "Help":
  59.             instructions()
  60.             raw_input("Press 'Enter' when you're done reading...")
  61.             continue
  62.         elif cho_item == "Score":
  63.             score()
  64.             continue
  65.         else:
  66.             print "Invalid input. \nPlease type a valid screen option as indicated by a set of brackets"
  67.             continue
  68.         print "You've chosen", cho_item, "\n"
  69.         break
  70.  
  71.  
  72. def choose_type():
  73.     global cho_t
  74.     while count <= 1000:
  75.         cho_type = raw_input("""
  76. +------------------+
  77. |  Pick an Element |
  78. +------------------+
  79. |  [Fire]          |
  80. |  [Water]         |
  81. |  [Grass]         |
  82. +------------------+
  83. """).title()
  84.         if cho_type == "Fire":
  85.             cho_t = 4
  86.         elif cho_type == "Water":
  87.             cho_t = 5
  88.         elif cho_type == "Grass":
  89.             cho_t = 6
  90.         else:
  91.             print "Invalid input. Please type 'Fire', 'Water', 'Grass'."
  92.             continue
  93.         print "You've chosen", cho_type, "\n"
  94.         break
  95.  
  96.  
  97. def com_choose_item():
  98.     global com_i
  99.     import random
  100.     while count <= 1000:
  101.         com_i = random.randrange(3)+1
  102.         if com_i == 1:
  103.             print "The computer chose Rock"
  104.         elif com_i == 2:
  105.             print "The computer chose Paper"
  106.         elif com_i == 3:
  107.             print "The computer chose Scissors"
  108.         else:
  109.             print "Whoa whoa whoa! Something went terribly wrong with the computer!"
  110.         break
  111.  
  112.  
  113. def com_choose_type():
  114.     global com_t
  115.     import random
  116.     while count <= 1000:
  117.         com_t = random.randrange(3)+4
  118.         if com_t == 4:
  119.             print "The computer chose Fire\n"
  120.         elif com_t == 5:
  121.             print "The computer chose Water\n"
  122.         elif com_t == 6:
  123.             print "The computer chose Grass\n"
  124.         else:
  125.             print "\aWhoa whoa whoa!\n Something went terribly wrong with the computer!\n"
  126.         break
  127.  
  128.  
  129.  
  130. def combo_namingv2():
  131.     print "[", cho_i, cho_t, "]"
  132.     print output_list[1][4]
  133.  
  134. def com_combo_namingv2():
  135.     print "[", com_i, com_t,"]"
  136.     print com_output_list[4][1]
  137.  
  138.  
  139. def PvC_matchup():
  140.     global tie
  141.     global win
  142.     global lose
  143.     combo = [cho_i, cho_t]
  144.     com_combo = [com_i, com_t]
  145.     if combo == [0, 0] and com_combo == [0, 0]:
  146.         tie += 1
  147.         print "You and com failed to change global values 'combo', and 'com_combo'"
  148.         print "You probably failed to change global values 'cho_i', 'cho_t'"
  149.         print "Com probably failed to change global values 'com_i', and com_t"
  150.     elif combo == [1, 4] and com_combo == [1, 4]:
  151.         tie += 1
  152.         print "Rock+Fire = Rock+Fire"
  153.         print "You both burned your hands with your Fire Stones...\nYou Tie!"
  154.         print "flv txt: You both take little damage"
  155.     elif combo == [1, 4] and com_combo == [1, 5]:
  156.         lose += 1
  157.         print "Rock + Fire < Rock + Water"
  158.         print "Computer's Water Stone cools your Fire Stone...\nYou Lose!"
  159.         print "flv txt: You were mildly damaged!"
  160.     elif combo == [1, 4] and com_combo == [1, 6]:
  161.         win+=1
  162.         print "Rock+Fire > Rock+Grass"
  163.         print "Your Fire Stone burns Computer's Mossy Stone...\nYou Win!"
  164.         print "flv txt: It's mildly effective!"
  165.     elif combo == [2, 4] and com_combo == [1, 4]:
  166.         win+=1
  167.         print "Paper+Fire > Rock+Fire"
  168.         print "You use computer's Fire Stones to protect your fire from the wind... \nYou Win!"
  169.         print "flv txt: Water(def)-1, Wind(def) +1, fire(atk)+1"        
  170.     elif combo == [2, 4] and com_combo == [1, 5]:
  171.         win +=1
  172.         print "Paper+Fire > Rock+Water"
  173.         print "You wrap your Kindling around the Computer's Fire Stone... \nYou Win!"
  174.         print "flv txt: But not before Com's water quenches your fire... You now have normal paper..."
  175.     elif combo == [2, 4] and com_combo == [1, 6]:
  176.         win +=1
  177.         print "Paper+Fire > Rock+Grass"
  178.         print "You wrap your kindling aroound the Computer's Mossy Stone and burn him...\nYou Win!"
  179.         print "flv txt: You dealt DOUBLE DAMAGE!"
  180.     elif combo == [3, 4] and com_combo == [1, 4]:
  181.         lose+=1
  182.         print "Scissors+Fire < Rock+Fire"
  183.         print "Your Plasma Cutter overheats...\nYou Lose"
  184.         print "flv txt: You wait for your plasma cutter to cool down... you lose a turn"
  185.     elif combo == [3, 4] and com_combo == [1, 5]:
  186.         lose+=1
  187.         print "Scissors+Fire < Rock+Water"
  188.         print "Computer's water stone causes your Plasma Cutter to have a shortage!\nYou Lose!"
  189.         print "flv txt: The shortage caused a back fire! You take extra damage!"
  190.     elif combo ==  [3, 4] and com_combo == [1, 6]:
  191.         lose+=1
  192.         print "Scissors+Fire < Rock+Grass"
  193.         print "Computer's Mossy Rock smashes your Plasma Cutter...\nYou Lose"
  194.         print "flv txt: but you removed the moss off of the stone! Computer now has a plain Stone..."
  195.     elif combo == [1, 5] and com_combo == [1, 4]:
  196.         print "Rock+Water > Rock+Fire"
  197.         print ""
  198.     #Not completed
  199.  
  200. def after_game():
  201.     global count
  202.     count+=1
  203.     score()
  204.     ask_new_game()
  205.  
  206. def ask_new_game():
  207.     print "Do you want to try again?"
  208.     chois = raw_input("'Yes' or 'No'?").title()
  209.     if chois == 'Yes':
  210.         main()
  211.     elif chois == 'No':
  212.         raw_input("Press 'Enter' to quit the game")
  213.     else:
  214.         print "Invalid input, type 'Yes', or  'No' only"
  215.         ask_new_game()
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222. def main():
  223.     choose_item()
  224.     choose_type()
  225.     #combo_namingv2()
  226.     com_choose_item()
  227.     com_choose_type()
  228.     #com_combo_namingv2()
  229.     PvC_matchup()
  230.     after_game()    
  231.  
  232.  
  233. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement