Esempio n. 1
0
def main():
    # Create an object from the Coin class.
    my_coin = (
        c.Coin()
    )  # this creates an instance called 'my_coin' of the class 'Coin()'
    your_coin = c.Coin()
    """
    # Display the side of the coin that is facing up.
    print(
        "This side is up:", my_coin.get_sideup()
    )  # notice you do not have to supply the argument/parameter

    # Toss the coin.
    print("I am going to toss the coin ten times:")
    for count in range(10):
        my_coin.toss()

        # Display the side of the coin that is facing up.
        print("This side is up:", my_coin.get_sideup())

    # Call the main function.
    """
    show_coin_status(my_coin)
    flip(my_coin)
    show_coin_status(my_coin)

    show_coin_status(your_coin)
    flip(your_coin)
    show_coin_status(your_coin)
Esempio n. 2
0
def main():
       # Create an object from the Coin class.
       my_coin = c.Coin()   # this creates an instance called 'my_coin' of the class 'Coin()'
       your_coin = c.Coin()


       
       show_coin_status(my_coin)
       flip(my_coin)
       show_coin_status(my_coin)

       show_coin_status(your_coin)
       flip(your_coin)
       show_coin_status(your_coin)
Esempio n. 3
0
def main():
    # Create an object from the Coin class.
    my_coin = (
        c.Coin()
    )  # this creates an instance called 'my_coin' of the class 'Coin()'
    your_coin = c.Coin()

    # Display the side of the coin that is facing up.

    flip(my_coin)
    show_coin_status(my_coin)

    flip(your_coin)
    show_coin_status(your_coin)
Esempio n. 4
0
def main():
    # Create an object from the Coin class.
    my_coin = (
        c.Coin()
    )  # this creates an instance called 'my_coin' of the class 'Coin()'

    # Display the side of the coin that is facing up.
    """
    print(
        "This side is up:", my_coin.get_sideup()
    )  # notice you do not have to supply the argument/parameter

    # Toss the coin.
    print("I am going to toss the coin ten times:")
    for count in range(10):
        my_coin.toss()

        # (this just shows that assigning heads doesnt matter)
        my_coin.sideup = "Heads"

        # Display the side of the coin that is facing up.
        print("This side is up:", my_coin.get_sideup())
    """
    show_coin_status(my_coin)
    flip(my_coin)
    show_coin_status(my_coin)
Esempio n. 5
0
def main():
    # Create an object from the Coin class.
    my_coin = c.Coin()
    # this creates an instance called 'my_coin' of the class 'Coin()'
    """
    # Display the side of the coin that is facing up.
    print(
        "This side is up:", my_coin.get_sideup()
    )  # notice you do not have to supply the argument/parameter

    # Toss the coin.
    print("I am going to toss the coin ten times:")
    for count in range(10):
        my_coin.toss()

        # once you've made the attribute hidden, it will just ignore lines like this
        my_coin.sideup = "Heads"

        # Display the side of the coin that is facing up.
        print("This side is up:", my_coin.get_sideup())
    """

    show_coin_status(my_coin)
    flip(my_coin)
    show_coin_status(my_coin)
Esempio n. 6
0
def main():
    # Create an object from the Coin class.
    my_coin = c.Coin()
    your_coin = c.Coin(
    )  # this creates an instance called 'my_coin' of the class 'Coin()'
    # this is instance 1 for the Coin class

    # Display the side of the coin that is facing up.
    # print('This side is up:', my_coin.get_sideup())    # notice you do not have to supply the argument/parameter

    # Toss the coin.
    #print('I am going to toss the coin ten times:')
    #for count in range(10):
    #   my_coin.toss()

    # Display the side of the coin that is facing up.
    #  print('This side is up:', my_coin.get_sideup())
    show_coin_status(my_coin)
    flip(my_coin)
    show_coin_status(my_coin)

    show_coin_status(your_coin)
    flip(your_coin)
    show_coin_status(your_coin)
Esempio n. 7
0
def main():
    # Create an object from the Coin class.
    my_coin = c.Coin(
    )  # this creates an instance called 'my_coin' of the class 'Coin()'

    # Display the side of the coin that is facing up.
    print('This side is up:', my_coin.get_sideup()
          )  # notice you do not have to supply the argument/parameter
    #you'll get a heads here based on class
    # Toss the coin.
    print('I am going to toss the coin ten times:')
    for count in range(10):
        my_coin.toss()

        #my_coin.sideup = "Heads" (This addition will give heads 10 times and will lead to manipulation)

        # Display the side of the coin that is facing up.
        print('This side is up:', my_coin.get_sideup())
Esempio n. 8
0
def main():
    # Create an object from the Coin class.
    # doesnt have to be names my_coin but it needs a variable assigned to it
    my_coin = (
        c.Coin()
    )  # this creates an instance called 'my_coin' of the class 'Coin()'
    # instance has all the attributes and methods for the instance(my_coin)

    # Display the side of the coin that is facing up.
    """
    print(
        "This side is up:", my_coin.get_sideup())

"""
    # we are passing this as an argument to a method called show_coin_status
        show_coin_status(coin_obj)
        flip(my_coin)
        show_coin_status(coin_obj)
Esempio n. 9
0
# Dependencies
import CoinClass
import utils

# Main function of our program
if __name__ == '__main__':

    # Load of the Configuration file
    conf = utils.parse_yaml('conf.yaml')

    # Class initializer and function run
    min_coin = CoinClass.CoinProblem(cfg=conf)
    min_coin.cash_change()
Esempio n. 10
0
def main():
    # Create an object from the Coin class.
    my_coin = c.Coin()
    # this creates an instance called 'my_coin' of the class 'Coin()'
    your_coin = c.Coin()