Advertisement
DirkEdge

RPS^2 Version2 clean

Mar 25th, 2014
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 6.76 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 in range(1000):
  43.         cho_item = raw_input("""
  44. +------------------+ +------------------+
  45. | Pick Menu Option | |Pick to Start Game|
  46. +------------------+ +------------------+
  47. |  [Help]          | |  [Rock]          |
  48. |  [Score]         | |  [Paper]         |
  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.     return cho_i
  71.  
  72.  
  73. def choose_type():
  74.     global cho_t
  75.     while count in range(1000):
  76.         cho_type = raw_input("""
  77. +--------------+
  78. |   Pick One   |
  79. +--------------+
  80. |  [Fire]      |
  81. |  [Water]     |
  82. |  [Grass]     |
  83. +--------------+
  84. """).title()
  85.         if cho_type == "Fire":
  86.             cho_t = 4
  87.         elif cho_type == "Water":
  88.             cho_t = 5
  89.         elif cho_type == "Grass":
  90.             cho_t = 6
  91.         else:
  92.             print "Invalid input. Please type 'Fire', 'Water', 'Grass'."
  93.             continue
  94.         print "You've chosen", cho_type, "\n"
  95.         break
  96.     return cho_t
  97.  
  98.  
  99. def com_choose_item():
  100.     import random
  101.     global com_i
  102.     while count <= 1000:
  103.         com_i = random.randrange(3)+1
  104.         if com_i == 1:
  105.             print "The computer chose Rock"
  106.         elif com_i == 2:
  107.             print "The computer chose Paper"
  108.         elif com_i == 3:
  109.             print "The computer chose Scissors"
  110.         else:
  111.             print "Whoa whoa whoa! Something went terribly wrong with the computer!"
  112.         break
  113.     return com_i
  114.  
  115.  
  116. def com_choose_type():
  117.     import random
  118.     global com_t
  119.     while count <= 1000:
  120.         com_t = random.randrange(3)+4
  121.         if com_t == 4:
  122.             print "The computer chose Fire\n"
  123.         elif com_t == 5:
  124.             print "The computer chose Water\n"
  125.         elif com_t == 6:
  126.             print "The computer chose Grass\n"
  127.         else:
  128.             print "\aWhoa whoa whoa!\n Something went terribly wrong with the computer!\n"
  129.         break
  130.     return com_t
  131.  
  132.  
  133.  
  134. def combo_namingv2(cho_i,cho_t):
  135.     print cho_i, cho_t
  136.     print(output_list[cho_i][cho_t])
  137.  
  138. def com_combo_namingv2(com_i,com_t):
  139.     print com_i, com_t
  140.     print(com_output_list[com_i][com_t])
  141.  
  142.  
  143. def PvC_matchup():
  144.     global tie
  145.     global win
  146.     global lose
  147.     if combo == [0, 0] and com_combo == [0, 0]:
  148.         tie += 1
  149.         print "You and com failed to change global values 'combo', and 'com_combo'"
  150.         print "You probably failed to change global values 'cho_i', 'cho_t'"
  151.         print "Com probably failed to change global values 'com_i', and com_t"
  152.     elif combo == [1, 4] and com_combo == [1, 4]:
  153.         tie += 1
  154.         print "Rock+Fire = Rock+Fire"
  155.         print "You both burned your hands with your Fire Stones...\n You Tie!"
  156.         print "flv txt: You both take little damage"
  157.     elif combo == [1, 4] and com_combo == [1, 5]:
  158.         count += 1
  159.         lose += 1
  160.         print "Rock + Fire < Rock + Water"
  161.         print "Computer's Water Stone cools your Fire Stone...\n You Lose!"
  162.         print "flv txt: You were mildly damaged!"
  163.     elif combo == [1, 4] and com_combo == [1,6]:
  164.         win+=1
  165.         print "Rock+Fire > Rock+Grass"
  166.         print "Your Fire Stone burns Computer's Mossy Stone...\n You Win!"
  167.         print "flv txt: It's mildly effective!"
  168.     elif combo == [2,4] and com_combo == [1,4]:
  169.         lose+=1
  170.         print "paper+fire > rock+fire"
  171.         print "You use computer's Fire Stones to protect your fire from the wind... Win!"
  172.         print "flv txt: Water(def)-1, Wind(def) +1, fire(atk)+1"        
  173.     elif combo == [2,4] and com_combo == [1,5]:
  174.         lose+=1
  175.         print "paper+fire > rock + water"
  176.         print "You wrap your Kindling around the Conmputer's Fire Stone... You Win!"
  177.         print "flv txt: "
  178.     #Not completed
  179.  
  180. def after_game():
  181.     global count
  182.     count+=1
  183.     score()
  184.     ask_new_game()
  185.  
  186. def ask_new_game():
  187.     print "Do you want to try again?"
  188.     chois = raw_input("'Yes' or 'No'?").title()
  189.     if chois == 'Yes':
  190.         main()
  191.     elif chois == 'No':
  192.         raw_input("Press 'Enter' to quit the game")
  193.     else:
  194.         print "Invalid input, type 'Yes', or  'No' only"
  195.         ask_new_game()
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. def main():
  203.     choose_item()
  204.     choose_type()
  205.     combo_namingv2()
  206.     com_choose_item()
  207.     com_choose_type()
  208.     com_combo_namingv2()
  209.     PvC_matchup()
  210.     after_game()    
  211.  
  212.  
  213. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement