This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def beats(one, two): | |
| result = False | |
| # Only two outcome can occur | |
| # If you Win = True | |
| # If you Lose = False | |
| # This is the boolean logic (George Boole created this on 1854) | |
| # BEFORE all the computer stuff. Cool right? | |
| if one is two: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Player: | |
| def __init__(self, x, y): # This is the initiation for the class Player | |
| self.x = x | |
| self.y = y | |
| def returnX(self): | |
| return self.x | |
| def returnY(self): | |
| return self.y |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import random | |
| """This program plays a game of Rock, Paper, Scissors between two Players, | |
| and reports both Player's scores each round.""" | |
| moves = ['rock', 'paper', 'scissors'] | |
| """The Player class is the parent class for all of the Players | |
| in this game""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import random | |
| moves = ["rock", "paper", "scissors"] | |
| class Player: | |
| self.move = "something" | |
| self.move2 = "something" | |
| def learn(self, my_move, their_move): |
NewerOlder