Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
63719d4
Done with lab 01
Nov 1, 2017
0cd73df
Finished worksheet_01
Nov 1, 2017
f3dac16
Completed Lab 03
Nov 2, 2017
674b522
Completed Lab 03
Nov 2, 2017
5a4bc31
Completed Lab 03
Nov 2, 2017
c57477c
Completed worksheet_02
Nov 3, 2017
c873a47
Completed Lab 04
Nov 3, 2017
b5d188e
Added comments to Lab 04
Nov 3, 2017
b83612b
Completed Worksheet 03
Nov 3, 2017
1b4d276
Completed Worksheet 04
Nov 4, 2017
3f3047c
Work on worksheet 03
Nov 6, 2017
a5d9a32
Merge https://github.com/Sthomp123/program-arcade-games
Nov 6, 2017
4f3d72d
Finished chapter 5 worksheet
Nov 6, 2017
b75a09e
Fixed some bugs with lab 04
Nov 6, 2017
28dd89a
Completed Lab 05
Nov 8, 2017
fd0a9a9
Completed Chapter 2 lab
Nov 13, 2017
5ec2c82
Merge branch 'master' of https://github.com/LewisAndClark-CSD/program…
Nov 13, 2017
98f62e3
Problems 1 - 4 worksheet6
Nov 14, 2017
15e2e07
Completed questions 5 - 8
Nov 15, 2017
aaba1aa
Completed lab part_1
Nov 15, 2017
df7a0ec
Made loop that draws the top line
Nov 15, 2017
8d5e22c
Made loop that draws the bottom line and line on side
Nov 15, 2017
dd890b0
Made final loop for spaces and completed the part
Nov 15, 2017
193d139
Pasted the given pygame template.
Nov 16, 2017
f1fa859
Added comments
Nov 16, 2017
1a46000
Made the loops and the rectangles that they make
Nov 16, 2017
8cc48f3
Completed questions 1-13
Nov 17, 2017
3d2aa63
Completed questions 14-15
Nov 17, 2017
0049597
Made room list and set done to false.
Nov 20, 2017
f16fb8f
Made room descriptions and the user can now manuever through the room…
Nov 20, 2017
db63397
removed the hardcoded 'you are in' statements from room descriptions …
Nov 29, 2017
77c94b3
Program now prints exits
Nov 29, 2017
b9b9609
Fixed indentation problem with lines that print exits
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
11 changes: 10 additions & 1 deletion Lab 01 - Calculator/lab_01_part_a.py
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
#
#!/usr/bin/evn python3
#lab_01_part_a.py
#Steven Thompson
#November 1st 2017

fahrenheit_temp = int(input("Enter temperature in Fahrenheit: "))
celcius = (fahrenheit_temp - 32) * 5/9
print("The temperature in Celcius", celcius)


12 changes: 11 additions & 1 deletion Lab 01 - Calculator/lab_01_part_b.py
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
#
#!/usr/bin/env python3
#lab_01_part_b.py
#Steven Thompson
#November 1st 2017

print("Area of a trapezoid")
height = int(input("Enter the height of the trapezoid: "))
bottom_length = int(input("Enter the length of the bottom base: "))
top_length = int(input("Enter the legnth of the top base: "))
area = (1/2)*(bottom_length + top_length)*height
print(area)
11 changes: 10 additions & 1 deletion Lab 01 - Calculator/lab_01_part_c.py
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
#
#!/usr/bin/env python3
# lab_01_part_c.py
# Steven Thompson
# November 1st 2017

print("Area of an ellipse")
radius_x = int(input("What is radius x: "))
radius_y = int(input("What is radius y: "))
area = 3.14*radius_x*radius_y
print(area)
11 changes: 10 additions & 1 deletion Lab 02 - Computer History/Chapter 2 report on video.docx
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
Report goes here
Steven Thompson
November 12th 2017

The history of computers

I watched part 3 of the Triumph of the Nerds documentary. It starts out talking about the release of Windows 95, and how the exploitation of opportunities allowed microsoft to make Bill Gates the “master of the gui universe”, but most of the ideas that came in Windows 95 were thought of over two decades ago inside of a think tank in Palo Alto that was started by Xerox.They called it PARC. It was said that out of the top 100 computer researchers in the world that 58 of them worked at PARC. That was confusing because PARC only had 50 researchers. These researchers had everything that they wanted. There was complete intellectual freedom and everyone was challenging ideas. Back in 1973, these people built a personal computer that they called the “Alto” it was never for sale and cost around $10000 to create, but if it was never built, we probably wouldn’t have windows or macintosh computers. The Alto was considered “Friendly and intuitive” it had the first gui that used a mouse to get information from the screen, it linked to other computers using ethernet, and it printed everything that was on the screen straight to a laser printer. Sadly, the researchers are PARC were unable to persuade Xerox that what they had made was the future. There was a huge mismatch between what the researchers were doing and what the managers were doing. The managers didn’t understand the vision that was getting created so there was nobody able to receive that vision.

