Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
62999b9
part of worksheet 1 finished
BethanyDuMontelle Nov 1, 2017
ff0d6b3
Finished worksheet 1
BethanyDuMontelle Nov 1, 2017
be67cb7
Completed lab A Chapter 1
BethanyDuMontelle Nov 1, 2017
6b47689
Trying to do lab b
BethanyDuMontelle Nov 1, 2017
b3c7bc2
Finished Lab B
BethanyDuMontelle Nov 2, 2017
d824f06
Finished chapter 1 lab c
BethanyDuMontelle Nov 2, 2017
266bb08
Completed chapter 2 worksheet
BethanyDuMontelle Nov 2, 2017
9190036
Started worksheet of chapter 3
BethanyDuMontelle Nov 2, 2017
fea9ca6
finished worksheet 3 chapter 3
BethanyDuMontelle Nov 3, 2017
71207a9
did lab 3 of chapter 3
BethanyDuMontelle Nov 3, 2017
ecd461c
did part of chapter 4 worksheet
BethanyDuMontelle Nov 3, 2017
5e4375d
almost finished lab 4 and worksheet 4
BethanyDuMontelle Nov 6, 2017
64be215
completed chapter 4
BethanyDuMontelle Nov 7, 2017
56762bb
started chapter 5 worksheet 5
BethanyDuMontelle Nov 7, 2017
ec479a1
Finished worksheet 5 and started lab 5
BethanyDuMontelle Nov 8, 2017
ec102a6
completed chapter 5
BethanyDuMontelle Nov 9, 2017
b4c1201
Merge branch 'master' of https://github.com/LewisAndClark-CSD/program…
BethanyDuMontelle Nov 14, 2017
6f3f497
started worksheet 6
BethanyDuMontelle Nov 14, 2017
28aafc8
completed chapter 6 worksheet
BethanyDuMontelle Nov 15, 2017
31c3a25
completes labs 1, 2, and 4 in chapter 6
BethanyDuMontelle Nov 15, 2017
1d660ff
Completed worksheet 7 1 - 8
BethanyDuMontelle Nov 20, 2017
ac72373
Finshed 9 - 15 on worksheet 7
BethanyDuMontelle Nov 20, 2017
1331db5
Started lab 7; started describing each room
BethanyDuMontelle Nov 20, 2017
7e826e9
added more descritions to lab 7
BethanyDuMontelle Nov 20, 2017
5eca269
finished descriptions of rooms and appends it to the room_list
BethanyDuMontelle Nov 28, 2017
6b27bd8
got loop for the rooms to work, now I just need to make it look nicer
BethanyDuMontelle Nov 28, 2017
d0669da
Finished fixing up lab 7
BethanyDuMontelle Nov 28, 2017
1d25d13
added more comments and improved each room description
BethanyDuMontelle Nov 29, 2017
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
9 changes: 8 additions & 1 deletion Lab 01 - Calculator/lab_01_part_a.py
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
#
#!/usr/bin/env python3
# 1.1 Lab Part A
# Bethany DuMontelle
#1 November 2017

fahrenheit_temp = int(input('Enter temperature in Fahrenheit: '))
celsius_temp = ( ((fahrenheit_temp) - 32) / 1.8 )
print(celsius_temp)
14 changes: 13 additions & 1 deletion Lab 01 - Calculator/lab_01_part_b.py
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
#
#!/usr/bin/env python3
# Lab B Chapter 1
#Bethany DuMontelle
#1 November 2017

print('Area of a trapezoid')
trap_height = int(input("Enter the height of the trapezoid: "))
trap_bbase = int(input('Enter the ength of the bottom base: '))
trap_tbase = int(input('Enter the length of the top base: '))

trap_area = 1/2 * (( (trap_bbase) + (trap_tbase) ) * (trap_height))

print(str(trap_area))
15 changes: 14 additions & 1 deletion Lab 01 - Calculator/lab_01_part_c.py
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
#
#!/usr/bin/env python3
#Chapter 1 Lab Part C
#Bethany DuMontelle
#2 November 2017

PI = int(3.141592654)

print('Area of a circle')

circle_radius = int(input('What is the radius of the circle? '))

circle_area = ( (PI) * (circle_radius) ** 2 )

print(circle_area)
84 changes: 83 additions & 1 deletion Lab 03 - Create a Quiz/main_program.py
Original file line number Diff line number Diff line change
@@ -1 +1,83 @@
#
#!/usr/bin/env python3
#Chapter 3 quiz
#Bethany DuMontelle
#3 November 2017

print('Time for a quiz! Are you ready?')
print()

#Sets up score
score = int(0)

#q1
question_one = int(input('How many pokemon are there as of \
2017, not including other forms? '))

if question_one == 802:
score = score + 1
print('Correct!')
else:
print('Incorrect! There are currently 802 pokemon.')
print()

