Ejemplo n.º 1
0
def test_deck():
    cards = [
        Card.Card(suit, face) for face in card_faces for suit in card_suits
    ]
    stack = cards[-28:]
    stock = cards[:24]
    pyramid = Pyramid.Pyramid(stack)
    return State.State(stack, stock, pyramid, [])
Ejemplo n.º 2
0
def new_deck():
    """
    Setup a new random deck
    :return type: State
    """
    cards = [
        Card.Card(suit, face) for face in card_faces for suit in card_suits
    ]
    shuffle(cards)
    stack = cards[:28]
    stock = cards[-24:]
    pyramid = Pyramid.Pyramid(stack)
    return State.State(stack, stock, pyramid, [])
Ejemplo n.º 3
0
import Box
import Pyramid
import Sphere

shape = input(
    "Choose which shape you want to calculate: Box, Sphere, or Pyramid ")

if shape == 'Box':
    l = int(input("Type the Length of your Box "))
    w = int(input("Type the Width of your Box "))
    h = int(input("Type the Height of your Box "))
    b = Box.Box(l, w, h)
    print('This is the Surface Area of your Box | ', b.getSurfaceArea())
    print('This is the Volume of your Box | ', b.getVolume())
elif shape == 'Pyramid':
    l = int(input("Type the Length of your Pyramid "))
    w = int(input("Type the Width of your Pyramid "))
    h = int(input("Type the Height of your Pyramid "))
    p = Pyramid.Pyramid(l, w, h)
    print('This is the Surface Area of your Pyramid | ', p.getSurfaceArea())
    print('This is the Volume of your Pyramid | ', p.getVolume())
elif shape == 'Sphere':
    r = int(input("Type the Radius of your Sphere "))
    s = Sphere.Sphere(r)
    print('This is the Surface Area of your Sphere | ', s.getSurfaceArea())
    print('This is the Volume of your Sphere | ', s.getVolume())
Ejemplo n.º 4
0
import Pyramid, Sphere, Box

m1 = input(
    "If you would like to test for a rectangular prism, enter B.  If you would like to test for a rectangular pyramid, enter P.  If you would like to test for an ellipsoid, enter S."
)
#m1 = upper(m1)

l = float(input("Enter the length of your object:"))
w = float(input("Enter the width of your object:"))
h = float(input("Enter the height of your object:"))

if m1 == "B":
    myShape = Box.Box(l, w, h)
elif m1 == "P":
    myShape = Pyramid.Pyramid(l, w, h)
elif m1 == "S":
    myShape = Sphere.Sphere(l, w, h)
else:
    print("Invalid mode.")
print("Volume: ", str(myShape.getVolume()))
print("Surface area: ", str(myShape.getSurfaceArea()))
Ejemplo n.º 5
0
import Box
import Sphere
import Pyramid

myShape = input("Select the shape to calculate: Box = b, Sphere = s, Pyramid = p - ")

if myShape = 'b':
    l = int(input("Print your Length of the box -"))
    w = int(input("Print your Width of the box -"))
    h = int(input("Print your Height of the box - "))
    b = Box.Box(l,w,h)
    print(b.calcvolume())
    print(b.calcsurface())

elif myShape == 's':
    r = int(input("Print your Radius of sphere -"))
    s = Sphere.Sphere(r)
    print(s.calcvolume())
    print(s.calcsurface())

elif myShape == 'p':
    b = int(input("Print your Base of the pyramid -"))
    h = int(input("Print your Height of the pyramid -"))
    s = int(input("Print your slant of the pyramid-"))
    p = Pyramid.Pyramid(b,h,s)
    print(p.calcvolume())
    print(p.calcsurface())
Ejemplo n.º 6
0
#Box
if selection == 'box':
    length = int(input("What is the length of your box: "))
    width = int(input("What is the width of your box: "))
    height = int(input("What is the height of your box: "))
    box = Box.Box(length, width, height)
    box.volume()
    box.surArea()

#Pyramid
elif selection == 'pyramid':
    length = int(input("What is the length of your pyramid: "))
    width = int(input("What is the width of your pyramid: "))
    height = int(input("What is the height of your pyramid: "))
    pyramid = Pyramid.Pyramid(length, width, height)
    pyramid.volume()
    pyramid.surArea()

#Sphere
elif selection == 'sphere':
    length = int(input("What is the length of your sphere: "))
    width = int(input("What is the width of your sphere: "))
    height = int(input("What is the height of your sphere: "))
    sphere = Sphere.Sphere(length, width, height)
    sphere.volume()
    sphere.surArea()

#They Goofed
else:
    print("Oops something went wrong, try again")
Ejemplo n.º 7
0
import Box
import Pyramid
import Sphere
shape = input("Enter which shape you would like to calculate (b = box, s = sphere, or p = pyramid) : ")

if shape == "b":
    b1 = Box.Box()
    b1.length = int(input("Enter box length: "))
    b1.width = int(input("Enter box width: "))
    b1.length = int(input("Enter box length: "))
    b1.volume()
    b1.surfArea()
elif shape == "p":
    p1 = Pyramid.Pyramid()
    p1.length = int(input("Enter pyramid length: "))
    p1.width = int(input("Enter pyramid width: "))
    p1.height = int(input("Enter pyramid height: "))
    p1.volume()
elif shape == "s":
    s1 = Sphere.Sphere()
    s1.radius = int(input("Enter sphere radius: "))
    s1.volume()