Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
1c2961f
Added the answers
JeLyles Nov 2, 2017
03042d8
Added answer
JeLyles Nov 2, 2017
d70bc31
Added answer
JeLyles Nov 2, 2017
80f776d
Added answer
JeLyles Nov 2, 2017
84cc1cb
Added answers
JeLyles Nov 2, 2017
c030c8c
Added answers
JeLyles Nov 2, 2017
93089eb
Completed Chapter 3
JeLyles Nov 3, 2017
b2e18ce
Not Finished, Last Problem
JeLyles Nov 3, 2017
780b4e8
Finished worksheet 4
JeLyles Nov 6, 2017
489a3c4
Finished Chapter 4 Lab
JeLyles Nov 6, 2017
ac47ae0
Finished Chapter 4 Lab
JeLyles Nov 6, 2017
9c0b03b
Finished Chapter 5 Worksheet
JeLyles Nov 6, 2017
da5841c
Fixed Answer
JeLyles Nov 6, 2017
d6cca30
Completed Lab
JeLyles Nov 7, 2017
d65a200
Completed Chapter 5
JeLyles Nov 7, 2017
a81babc
Chapter 5 Lab
JeLyles Nov 7, 2017
3839f7d
Merge branch 'master' of https://github.com/JeLyles/program-arcade-games
JeLyles Nov 7, 2017
091069f
Chapter 4 Lab
JeLyles Nov 7, 2017
0d4c4d6
Chapter 2 report
JeLyles Nov 9, 2017
45b9a63
Changed Answer
JeLyles Nov 9, 2017
6b81fcc
Merge branch 'master' of https://github.com/LewisAndClark-CSD/program…
JeLyles Nov 13, 2017
a3333a0
Adding Chapter 6
JeLyles Nov 13, 2017
352bb01
Problems 1-4 Worksheet 6
JeLyles Nov 14, 2017
d828672
Questions 5-8 Worksheet 6
JeLyles Nov 15, 2017
8dfaa6a
Got the numbers into the triangle form.
JeLyles Nov 15, 2017
cfc2471
Set and used 'start' variable to print the right numbers.
JeLyles Nov 15, 2017
1e1a295
Made input statement with int() to only accept #'s
JeLyles Nov 15, 2017
b479d55
Set up a loop to print an amount of o's times two dependng on input
JeLyles Nov 15, 2017
d96fcaa
Made bottom line of o's
JeLyles Nov 15, 2017
6bd0916
Got the ex. n = 3 working, need to figure how to do it based on userI…
JeLyles Nov 16, 2017
e0667f0
Fixed loop and added variable to make program work for all userInputs…
JeLyles Nov 16, 2017
9651fe1
Switched screen from white to black.
JeLyles Nov 16, 2017
1d59997
Finished Part 4
JeLyles Nov 16, 2017
138e98d
Finished Chapter 7 Worksheet
JeLyles Nov 17, 2017
cfbffd8
Set up room variables.
JeLyles Nov 20, 2017
f46eb3c
Added descriptions, variables named done and user_choice, and while l…
JeLyles Nov 20, 2017
1355709
Working on the if statements.
JeLyles Nov 20, 2017
c8d1ef4
Completed if statements.
JeLyles Nov 20, 2017
73de6f5
Added /n to seperate lines. Finished Lab 7.
JeLyles Nov 20, 2017
f9f87c1
Added description of the game
JeLyles Nov 28, 2017
5483b28
Removed exit descriptions.
JeLyles Nov 28, 2017
ac9ca60
removed print statement
JeLyles Nov 28, 2017
3cdbf33
Changed and added to description
JeLyles Nov 28, 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
5 changes: 4 additions & 1 deletion Lab 01 - Calculator/lab_01_part_a.py
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
#
# This will transfer Fahrenheit to Celsius
fahrenheit = int(input('Enter temperature in Fahrenheit: '))
fahrenheit = (fahrenheit -32) * 5/9
print('The temperature in Celsius:', fahrenheit)
9 changes: 8 additions & 1 deletion Lab 01 - Calculator/lab_01_part_b.py
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
#
# This will print the area of a trapezoid
print('Area of a trapezoid')
height = int(input('Enter the height of the trapezoid: '))
bottomLength = int(input('Enter the length of the bottom base: '))
topLength = int(input('Enter the length of the top base: '))
area = 1/2 * (bottomLength + topLength) * height
print('The area is:', area)

6 changes: 5 additions & 1 deletion Lab 01 - Calculator/lab_01_part_c.py
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
#
# This will print the area of a circle
print('Area of a circle')
radius = int(input('Enter the radius: '))
area = 3.14 * (radius**2)
print('The area is:', area)
12 changes: 11 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,11 @@
Report goes here
Name: Lyles
Date: November 8, 2017
Video Name: Triumph of the Nerds