#q2
print("What does pikachu's shiny look like?")
print('A. Blue')
print('B. Light yellow')
print('C. Dark yellow')
question_two = input()
if question_two.lower() == 'c':
score = score + 1
print('Correct!')
else:
print('Incorrect! Pikachu is dark yellow when shiny.')
print()

#q3
print('Which of these pokemon are considered to have the worst shiny of \
all time?')
print('A. Pikachu')
print('B. Garchomp')
print('C. Charizard')
question_three = input()
if question_three.lower() == 'b':
score = score + 1
print('Correct!')
else:
print('Incorrect! Garchomp is thought to have the worst shiny ever.')
print()

#q4
print('As of generation 6, what are the odds of finding a shiny pokemon? ')
question_four = int(input('1 in '))
if question_four == 4096:
score = score + 1
print('Correct!')
elif question_four == 8192:
print('Wrong generation! It is now 1 in 4096.')
else:
print('Incorrect! The odds are 1 in 4096.')
print()

#q5
print('True or false: pokemon can change their shinies when mega-evolved.')
question_five = input()
if question_five.lower() == 'true':
score = score + 1
print('Correct!')
else:
print('Incorrect! Some do change their shinies when mega-evolved.')
print()

#results
percent = (int(score) / 5) * 100
print('Your total score is', str(score) + ' out of 5.')
print('This is also ' + str(percent) + ' percent.')
if score == 0 or score == 1:
print('You didn\'t do very well.')
elif score == 2 or score == 3:
print('Not very good, but not that bad either.')
elif score == 4:
print('Pretty good!')
else:
print('You did fantastic!')
139 changes: 138 additions & 1 deletion Lab 04 - Camel/main_program.py
Original file line number Diff line number Diff line change
@@ -1 +1,138 @@
#
#!/usr/bin/env python3
#Lab 4 chapter 4 Camel
#Bethany DuMontelle
#3 November 2017

from random import randint

#sets up the variables needed
miles_left = 0
natives_range = -20
user_thirst = 0
canteen = 3
camel_rest = 0
done = False

#Introduces the player
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! Survive')
print('your desert trek and out run the natives.')

#begins the loop
while done != True:
#tells the player how close they are, stops negative numbers from showing
native_close = (miles_left) - (natives_range)

#sets up if an oasis can be found every time the loop starts over
oasis = randint(1,15)

#tells the player important information
print('You have traveled', str(miles_left), 'miles.')

if native_close < 15:
print('The natives getting close!')
else:
print('The Natives are', str(native_close), 'miles away from you.')

print('You have', str(canteen), 'drinks left in your canteen.')

if user_thirst >= 4:
print('You are thirsty!')

if camel_rest >= 5:
print('The camel is getting tired!')


print('What would you like to do?')
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')

user_choice = input()

#allows the player to drink from their canteen
#also prevents players from drinking water they don't have
if user_choice.lower() == 'a':
if canteen <= 0:
print('You don\'t have any more water!')
else:
user_thirst = user_thirst - 1
canteen = canteen - 1

#moves the player, also can find an oasis if the random number was 1
elif user_choice.lower() == 'b':
miles_move = randint(5,12)
miles_left = (miles_left) + (miles_move)
natives_move = randint(7,14)
natives_range = (natives_range) + (natives_move)
camel_rest = (camel_rest) + 1
user_thirst = user_thirst + 1
print('You moved', + (miles_move), 'miles.')
if oasis == 1:
canteen_fill = randint(2,5)
canteen = (canteen) + (canteen_fill)
user_thirst = user_thirst + 2
print('You found an oasis!')
print('You can now drink', (canteen_fill), 'more times.')

#also moves the player, but with more random elements and an oasis can
#be found as well
elif user_choice.lower() == 'c':
miles_move = randint(10,20)
miles_left = (miles_left) + (miles_move)
natives_move = randint(7,14)
natives_range = (natives_range) + (natives_move)
camel_tired = randint(1,3)
camel_rest = (camel_rest) + (camel_tired)
user_thirst = user_thirst + 1
print('You moved', + (miles_move), 'miles.')
if oasis == 1:
canteen_fill = randint(2,5)
canteen = (canteen) + (canteen_fill)
user_thirst = user_thirst + 2
print('You found an oasis!')
print('You can now drink', (canteen_fill), 'more times.')

#sets camel_rest to 0, moves the natives up as well
elif user_choice.lower() == 'd':
camel_rest = 0
natives_move = randint(7,14)
natives_range = (natives_range) + (natives_move)
print('The camel is happy.')

#gives the player more stats
elif user_choice.lower() == 'e':
print('Miles left:', 200 - (miles_left))
print('Native distance:', (native_close))
print('Canteen drinks:', str(canteen))
print('Days until water is needed:', 6 - (user_thirst))
print('Camel tiredness:', (camel_rest), 'out of 8')

#ends the game
elif user_choice.lower() == 'q':
print('You gave up. Your family is disappointed in you.')
done = True

#winning conditon
if miles_left >= 200:
print('You made it across the Mobi desert! Congradulations!')
done = True

#way to lose
if user_thirst >= 6:
print('You died of thirst! Game over!')
done = True

#another way to lose
if camel_rest >= 8:
print('Your camel died! Game over!')
done = True

#yet another way to lose
if natives_range >= miles_left:
print('The Natives got you! Game over!')
done = True
77 changes: 76 additions & 1 deletion Lab 05 - Create a Picture/main_program.py
Original file line number Diff line number Diff line change
@@ -1 +1,76 @@
#
#!/usr/bin/env python3
#Lab 5 Draw a Picture
#Bethany DuMontelle
#8 November 2017

#Starts up pygame
import pygame
pygame.init()

#Establishes colors
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
LIGHT_GREEN = (74, 224, 129)
LIGHT_BLUE = (52, 198, 247)
DEEP_PURPLE = (79,18,201)
SKY = (235, 193, 96)
SUN_YELLOW = (246, 255, 0)
SUN_RING = (219, 222, 95)
PANK = (235, 103, 226)
RED = (224, 13, 52)

size = (800, 800)
screen = pygame.display.set_mode(size)

done = False
while not done:

#changes background color
screen.fill(SKY)

#Makes the ocean
pygame.draw.rect(screen, LIGHT_BLUE, [0, 350, 800, 800], 0)

#Creates ring around the sun
pygame.draw.circle(screen, SUN_RING, [10, 10], 140, 0)

#Creates the sun
pygame.draw.circle(screen, SUN_YELLOW, [10, 10], 100, 0)

#octopus legs
pygame.draw.line(screen, DEEP_PURPLE, [300, 350], [125, 500], 40)
pygame.draw.line(screen, DEEP_PURPLE, [300, 380], [220, 600], 40)
pygame.draw.line(screen, DEEP_PURPLE, [340, 380], [300, 620], 40)
pygame.draw.line(screen, DEEP_PURPLE, [380, 380], [360, 590], 40)
pygame.draw.line(screen, DEEP_PURPLE, [420, 380], [420, 625], 40)
pygame.draw.line(screen, DEEP_PURPLE, [460, 380], [480, 595], 40)
pygame.draw.line(screen, DEEP_PURPLE, [500, 380], [550, 585], 40)
pygame.draw.line(screen, DEEP_PURPLE, [510, 350], [630, 570], 40)

#octopus body
pygame.draw.ellipse(screen, DEEP_PURPLE, [275, 200, 250, 275], 0)

#octopus eyes
pygame.draw.ellipse(screen, WHITE, [335, 300, 35, 35], 0)
pygame.draw.ellipse(screen, BLACK, [340, 310 , 25, 25], 0)
pygame.draw.ellipse(screen, WHITE, [435, 300, 35, 35], 0)
pygame.draw.ellipse(screen, BLACK, [440, 310 , 25, 25], 0)

#octopus mouth
pygame.draw.polygon(screen, PANK, [[400, 420], [440, 360], [360, 360]], 0)
pygame.draw.polygon(screen, RED, [[400, 412], [420, 380], [380, 380]], 0)

#Seaweed
x_offset = 20
while x_offset < 780:
pygame.draw.line(screen, LIGHT_GREEN, [20 + x_offset, 600],\
[20 + x_offset, 800], 15)
x_offset = x_offset + 40

#updates the screen to show the picture
pygame.display.update()

for event in pygame.event.get():
if event.type == pygame.QUIT:
done = True
pygame.quit()
17 changes: 17 additions & 0 deletions Lab 06 - Loopy Lab/part_1.py
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
#!/usr/bin/env python3
#Lab Part 1
#Bethany DuMontelle
#15 November 2017

#Establish starting number
start = 10

#loops it 9 times
for numbers in range(9):

#adds 1 plus the range when it does down
for down in range(numbers + 1):
print( start , end = ' ')
start += 1

#new print statement at the end
print()
22 changes: 21 additions & 1 deletion Lab 06 - Loopy Lab/part_2.py
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
#
#!/usr/bin/env python3
#Lab Part 2
#Bethany DuMontelle
#15 November 2017

#ask user for number of zeros
number = int(input('How many o\'s? '))

#spaces used later
spaces = (number * 2) - 2

#print zeros times number times 2
print('o' * ((number) * 2))

#loop the number of times the user asked - 2 with o's, add the spaces from
#earlier, then add another o
for o1 in range(1, number - 1):
print('o' + (' ' * spaces) + 'o')

#repeat zeros on bottom
print('o' * ((number) * 2))
Loading