Steve Jobs toured the Xerox PARC facility in December of 1979. He said that they showed him three things but he didn’t pay attention to anything except for the first one. He was blindsided by the graphical user interface that was shown to him. It was obvious to him that all computers would run off of a gui in the future. A gui allowed a computer to be easy for anyone to use. Steve Jobs understood what the gui meant after seeing it for just a mere hour. The PARC researchers had been showing the executives their interface for years but they just didn’t get it. Steve Jobs persuaded the Apple board to invest in technology that copied what he had seen had Xerox PARC. They started building a new computer and codenamed it “Lisa”, but Lisa got too expensive and it didn’t work properly.

The computer industry has changed drastically since this documentary was created. Graphical User Interfaces are everywhere nowadays. Steve Jobs was right about his prediction. Almost everything we do that involves technology uses a gui. The computer industry is the third largest industry in the world and it’s growing larger everyday. We are nearing a point where cars can drive themselves and we may only be a decade or two away from robots that are smarter than humans.
70 changes: 69 additions & 1 deletion Lab 03 - Create a Quiz/main_program.py
Original file line number Diff line number Diff line change
@@ -1 +1,69 @@
#
#!/usr/bin/env python3
# main_program.py
# Steven Thompson
# November 2nd 2017

""" This is a quiz """

#These are the possible answer choices for my first multiple choice question
a = "323.1 million"
b = "256.4 million"
c = "423.2 million"


#These are the messages that tell the user if they got a question right or wrong
congratulations = "Correct, Great Job!"
failure = "Incorrect, Better luck next time"

#This is an accumulator
average = 0

print("This is my awesome quiz")


#This is the first question
print("A:",a+"\n"+"B:",b+"\n"+"C:",c+"\n")
question1 = input("What is the total population of the United States? ")
if question1 == "A" or question1 == "a":
print(congratulations)
average += 1
else:
print(failure)


#This is my second question
question2 = int(input("How many movies are in the Harry Potter series? "))
if question2 == 8:
print(congratulations)
average += 1
else:
print(failure)

#This is my third question
question3 = int(input("How many champions are in league of legends? "))
if question3 == 134:
print(congratulations)
average += 1
else:
print(failure)

#This is my fourth question
question4 = input("What is the name of the green train in 'Thomas the Tank Engine'? ")
if question4 == "percy" or question4 == "Percy":
print(congratulations)
average += 1
else:
print(failure)

#This is my final question
question5 = input("What is the name of Wukong's ultimate ability in the game 'League of legends'? ")
if question5 == "Cyclone" or question5 == "cyclone":
print(congratulations)
average += 1
else:
print(failure)

print("Your average is",str(average/5*100)+"%")



143 changes: 142 additions & 1 deletion Lab 04 - Camel/main_program.py
Original file line number Diff line number Diff line change
@@ -1 +1,142 @@
#
#!/usr/bin/env python3
# main_program.py
# Steven Thompson
# November 3rd 2017

""" This is a game about making your way across the desert on a stolen camel while trying to outrun the natives"""


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!" "\n" "Survive your desert trek and out run the natives.")

#These variables are the base mechanics of the game.
total_miles_traveled = 0
miles_traveled = 0
thirst = 0
camel_tiredness = 0
drinks_in_canteen = 3
native_location = -20

#This is what keeps the game going. If it gets set to true, then the game ends.
done = False

while done == False:
#these are possible choices for your character
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.")
#this line allows you to select a choice from above.
user_choice = input("Your choice? ")
#If you select Q then the game ends.
if user_choice.upper() == "Q":
done = True

#If You select E then it will show you all the necessary stats to get you across the desert safely
elif user_choice.upper() == "E":
print("Miles Traveled:", total_miles_traveled)
print("Drinks in canteen:", drinks_in_canteen)
print("The natives are", native_location*(-1), "miles behind you.")
print("Camel tiredness:", camel_tiredness)
print("Thirst", thirst)

#If you select D then the tiredness of your camel is reset and the natives move in closer on your location
elif user_choice.upper() == "D":
camel_tiredness = 0
print("The camel is happy")
native_location += random.randint(7, 14)
if native_location >= 0:
print("The natives have caught you")
done = True
if -10 <= native_location <= -15:
print("The natives are getting close!")
if -8 <= native_location <= -2:
print("The natives are getting really close!")

#If you select C then you will move a random integer between 10 and 20 forward and there is also a 1 in 20 chance of finding an oasis
elif user_choice.upper() == "C":
miles_traveled += random.randint(10,20)
print("You traveled",miles_traveled,"miles")
total_miles_traveled += miles_traveled
native_location += random.randint(7,14) - miles_traveled
miles_traveled = 0
thirst += 2
camel_tiredness += 2
if 4<= thirst <= 6:
print("You are thirsty.")
if thirst > 6:
print("You died of thirst!")
done = True
if 5<= camel_tiredness >=8:
print("Your camel is getting tired.")
if camel_tiredness > 8:
print("Your camel is dead.")
done = True
if total_miles_traveled >= 200:
print("You have won! Good Job")
done = True
if native_location >= 0:
print("The natives have caught you")
done = True
if -10 <= native_location <= -15:
print("The natives are getting close!")
if -8 <= native_location <= -2:
print("The natives are getting really close!")
oasis = random.randint(1,20)
lucky_oasis_number = 5
if oasis == lucky_oasis_number:
print("You found the oasis")
thirst = 0
camel_tiredness = 0
drinks_in_canteen = 4

#If you select B then you will move forward a random integer between 5 and 12. This also has a 1 in 20 chance of finding an oasis
elif user_choice.upper() == "B":
miles_traveled += random.randint(5,12)
print("You traveled",miles_traveled,"miles.")
total_miles_traveled += miles_traveled
native_location += random.randint(7,14) - miles_traveled
miles_traveled = 0
thirst += 1
camel_tiredness += 1
if 4<= thirst <= 6:
print("You are thirsty.")
if thirst > 6:
print("You died of thirst!")
done = True
if 5<= camel_tiredness >=8:
print("Your camel is getting tired.")
if camel_tiredness > 8:
print("Your camel is dead.")
done = True
if total_miles_traveled >= 200:
print("You have won! Good Job")
done = True
if native_location >= 0:
print("The natives have caught you")
done = True
if -10 <= native_location <= -15:
print("The natives are getting close!")
if -5 <= native_location <= -2:
print("The natives are getting really close!")
oasis = random.randint(1,20)
lucky_oasis_number = 5
if oasis == lucky_oasis_number:
print("You found the oasis")
thirst = 0
camel_tiredness = 0
drinks_in_canteen = 4

#if you select A then you will take a drink from your canteen
elif user_choice.upper() == "A":
if drinks_in_canteen > 0:
drinks_in_canteen = drinks_in_canteen - 1
thirst = 0
print("You have", drinks_in_canteen, "drinks left.")
else:
print("You're out of water")
98 changes: 97 additions & 1 deletion Lab 05 - Create a Picture/main_program.py
Original file line number Diff line number Diff line change
@@ -1 +1,97 @@
#
#!/usr/bin/env python3
# main_program.py
# Steven Thompson
# November 6 2017

""" This program draws a house in the dark """

import pygame
import random

# Define some colors
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
GREEN = (0, 255, 0)
RED = (255, 0, 0)
DARK_BLUE = (13, 7, 124)
GROUND_GREEN = (14,104,16)
BRICK = (132, 67, 54)
CHIMNEY = (124, 25, 1)
GRAY = (124, 122, 122)

pygame.init()

# Set the width and height of the screen [width, height]
size = (700, 500)
screen = pygame.display.set_mode(size)

pygame.display.set_caption("My picture")

# Loop until the user clicks the close button.
done = False

# Used to manage how fast the screen updates
clock = pygame.time.Clock()

# -------- Main Program Loop -----------
while not done:
# --- Main event loop
for event in pygame.event.get():
if event.type == pygame.QUIT:
done = True



screen.fill(WHITE)



#This draws the ground and the sky
pygame.draw.rect(screen, GROUND_GREEN,[0,0,700,500])
pygame.draw.rect(screen, DARK_BLUE,[0,0,700,250])


#This draws the sun
pygame.draw.circle(screen, WHITE, (650, 60), 40, 0)


#This draws the snow around the house
for snow_y in range(500):
snow_x = random.randint(1,700)
pygame.draw.circle(screen, WHITE,(snow_x,snow_y), 1,0)


#This draws the house
pygame.draw.rect(screen, BRICK, [200,100, 200, 150],0)

#This draws the first window to the house
pygame.draw.rect(screen, BLACK, [220, 125, 50, 50], 0)

#This draws the second window to the house
pygame.draw.rect(screen, BLACK, [320, 125, 50, 50], 0)

#This draws the door to the house
pygame.draw.rect(screen, BLACK, [270, 200, 50, 50], 0)


#This draws the smoke for the chimney
for smoke_y in range(0,51):
smoke_x = random.randint(355,370)
pygame.draw.circle(screen, GRAY, (smoke_x,smoke_y), 10, 0)
#This draws the chimney
pygame.draw.rect(screen, CHIMNEY, [350,50, 25, 50], 0)


#This draws the roof of my house
pygame.draw.polygon(screen, BLACK, [[300,25], [200,100], [400,100]],0)



#Updates the screen with what is drawn
pygame.display.flip()

#limits framerate to 60
clock.tick(60)

# Close the window and quit.
pygame.quit()
12 changes: 12 additions & 0 deletions Lab 06 - Loopy Lab/part_1.py
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
#!/usr/bin/env python3
# part_1.py
#Steven Thompson
#November 15th 2017

""" This program prints a triangle made out of numbers """

number = 9
for i in range(number+1):
for j in range(i):
number += 1
print(number, end= " ")
print()
Loading