Woops?
The “Triumph of the Nerds” is a documentary about the history behind computers and programming. The settings they had chosen for each ‘scene’ of the film intrigued me from the beginning.
They began the film at a basketball game. I learned they were there due to the man, Paul Allen, who owned the building and basketball team. It turns out he had worked together with Bill Gates, who I had previously thought worked alone (or at least mainly with the idea of Microsoft solely). Both of them were the creators of the Microsoft company, but Bill Gates is obviously more well known as its’ CEO. Microsoft’s original creation was based to make software for the Altair 8800, which I found interesting as they started off at something so simple yet now Microsoft is one of the biggest computer companies around the world.
Shortly into the documentary, they had a section where they were showing off this young boy who had been into computers and technology ever since he was little. One of the things they had stated was that computing was a “boy thing”, as there were never girls around or interested in this type of thing. I believe this was and is very wrong, there most likely was women and girls interested but were unable to be a part of it due to certain/different circumstances. Grace Hopper helped prove this “boy thing” wrong. She had created the first computer language, called Coball, which I thought was a strange name and wonder how she came up with it. Computers and programming has and will continue getting better with the help of women. Society has improved immensely on the treatment and inclusion of women in environments and careers that are typically male-dominated.
“Triumph of the Nerds” also spoke about how the Altair 8800 came to be. It was created when Robert’s company, MITS, was going under in debt. The Altair 8800 was hyped up and seen as this amazing invention before it even started selling. The film’s narrator showed the 2nd made Altair 8800. This was because when the 1st Altair 8800 was sent to have its’ photo taken for a magazine, it got lost in the mail. I thought that was really interesting and quite funny because this huge invention is ready to be announced and sell to people, and it just gets lost. I was curious to see if the 1st Altair 8800 was ever found, but unfortunately it had been shipped when Railway Express had went on strike and eventually bankrupt, losing the computer forever. Afterwards, though, MITS began selling the Altair 8800 and it skyrocketed. Sales were over 200 everyday, and Robert’s could finally pay off his debts.
Something that caught my eye was the coder’s process and their living environment. They all basically lived together in their programming offices, and lived off of bad hygiene, coca-cola, and cold pizza. There was no certain schedule of when they had to work and when their breaks were, they just simply had to work the 80 hours per week. Personally, I find it gross whenever they had said that they didn’t like anything that took away time from programming, such as showering or other hygienics, because while programming is big and amazing you still need to take care of your body and your health. Coca-cola and cold pizza diets certainly did not help, but I cannot talk because I also eat lots of fast food, and drink Dr. Pepper daily. The programmers, though, would constantly share their finds or problems throughout the process of making them. This helped make it possible to have the huge sharing we have between programmers and coders today, like how we also pair up for projects.
Lastly, the main thing that I really enjoyed was the fact this all started with an accident that was made attempting to impress friends. Life is unexpected, and we do things that we didn’t expect or want to do, but sometimes this can lead to amazing things. Gates and Allen are both billionaires due this “accident.” Just because something doesn’t necessarily go your way at the start doesn’t mean it won’t work out in the end. People will always find a way to fix problems, and better today’s technology and society. Accidents aren’t always accidents.
56 changes: 56 additions & 0 deletions Lab 03 - Create a Quiz/main_program.py
Original file line number Diff line number Diff line change
@@ -1 +1,57 @@
#
print("Welcome to Lyles' Quiz!")
result = 0
question1 = print('Question 1: What is 4 + 2?')
print('A. 4')
print('B. 2')
print('C. 6')
answer1 = input('Answer: ')
if answer1 == 'C':
print('Correct')
result = result + 1
else:
print('Incorrect')



question2 = print('Question 2: What does USA stand for?')
print('A. United States America')
print('B. United States of America')
print('C. Undergoing Software Adaptations')
answer2 = input('Answer: ')
if answer2 == 'B':
print('Correct')
result = result + 1
else:
print('Incorrect')
question3 = print("Question 3: Who is North Korea's leader?: ")
print('A. Kim Jong-un')
print('B. Donald Trump')
print('C. Trick Question?')
answer3 = input('Answer: ')
if answer3 == 'A':
print('Correct')
result = result + 1
else:
print('Incorrect')
question4 = print('What is 43 times 2?: ')
print('A. 87')
print('B. 85')
print('C. 86')
answer4 = input('Answer: ')
if answer4 == 'C':
print('Correct')
result = result + 1
else:
print('Incorrect')
question5 = print('Which actor was in "The Breakfast Club"?')
print('A. Judd Nelson')
print('B. Brad Pitt')
print('C. Megan Fox')
answer5 = input('Answer: ')
if answer5 == 'A':
print('Correct')
result = result + 1
else:
print('Incorrect')
print('Total Answers Correct:', result)
70 changes: 69 additions & 1 deletion Lab 04 - Camel/main_program.py
Original file line number Diff line number Diff line change
@@ -1 +1,69 @@
#
#Camel Coding Game

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 your desert trek and out run the natives.')

traveledMiles = 0
thirst = 0
camelTiredness = 0
nativesTraveled = -20
canteenDrinks = 20
import random

done = False
while done == False:
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('What is your choice? ')
if user_choice.upper() == 'Q':
done = True
elif user_choice.upper() == 'E':
print('Miles traveled:', traveledMiles)
print('Drinks in canteen:', canteenDrinks)
print('The natives are', nativesTraveled, 'miles behind you.')
elif user_choice.upper() == 'D':
camelTiredness = 0
print('The camel is happy!')
nativesTraveled += random.randint(7, 15)
elif user_choice.upper() == 'C':
traveledMiles += random.randint(10, 21)
print('Miles traveled:', traveledMiles)
thirst += 1
camelTiredness += random.randint(1, 4)
nativesTraveled += random.randint(7, 15)
elif user_choice.upper() == 'B':
traveledMiles += random.randint(5, 13)
print('Miles traveled:', traveledMiles)
thirst += 1
camelTiredness += 1
nativesTraveled += random.randint(7, 15)
elif user_choice.upper() == 'A':
if canteenDrinks > 0:
canteenDrinks -= 1
print('Drinks in canteen:', canteenDrinks)
thirst = 0
else:
print('Error: no drinks in canteen.')

if thirst > 4:
print('You are thirsty.')
elif thirst > 6:
print('You died of thirst!')
done = True
if camelTiredness > 5:
print('Your camel is getting tired.')
elif camelTiredness > 8:
print('Your camel is dead.')
if nativesTraveled == 0:
print("You've been caught! Game over, try again.")
done = True
elif nativesTraveled <= -15:
print('The natives are getting close!')
if traveledMiles == 200:
print('You won! Game over, play again!')
done = True
109 changes: 108 additions & 1 deletion Lab 05 - Create a Picture/main_program.py
Original file line number Diff line number Diff line change
@@ -1 +1,108 @@
#
<<<<<<< HEAD
#Destroy The City Pygame
=======
#Destroy The City PyGame
>>>>>>> d65a200f26d213f86446b9aa3fa7733773ae286a

import pygame

WHITE = (255, 255, 255)
GREEN = (144, 212, 178)
PINK = (209, 21, 184)
BLUE = (75, 51, 232)
YELLOW = (226, 232, 51)
BLACK = (0, 0, 0)
BROWN = (87, 59, 23)
PI = 3.141592653

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("Destroy The City")

# 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

# If you want a background image, replace this clear with blit'ing the
# background image.
screen.fill(BLACK)

# Draw a rectangle
pygame.draw.rect(screen, BLUE, [120, 150, 100, 200])
pygame.draw.rect(screen, BLUE, [470, 150, 100, 200])
pygame.draw.rect(screen, GREEN, [580, 150, 100, 200])
pygame.draw.rect(screen, GREEN, [10, 150, 100, 200])
# The top row of 'windows' on the buildings
pygame.draw.rect(screen, YELLOW, [20, 170, 30, 20])
pygame.draw.rect(screen, YELLOW, [70, 170, 30, 20])
pygame.draw.rect(screen, YELLOW, [130, 170, 30, 20])
pygame.draw.rect(screen, YELLOW, [180, 170, 30, 20])
pygame.draw.rect(screen, YELLOW, [480, 170, 30, 20])
pygame.draw.rect(screen, YELLOW, [530, 170, 30, 20])
pygame.draw.rect(screen, YELLOW, [590, 170, 30, 20])
pygame.draw.rect(screen, YELLOW, [640, 170, 30, 20])
# The middle row of 'windows' on the buildings
pygame.draw.rect(screen, YELLOW, [20, 220, 30, 20])
pygame.draw.rect(screen, YELLOW, [70, 220, 30, 20])
pygame.draw.rect(screen, YELLOW, [130, 220, 30, 20])
pygame.draw.rect(screen, YELLOW, [180, 220, 30, 20])
pygame.draw.rect(screen, YELLOW, [480, 220, 30, 20])
pygame.draw.rect(screen, YELLOW, [530, 220, 30, 20])
pygame.draw.rect(screen, YELLOW, [590, 220, 30, 20])
pygame.draw.rect(screen, YELLOW, [640, 220, 30, 20])
# The bottom row of 'windows' on the buildings
pygame.draw.rect(screen, YELLOW, [20, 270, 30, 20])
pygame.draw.rect(screen, YELLOW, [70, 270, 30, 20])
pygame.draw.rect(screen, YELLOW, [130, 270, 30, 20])
pygame.draw.rect(screen, YELLOW, [180, 270, 30, 20])
pygame.draw.rect(screen, YELLOW, [480, 270, 30, 20])
pygame.draw.rect(screen, YELLOW, [530, 270, 30, 20])
pygame.draw.rect(screen, YELLOW, [590, 270, 30, 20])
pygame.draw.rect(screen, YELLOW, [640, 270, 30, 20])
# The 'doors' on the buildings'
pygame.draw.rect(screen, BROWN, [35, 300, 50, 50])
pygame.draw.rect(screen, BROWN, [145, 300, 50, 50])
pygame.draw.rect(screen, BROWN, [495, 300, 50, 50])
pygame.draw.rect(screen, BROWN, [605, 300, 50, 50])

# Draw an arc as part of an ellipse.
# Use radians to determine what angle to draw.
pygame.draw.arc(screen, WHITE, [220, 150, 250, 200], 0, PI / 2, 2)
pygame.draw.arc(screen, GREEN, [220, 150, 250, 200], PI / 2, PI, 2)
pygame.draw.arc(screen, BLUE, [220, 150, 250, 200], PI, 3 * PI / 2, 2)
pygame.draw.arc(screen, YELLOW, [220, 150, 250, 200], 3 * PI / 2, 2 * PI, 2)

# Select the font to use, size, bold, italics
font = pygame.font.SysFont('Calibri', 25, True, False)

# Render the text. "True" means anti-aliased text.
# White is the color. This creates an image of the
# letters, but does not put it on the screen
text = font.render("Button to Destroy All", True, WHITE)

# Put the image of the text on the screen at 245x240
screen.blit(text, [245, 240])

pygame.display.flip()

# --- Limit to 60 frames per second
clock.tick(60)

# Close the window and quit.
<<<<<<< HEAD
pygame.quit()
=======
pygame.quit()
>>>>>>> d65a200f26d213f86446b9aa3fa7733773ae286a
14 changes: 14 additions & 0 deletions Lab 06 - Loopy Lab/part_1.py
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
#!/usr/bin/env python3
# Chapter 6 Lab Part 1
# Jessica Lyles
# 11/15/2017

# Variable for start
start = 10
# Do 9 times starting at 10 (row)
for i in range(9):
# Loop to print the digits
for j in range(i + 1):
print(start, end=' ')
start += 1
#print new line
print()
25 changes: 24 additions & 1 deletion Lab 06 - Loopy Lab/part_2.py
Original file line number Diff line number Diff line change
@@ -1 +1,24 @@
#
#!/usr/bin/env python3
# Chapter 6 Lab Part 2
# Jessica Lyles
# 11/15/2017

# User Input for value of n/how many o's (row wise not column)
userInput = int(input('Please enter a value for n: '))
# Variable for spaces between
spaces = (userInput*2) - 2
# Loop to print top line of o's
for i in range(userInput):
print('o'*2, end = '')
# Print new line
print()
# Loop to print o's between
for row in range(1, userInput - 1):
print('o' + (' ' * spaces) + 'o')
# Loop to print bottom line of o's
for j in range(userInput):
print('o'*2, end = '')




66 changes: 65 additions & 1 deletion Lab 06 - Loopy Lab/part_4.py
Original file line number Diff line number Diff line change
@@ -1 +1,65 @@
#
"""
Pygame base template for opening a window

Sample Python/Pygame Programs
Simpson College Computer Science
http://programarcadegames.com/
http://simpson.edu/computer-science/

Explanation video: http://youtu.be/vRB_983kUMc
"""

import pygame

# Define some colors
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
GREEN = (0, 255, 0)
RED = (255, 0, 0)

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 Game")

# 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

# --- Game logic should go here


# --- Screen-clearing code goes here

# Here, we clear the screen to white. Don't put other drawing commands
# above this, or they will be erased with this command.

# If you want a background image, replace this clear with blit'ing the
# background image.
screen.fill(BLACK)

# --- Drawing code should go here
for y in range(0, 500, 20):
for x in range(0, 700, 20):
pygame.draw.rect(screen, GREEN, (x, y, 10, 10))

# --- Go ahead and update the screen with what we've drawn.
pygame.display.flip()

# --- Limit to 60 frames per second
clock.tick(60)

# Close the window and quit.
pygame.quit()
Loading