Advertisement
DirkEdge

RPS^2 dirty

Mar 25th, 2014
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 7.30 KB | None | 0 0
  1. count = 0
  2. win = 0
  3. tie = 0
  4. lose = 0
  5.  
  6. ##com_i = 0
  7. ##com_t = 0
  8. ##com_combo = [com_i, com_t]
  9. ##
  10. ##cho_i = 0
  11. ##cho_t = 0
  12. ##combo = [cho_i, cho_t]
  13.  
  14.  
  15.  
  16.  
  17. def score():
  18.     print "+------------------+\n|    ~~SCORES~~    |\n+------------------+"
  19.     print "|Total Games: ", count, "  |"
  20.     print "|Total Wins:  ", win, "  |"
  21.     print "|Total Ties:  ", tie, "  |"
  22.     print "|Total Loses: ", lose, "  |\n+------------------+\n"
  23.     raw_input("Press 'Enter' when you're ready to continue")
  24.  
  25. def instructions():
  26.     print """Instructions: Not yet done..."""
  27.  
  28. def choose_item():
  29.     while count in range(1000):
  30.         cho_item = raw_input("""
  31. +------------------+ +------------------+
  32. | Pick Menu Option | |Pick to Start Game|
  33. +------------------+ +------------------+
  34. |  [Help]          | |  [Rock]          |
  35. |  [Score]         | |  [Paper]         |
  36. |                  | |  [Scissors]      |
  37. +------------------+ +------------------+
  38. """).title()
  39.         if cho_item == "Rock":
  40.             cho_i = 1
  41.         elif cho_item == "Paper":
  42.             cho_i = 2
  43.         elif cho_item == "Scissors":
  44.             cho_i = 3
  45.         elif cho_item == "Help":
  46.             instructions()
  47.             raw_input("Press 'Enter' when you're done reading...")
  48.             continue
  49.         elif cho_item == "Score":
  50.             score()
  51.             continue
  52.         else:
  53.             print "Invalid input. \nPlease type a valid screen option as indicated by a set of brackets"
  54.             continue
  55.         print "You've chosen", cho_item, "\n"
  56.         break
  57.         return cho_i
  58.  
  59.  
  60. def choose_type():
  61.     while count in range(1000):
  62.         cho_type = raw_input("""
  63. +--------------+
  64. |   Pick One   |
  65. +--------------+
  66. |  [Fire]      |
  67. |  [Water]     |
  68. |  [Grass]     |
  69. +--------------+
  70. """).title()
  71.         if cho_type == "Fire":
  72.             cho_t = 4
  73.         elif cho_type == "Water":
  74.             cho_t = 5
  75.         elif cho_type == "Grass":
  76.             cho_t = 6
  77.         else:
  78.             print "Invalid input. Please type 'Fire', 'Water', 'Grass'."
  79.             continue
  80.         print "You've chosen", cho_type, "\n"
  81.         break
  82.         return cho_t
  83.  
  84.  
  85. def com_choose_item():
  86.     import random
  87.     while count <= 1000:
  88.         com_i = random.randrange(3)+1
  89.         if com_i == 1:
  90.             print "The computer chose Rock"
  91.         elif com_i == 2:
  92.             print "The computer chose Paper"
  93.         elif com_i == 3:
  94.             print "The computer chose Scissors"
  95.         else:
  96.             print "Whoa whoa whoa! Something went terribly wrong with the computer!"
  97.         break
  98.         return com_i
  99.  
  100.  
  101.    
  102. def com_choose_type():
  103.     import random
  104.     while count <= 1000:
  105.         com_t = random.randrange(3)+4
  106.         if com_t == 4:
  107.             print "The computer chose Fire\n"
  108.         elif com_t == 5:
  109.             print "The computer chose Water\n"
  110.         elif com_t == 6:
  111.             print "The computer chose Grass\n"
  112.         else:
  113.             print "\aWhoa whoa whoa!\n Something went terribly wrong with the computer!\n"
  114.         break
  115.         return com_t
  116.  
  117.    
  118. def combo_naming():
  119. #    combo = [cho_i, cho_t]
  120.     print "combo:", combo
  121.     if combo == [0, 0]:
  122.         print "You haven't changed 'Combo' values!"
  123.     elif combo == [1, 4]:
  124.         print "You combined ROCK and FIRE to make FIRE STONE!"
  125.     elif combo == [1, 5]:
  126.         print "You combined ROCK and WATER to make WATER STONE!"
  127.     elif combo == [1, 6]:
  128.         print "You combined ROCK and GRASS to make a MOSSY STONE!"
  129.     elif combo == [2, 4]:
  130.         print "You combined PAPER and FIRE to make KINDLING!"
  131.     elif combo == [2, 5]:
  132.         print "You combined PAPER and WATER to make SOGGY PAPER..."
  133.     elif combo == [2, 6]:
  134.         print "you combined PAPER and GRASS to make a CIGAR!"
  135.     elif combo == [3, 4]:
  136.         print "You combined SCISSORS and FIRE to make a PLASMA CUTTER!"
  137.     elif combo == [3, 5]:
  138.         print "You combined SCISSORS and WATER to make a WATER JET"
  139.     elif combo == [3, 6]:
  140.         print "You combined SCISSORS and GRASS to make a SHARPENED STICK"
  141.     else:
  142.         print "Something went wrong with combo_naming()"
  143.                      
  144.  
  145.  
  146. def com_outputs():
  147.     [com_output[0][0] == "Computer has not changed 'com_combo' values!",
  148.     com_output[1][4] == "Computer combined ROCK and FIRE to make FIRE STONE!",
  149.     com_output[1][5] == "Computer combined ROCK and WATER to make WATER STONE!",
  150.     com_output[1][6] == "Computer combined ROCK and GRASS to make MOSSY STONE!",
  151.     com_output[2][4] == "Computer combined PAPER and FIRE to make KINDLING!",
  152.     com_output[2][5] == "Computer combined PAPER and WATER to make SOGGY PAPER...",
  153.     com_output[2][6] == "Computer combined PAPER and GRASS to make a CIGAR!",
  154.     com_output[3][4] == "Computer combined SCISSORS and FIRE to make a PLASMA CUTTER!",
  155.     com_output[3][5] == "Computer combined SCISSORS and WATER to make a WATER JET",
  156.     com_output[3][6] == "Computer combined SCISSORS and GRASS to make a SHARPENED STICK"]
  157.    
  158.  
  159. def com_combo_namingv2():
  160.     print com_i, com_t
  161.     print( com_output[com_i][com_t] )
  162.  
  163. def PvC_matchup():
  164.     global tie
  165.     global win
  166.     global lose
  167.     if combo == [0, 0] and com_combo == [0, 0]:
  168.         tie += 1
  169.         print "You and com failed to change global values 'combo', and 'com_combo'"
  170.         print "You probably failed to change global values 'cho_i', 'cho_t'"
  171.         print "Com probably failed to change global values 'com_i', and com_t"
  172.     elif combo == [1, 4] and com_combo == [1, 4]:
  173.         tie += 1
  174.         print "Rock+Fire = Rock+Fire"
  175.         print "You both burned your hands with your Fire Stones...\n You Tie!"
  176.         print "flv txt: You both take little damage"
  177.     elif combo == [1, 4] and com_combo == [1, 5]:
  178.         count += 1
  179.         lose += 1
  180.         print "Rock + Fire < Rock + Water"
  181.         print "Computer's Water Stone cools your Fire Stone...\n You Lose!"
  182.         print "flv txt: You were mildly damaged!"
  183.     elif combo == [1, 4] and com_combo == [1,6]:
  184.         win+=1
  185.         print "Rock+Fire > Rock+Grass"
  186.         print "Your Fire Stone burns Computer's Mossy Stone...\n You Win!"
  187.         print "flv txt: It's mildly effective!"
  188.     elif combo == [2,4] and com_combo == [1,4]:
  189.         lose+=1
  190.         print "paper+fire > rock+fire"
  191.         print "You use computer's Fire Stones to protect your fire from the wind... Win!"
  192.         print "flv txt: Water(def)-1, Wind(def) +1, fire(atk)+1"        
  193.     elif combo == [2,4] and com_combo == [1,5]:
  194.         lose+=1
  195.         print "paper+fire > rock + water"
  196.         print "You wrap your Kindling around the Conmputer's Fire Stone... You Win!"
  197.         print "flv txt: "
  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_naming()
  226.     com_choose_item()
  227.     com_choose_type()
  228.     com_outputs()
  229.     com_combo_namingv2()
  230.     PvC_matchup()
  231.     after_game()    
  232.  
  233.  
  234. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement