Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion Lab 01 - Calculator/lab_01_part_a.py
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
#
#!/usr/bin/env python3
# lab_01_part_a.py
# Jared Rhodes
# 11/01/2017

""" This is the first part of Chapter 1 Lab Pygame """

temp_Fahrenheit = float(input("Enter temperature in Fahrenheit: "))

temp_Celsius = (temp_Fahrenheit - 32) * .5556

print("The temperature in Celsius:", temp_Celsius)
17 changes: 16 additions & 1 deletion Lab 01 - Calculator/lab_01_part_b.py
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
#
#!/usr/bin/env python3
# lab_01_part_b.py
# Jared Rhodes
# 11/01/2017

""" This is the second part of Chapter 1 Lab Pygame """

print("Finding the Area of a Trapezoid")

height = int(input("Enter the height of the trapezoid: "))
base_One = int(input("Enter the length of the bottom base: "))
base_Two = int(input("Enter the length of the top base: "))

area = ((base_One + base_Two) * height) / 2

print('The area is:', area)
18 changes: 17 additions & 1 deletion Lab 01 - Calculator/lab_01_part_c.py
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
#
#!/usr/bin/env python3
# lab_01_part_c.py
# Jared Rhodes
# 11/01/2017

""" This is the third part of Chapter 1 Lab Pygame """

print("Finding your current damage output")

attack_Speed = float(input("Please enter your current attack speed: "))
attack_Damage = float(input("Please enter your current attack damage: "))
critical_Chance = float(input("Please enter your current critical chance: "))

damage_Output = (attack_Speed * attack_Damage) * (1 + (critical_Chance * 1))

print('Your current damage per second is:', damage_Output)

87 changes: 86 additions & 1 deletion Lab 03 - Create a Quiz/main_program.py
Original file line number Diff line number Diff line change
@@ -1 +1,86 @@
#
#!/usr/bin/env python3
# main_program.py
# Jared Rhodes
# 11/03/2017

""" This is the quiz game for chapter 3's lab """

num_Correct = 0



print("This is a quiz game to test your knowlege of random facts")
print("This quiz with consist of 6 questions on varying subjects")

print("Question Number 1")
print("What is the atomic number for Lithium?")
print("A. 6\nB. 8\nC. 5\nD. 3")
usr_Ans = input()

if usr_Ans.upper() == "D":
print("Your answer was correct")
num_Correct += 1
else:
print("Your answer was incorrect")


print("Question Number 2")
print("What is the biggest animal?")
print("A. Elephant\nB. Blue Whale\nC. Sperm Whale\nD. Great White Shark")
usr_Ans = input()

if usr_Ans.upper() == "B":
print("Your answer was correct")
num_Correct += 1
else:
print("Your answer was incorrect")

print("Question Number 3")
print("How many planets are there in our solar system?")
print("A. Eight\nB. Nine\nC. Seven\nD. Ten")
usr_Ans = input()

if usr_Ans.upper() == "A":
print("Your answer was correct")
num_Correct += 1
else:
print("Your answer was incorrect")

print("Question Number 4")
print("What fictional universe do the Borg come from?")
print("A. Star Trek\nB. Firefly\nC. Star Wars\nD. Dark Matter")
usr_Ans = input()

if usr_Ans.upper() == "A":
print("Your answer was correct")
num_Correct += 1
else:
print("Your answer was incorrect")

print("Question Number 5")
print("What percent of the earth's surface is water?")
print("A. 70%\nB. 72%\nC. 64%\nD. 71%")
usr_Ans = input()

if usr_Ans.upper() == "D":
print("Your answer was correct")
num_Correct += 1
else:
print("Your answer was incorrect")

print("Question Number 6")
print("Which country borders China?")
print("A. Thailand\nB. South Korea\nC. India\nD. Japan")
usr_Ans = input()

if usr_Ans.upper() == "C":
print("Your answer was correct")
num_Correct += 1
else:
print("Your answer was incorrect")

print("Congradulations on completing my Quiz")
print("You scored a", num_Correct, "out of 6")
print("This is a", str(num_Correct / 6) + "%")


103 changes: 102 additions & 1 deletion Lab 04 - Camel/main_program.py
Original file line number Diff line number Diff line change
@@ -1 +1,102 @@
#
#!/usr/bin/env python3
# main_program.py
# Jared Rhodes
# 11/07/2017

""" This is the camel game lab from chapter 4 """

import random

print("Welcome to Camel!")
print("You have stolen a camel to make your way across the great Mobi desert")
print("The natives want their camel back and are chasing you down!")
print("Survive crossing the desert, and outrun those natives!")

done = False
miles = 0
thirst = 0
tiredness = 0
native_Miles = -20
canteen_Drinks = 3

while done == False:
print("Your choices are -----------")
print("A. Drink from your canteen")
print("B. Ahead moderate speed")
print("C. Ahead full speed")
print("D. Stop for the night")
print("E. Status check")
print("Q. Quit")
usr_Decision = input()

if usr_Decision.upper() == "Q":
done = True

if usr_Decision.upper() == "E":
print("You currently have", canteen_Drinks,
"drinks left in your canteen")
print("You currently have traveled", miles,
"miles")
print("The natives are currently", miles - native_Miles,
"miles behind you")

if usr_Decision.upper() == "D":
print("Your camel thanks you!")
tiredness = 0
native_Miles += random.randint(7, 14)\

if usr_Decision.upper() == "C":
miles_Traveled = random.randint(10, 20)
print("You traveled", miles_Traveled, "miles")
miles += miles_Traveled
tiredness += random.randint(1, 3)
thirst += 1
native_Miles += random.randint(7, 14)

if usr_Decision.upper() == "B":
miles_Traveled = random.randint(5, 12)
print("You traveled", miles_Traveled, "miles")
miles += miles_Traveled
tiredness += 1
thirst += 1
native_Miles += random.randint(7, 14)

if usr_Decision.upper() == "A":
if canteen_Drinks >= 1:
print("You take a drink, and feel refreshed")
canteen_Drinks -= 1
thirst = 0
else:
print("You don't have any drinks left :(")

if thirst > 4:
print("You are thirsty")
elif thirst > 6:
print("You died of thirst")
done = True

if tiredness > 5:
print("Your camel is getting tired")
elif tiredness > 8:
print("Your camel died")
done = True

if native_Miles >= miles:
print("You done got caught, by the natives")
done = True
elif native_Miles >= miles - 15:
print("The natives are getting close!")

if miles >= 200:
print("You made it through the desert!")
print("You win, you didn't die, that is equaivalent to winning!")
done = True

chance = random.randint(1, 20)

if chance == 1:
print("You stumbled on an oasis")
canteen_Drinks = 3
thirst = 0
tiredness = 0

56 changes: 55 additions & 1 deletion Lab 05 - Create a Picture/main_program.py
Original file line number Diff line number Diff line change
@@ -1 +1,55 @@
#
#!/usr/bin/env python3
# main_program.py
# Jared Rhodes
# 11/09/2017

""" This is the draw pictue lab from chapter 5 """

import pygame

BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
GREEN = (0, 255, 0)
RED = (255, 0, 0)
YELLOW = (255, 255, 0)
SKYBLUE = (0, 255, 255)
BROWN = (155, 100, 0)
BLUE = (0, 0, 255)
PI = 3.1415926

pygame.init()
size = (700, 500)
max_X = 700
max_Y = 500
screen = pygame.display.set_mode(size)

done = False


clock = pygame.time.Clock()
while not done:
for event in pygame.event.get():
if event.type == pygame.QUIT:
done = True
screen.fill(WHITE)

pygame.draw.rect(screen, GREEN, [0, 400, 700, 500])
pygame.draw.ellipse(screen, BLUE, [100,340,220,120])
pygame.draw.rect(screen, SKYBLUE, [0, 0, 700, 400])
pygame.draw.circle(screen, YELLOW, [100, 100], 100)
pygame.draw.rect(screen, BROWN, [400, 350, 30, 80])
pygame.draw.circle(screen, GREEN, [415, 250], 100)
pygame.draw.lines(screen, BLACK, False, [(600, 100), (610, 110), (620, 100)], 4)
pygame.draw.lines(screen, BLACK, False, [(500, 140), (510, 150), (520, 140)], 3)
pygame.draw.lines(screen, BLACK, False, [(550, 180), (560, 190), (570, 180)], 2)
pygame.draw.circle(screen, RED, [360, 220], 9)
pygame.draw.circle(screen, RED, [430, 240], 9)
pygame.draw.circle(screen, RED, [460, 200], 9)
pygame.draw.circle(screen, RED, [420, 320], 9)
pygame.draw.circle(screen, RED, [350, 295], 9)
pygame.draw.circle(screen, RED, [480, 285], 9)


pygame.display.flip()
clock.tick(60)
pygame.quit()
13 changes: 13 additions & 0 deletions Lab 06 - Loopy Lab/part_1.py
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
#!/usr/bin/env python3
#part_1.py
#Jared Rhodes
#November 5, 2017

""" Part 1 of Chapter 6 Loopy Lab """

diget = 10

for row in range(1,10):
for col in range(row):
print(diget,end=" ")
diget += 1
print()
41 changes: 40 additions & 1 deletion Lab 06 - Loopy Lab/part_2.py
Original file line number Diff line number Diff line change
@@ -1 +1,40 @@
#
#!/usr/bin/env python3
#part_2.py
#Jared Rhodes
#November 5, 2017

""" Part 2 of Chapter 6 Loopy Lab """

size = int(input("What size box would you like? "))


for width_Top in range(size * 2):
print("o",end="")
print()

for height in range(size - 2):
print("o" + (" " * (size * 2 - 2)) + "o")

for width_Bottom in range(size * 2):
print("o",end="")
print()

#This is how to make real boxes!

"""

size = int(input("What size box would you like? "))


for width_Top in range(size * 2):
print("▀",end="")
print()

for height in range(size - 2):
print("█" + (" " * (size * 2 - 2)) + "█")

for width_Bottom in range(size * 2):
print("▄",end="")
print()

"""
32 changes: 31 additions & 1 deletion Lab 06 - Loopy Lab/part_3.py
Original file line number Diff line number Diff line change
@@ -1 +1,31 @@
#
#!/usr/bin/env python3
#part_3.py
#Jared Rhodes
#November 5, 2017

""" Part 3 of Chapter 6 Loopy Lab """

size = int(input("What size shape would you like? "))

top_Number = 0
diget = 1
line_List = []

top_Number = size * 2

for row in range(size):
print()
for col in range(1 + (2 * row), top_Number + 1, 2):
print(col,end=" ")
print(" " * row,end="")
for col2 in range(top_Number - 1, 0 + (2 * row), -2):
print(col2,end=" ")


for row2 in range(size, -1, -1):
for col in range(1 + (2 * row2), top_Number + 1, 2):
print(col,end=" ")
print(" " * row2,end="")
for col2 in range(top_Number - 1, 0 + (2 * row2), -2):
print(col2,end=" ")
print()
Loading