Advertisement
DirkEdge

RPS^2 dirty v2

Mar 25th, 2014
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 8.44 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.  
  58.  
  59. def choose_type():
  60.     while count in range(1000):
  61.         cho_type = raw_input("""
  62. +--------------+
  63. |   Pick One   |
  64. +--------------+
  65. |  [Fire]      |
  66. |  [Water]     |
  67. |  [Grass]     |
  68. +--------------+
  69. """).title()
  70.         if cho_type == "Fire":
  71.             cho_t = 4
  72.         elif cho_type == "Water":
  73.             cho_t = 5
  74.         elif cho_type == "Grass":
  75.             cho_t = 6
  76.         else:
  77.             print "Invalid input. Please type 'Fire', 'Water', 'Grass'."
  78.             continue
  79.         print "You've chosen", cho_type, "\n"
  80.         break
  81.  
  82.  
  83. def com_choose_item():
  84.     import random
  85.     while count <= 1000:
  86.         com_i = random.randrange(3)+1
  87.         if com_i == 1:
  88.             print "The computer chose Rock"
  89.         elif com_i == 2:
  90.             print "The computer chose Paper"
  91.         elif com_i == 3:
  92.             print "The computer chose Scissors"
  93.         else:
  94.             print "Whoa whoa whoa! Something went terribly wrong with the computer!"
  95.         break
  96.     return com_i
  97.  
  98.  
  99.    
  100. def com_choose_type():
  101.     import random
  102.     while count <= 1000:
  103.         com_t = random.randrange(3)+4
  104.         if com_t == 4:
  105.             print "The computer chose Fire\n"
  106.         elif com_t == 5:
  107.             print "The computer chose Water\n"
  108.         elif com_t == 6:
  109.             print "The computer chose Grass\n"
  110.         else:
  111.             print "\aWhoa whoa whoa!\n Something went terribly wrong with the computer!\n"
  112.         break
  113.     return com_t
  114.  
  115.    
  116. def combo_naming():
  117. #    combo = [cho_i, cho_t]
  118.     print "combo:", combo
  119.     if combo == [0, 0]:
  120.         print "You haven't changed 'Combo' values!"
  121.     elif combo == [1, 4]:
  122.         print "You combined ROCK and FIRE to make FIRE STONE!"
  123.     elif combo == [1, 5]:
  124.         print "You combined ROCK and WATER to make WATER STONE!"
  125.     elif combo == [1, 6]:
  126.         print "You combined ROCK and GRASS to make a MOSSY STONE!"
  127.     elif combo == [2, 4]:
  128.         print "You combined PAPER and FIRE to make KINDLING!"
  129.     elif combo == [2, 5]:
  130.         print "You combined PAPER and WATER to make SOGGY PAPER..."
  131.     elif combo == [2, 6]:
  132.         print "you combined PAPER and GRASS to make a CIGAR!"
  133.     elif combo == [3, 4]:
  134.         print "You combined SCISSORS and FIRE to make a PLASMA CUTTER!"
  135.     elif combo == [3, 5]:
  136.         print "You combined SCISSORS and WATER to make a WATER JET"
  137.     elif combo == [3, 6]:
  138.         print "You combined SCISSORS and GRASS to make a SHARPENED STICK"
  139.     else:
  140.         print "Something went wrong with combo_naming()"
  141.                      
  142.  
  143. def com_combo_naming():
  144. #    com_combo = [com_i, com_t]
  145.     print "com_combo: ", com_combo
  146.     if com_combo == [0, 0]:
  147.         print "You haven't changed 'com_combo' values!"
  148.     elif com_combo == [1, 4]:
  149.         print "Computer combined ROCK and FIRE to make FIRE STONE!"
  150.     elif com_combo == [1, 5]:
  151.         print "Computer combined ROCK and WATER to make WATER STONE!"
  152.     elif com_combo == [1, 6]:
  153.         print "computer combined ROCK and GRASS to make MOSSY STONE!"
  154.     elif com_combo == [2, 4]:
  155.         print "Computer combined PAPER and FIRE to make KINDLING!"
  156.     elif com_combo == [2, 5]:
  157.         print "Computer combined PAPER and WATER to make SOGGY PAPER..."
  158.     elif com_combo == [2, 6]:
  159.         print "Computer combined PAPER and GRASS to make a CIGAR!"
  160.     elif com_combo == [3, 4]:
  161.         print "Computer combined SCISSORS and FIRE to make a PLASMA CUTTER!"
  162.     elif com_combo == [3, 5]:
  163.         print "Computer combined SCISSORS and WATER to make a WATER JET"
  164.     elif com_combo == [3, 6]:
  165.         print "Computer combined SCISSORS and GRASS to make a SHARPENED STICK"
  166.     else:
  167.         print "Something went wrong with com_combo_naming()"
  168.  
  169. def com_outputs():
  170.     com_outdict = {
  171.     com_output[0][0]: "You haven't changed 'com_combo' values!",
  172.     com_output[1][4]: "Computer combined ROCK and FIRE to make FIRE STONE!",
  173.     com_output[1][5]: "Computer combined ROCK and WATER to make WATER STONE!",
  174.     com_output[1][6]: "Computer combined ROCK and GRASS to make MOSSY STONE!",
  175.     com_output[2][4]: "Computer combined PAPER and FIRE to make KINDLING!",
  176.     com_output[2][5]: "Computer combined PAPER and WATER to make SOGGY PAPER...",
  177.     com_output[2][6]: "Computer combined PAPER and GRASS to make a CIGAR!",
  178.     com_output[3][4]: "Computer combined SCISSORS and FIRE to make a PLASMA CUTTER!",
  179.     com_output[3][5]: "Computer combined SCISSORS and WATER to make a WATER JET",
  180.     com_output[3][6]: "Computer combined SCISSORS and GRASS to make a SHARPENED STICK"
  181.     }    
  182.  
  183. def com_combo_namingv2():
  184.     print com_i, com_t
  185.     print com_output[1][4]
  186.     print com_output[com_i][com_t]
  187.        
  188.  
  189. def PvC_matchup():
  190.     global tie
  191.     global win
  192.     global lose
  193.     if combo == [0, 0] and com_combo == [0, 0]:
  194.         tie += 1
  195.         print "You and com failed to change global values 'combo', and 'com_combo'"
  196.         print "You probably failed to change global values 'cho_i', 'cho_t'"
  197.         print "Com probably failed to change global values 'com_i', and com_t"
  198.     elif combo == [1, 4] and com_combo == [1, 4]:
  199.         tie += 1
  200.         print "Rock+Fire = Rock+Fire"
  201.         print "You both burned your hands with your Fire Stones...\n You Tie!"
  202.         print "flv txt: You both take little damage"
  203.     elif combo == [1, 4] and com_combo == [1, 5]:
  204.         count += 1
  205.         lose += 1
  206.         print "Rock + Fire < Rock + Water"
  207.         print "Computer's Water Stone cools your Fire Stone...\n You Lose!"
  208.         print "flv txt: You were mildly damaged!"
  209.     elif combo == [1, 4] and com_combo == [1,6]:
  210.         win+=1
  211.         print "Rock+Fire > Rock+Grass"
  212.         print "Your Fire Stone burns Computer's Mossy Stone...\n You Win!"
  213.         print "flv txt: It's mildly effective!"
  214.     elif combo == [2,4] and com_combo == [1,4]:
  215.         lose+=1
  216.         print "paper+fire > rock+fire"
  217.         print "You use computer's Fire Stones to protect your fire from the wind... Win!"
  218.         print "flv txt: Water(def)-1, Wind(def) +1, fire(atk)+1"        
  219.     elif combo == [2,4] and com_combo == [1,5]:
  220.         lose+=1
  221.         print "paper+fire > rock + water"
  222.         print "You wrap your Kindling around the Conmputer's Fire Stone... You Win!"
  223.         print "flv txt: "
  224.     #Not completed
  225.  
  226. def after_game():
  227.     global count
  228.     count+=1
  229.     score()
  230.     ask_new_game()
  231.  
  232. def ask_new_game():
  233.     print "Do you want to try again?"
  234.     chois = raw_input("'Yes' or 'No'?").title()
  235.     if chois == 'Yes':
  236.         main()
  237.     elif chois == 'No':
  238.         raw_input("Press 'Enter' to quit the game")
  239.     else:
  240.         print "Invalid input, type 'Yes', or  'No' only"
  241.         ask_new_game()
  242.  
  243.  
  244.    
  245.  
  246.  
  247.  
  248. def main():
  249.     choose_item()
  250.     choose_type()
  251.     combo_naming()
  252.     com_choose_item()
  253.     com_choose_type()
  254.     com_combo_namingv2()
  255.     #com_outputs()
  256.     PvC_matchup()
  257.     after_game()    
  258.  
  259.  
  260. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement