Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
ef64f1d
Initial commit
B-gann21 Dec 8, 2021
5fecba8
Complete numbers
B-gann21 Dec 8, 2021
f39cb4b
Complete booleans
B-gann21 Dec 8, 2021
9a61b4a
Complete variables
B-gann21 Dec 8, 2021
c88c128
Complete Interpolation
B-gann21 Dec 8, 2021
82b4fed
Finish section1 exercises
B-gann21 Dec 8, 2021
10a7f28
Finish section 1 entirely
B-gann21 Dec 8, 2021
51cc21e
Complete section2 part A
B-gann21 Dec 8, 2021
ff29e56
Complete 'What If' and 'Else and If'
B-gann21 Dec 8, 2021
2734d79
Make adventure game
B-gann21 Dec 9, 2021
0381caf
Updated README
B-gann21 Dec 9, 2021
5855514
Finish section2 part B
B-gann21 Dec 9, 2021
e51a66f
Missed a Q in section2 part B
B-gann21 Dec 9, 2021
74c5226
Finish text adventure game
B-gann21 Dec 9, 2021
7648996
Complete section2
B-gann21 Dec 9, 2021
5c4cc1f
Complete section 3 part A
B-gann21 Dec 10, 2021
7014955
Complete Section 3
B-gann21 Dec 10, 2021
ee4e6f3
Fix typo in loops.rb
B-gann21 Dec 12, 2021
d0756d6
Complete section 4
B-gann21 Dec 12, 2021
a664958
Update reflection.md
B-gann21 Dec 12, 2021
17fd9a5
Edit haunted_maze.rb
B-gann21 Dec 13, 2021
ca552ed
Add exercises from Ruby in 100 Minutes
B-gann21 Dec 13, 2021
3794c95
Merge branch 'main' of github.com:B-gann21/backend_mod_1_prework
B-gann21 Dec 13, 2021
7a549cf
Complete Mod Zero Hero
B-gann21 Dec 13, 2021
749945d
Test if ssh still needs password
B-gann21 Dec 13, 2021
fa0c8eb
Delete ssh_test.rb
B-gann21 Dec 13, 2021
36d807f
Update README.md
B-gann21 Dec 14, 2021
58432d7
Set up calendar for mod1
B-gann21 Dec 14, 2021
fddea05
Merge branch 'main' of github.com:B-gann21/backend_mod_1_prework
B-gann21 Dec 14, 2021
7ecc2f7
Complete calendar for mod1
B-gann21 Dec 14, 2021
be38883
Testing new zsh profile
B-gann21 Dec 14, 2021
4cccf50
Complete annotations exercise
B-gann21 Dec 14, 2021
4b43e07
Refactor section2
B-gann21 Dec 14, 2021
010a873
Remove unwanted .DS_store files
B-gann21 Dec 14, 2021
d341fb9
Refactor section 3
B-gann21 Dec 14, 2021
43c29e4
Refactor section4
B-gann21 Dec 14, 2021
3c3cb62
Complete Mentorship DTR prep
B-gann21 Dec 15, 2021
483016c
Fix typo in change_protein method
B-gann21 Dec 15, 2021
2356c90
Complete Pre Teaching exercise
B-gann21 Dec 16, 2021
6ebfb3d
Complete DTR Guiding Questions
B-gann21 Dec 16, 2021
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
42 changes: 22 additions & 20 deletions final_prep/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ Congrats on making it to the Mod 0 Final Prep! Complete the final exercises belo

### Final Technical Prep

You've learned a ton about some of the core foundations of Ruby! Show us how far you've come by completing the following exercises! You will be using your work from these exercises in your first day of Mod 1!
You've learned a ton about some of the core foundations of Ruby! Show us how far you've come by completing the following exercises! You will be using your work from these exercises in your first day of Mod 1!

- [ ] Complete the [Mod Zero Hero Challenge](./mod_zero_hero.rb)
- [ ] Complete the [Annotation Challenge](./annotations.rb)
- [x] Complete the [Mod Zero Hero Challenge](./mod_zero_hero.rb)
- [x] Complete the [Annotation Challenge](./annotations.rb)

### Refactor Previous Work
You've learned A LOT over the last few weeks as it relates to technical content - chances are, you probably have some code from your previous exercises that is either sloppy, incorrect, poorly named, etc. Before starting Mod 1, we want you to `refactor` your code - which is the process of adjusting or improving your code for readability and accuracy.
You've learned A LOT over the last few weeks as it relates to technical content - chances are, you probably have some code from your previous exercises that is either sloppy, incorrect, poorly named, etc. Before starting Mod 1, we want you to `refactor` your code - which is the process of adjusting or improving your code for readability and accuracy.

Some things to consider as you refactor include...
- Are my variable names easy to understand/convey the data type they are assigned to?
Expand All @@ -19,37 +19,39 @@ Some things to consider as you refactor include...

Take your time as you go back and refactor your exercises from each section. We've included a handy checklist for you to go through below.

- [ ] I have refactored my `section1` exercises to the best of my ability
- [ ] I have refactored my `section2` exercises to the best of my ability
- [ ] I have refactored my `section3` exercises to the best of my ability
- [ ] I have refactored my `section4` exercises to the best of my ability
- [x] I have refactored my `section1` exercises to the best of my ability
- [x] I have refactored my `section2` exercises to the best of my ability
- [x] I have refactored my `section3` exercises to the best of my ability
- [x] I have refactored my `section4` exercises to the best of my ability

### Time Management Prep
In Mod 0 you've learned about different techniques for managing your time at Turing. Please create a calendar for your **first 3 weeks of Mod 1**. Feel free to make your calendar fit your style, but we suggest that your calendar should include the following:
- [ ] Standard M1 class schedule (see M1 calendar [here](https://backend.turing.io/module1/)
- [ ] Study/Project work time
- [ ] Health + Wellness
- [x] Standard M1 class schedule (see M1 calendar [here](https://backend.turing.io/module1/)
- [x] Study/Project work time
- [x] Health + Wellness

When you are finished, add screenshots of your calendar so we can provide feedback if needed!

- `Add Week 1 Screenshot Here`
- `Add Week 2 Screenshot Here`
- `Add Week 3 Screenshot Here`
<<<<<<< HEAD
- <img width="1440" alt="Screen Shot 2021-12-13 at 10 35 30 PM" src="https://user-images.githubusercontent.com/94757433/145939812-67d850e9-14c7-4202-86de-5107a5dfdfd7.png">
- <img width="1440" alt="Screen Shot 2021-12-13 at 10 35 55 PM" src="https://user-images.githubusercontent.com/94757433/145939885-636d1240-53fc-4e87-b1a3-643e7c16cc1f.png">
- <img width="1440" alt="Screen Shot 2021-12-13 at 10 35 59 PM" src="https://user-images.githubusercontent.com/94757433/145940001-55a952f1-daae-41cc-bada-6a5f5eee394d.png">
>>>>>>> 36d807f68b24e4977025ce35c09c1bab6e6c18b8

### Mentorship Prep
Mentorship is an integral part of the Turing experience and will help jumpstart your technical career. In order to get your mentor relationship started on the right foot, please complete the following deliverables:
- [ ] Complete the [Mentorship DTR Prep](https://gist.github.com/ericweissman/51965bdcbf42970d43d817818bfaef3c)
- [ ] Add link to your gist here:
- [x] Complete the [Mentorship DTR Prep](https://gist.github.com/ericweissman/51965bdcbf42970d43d817818bfaef3c)
- [x] Add link to your gist [here](https://gist.github.com/B-gann21/130441094ed0dc834ef30672154bacfb)

### Lesson Prep
You've learned a lot about how to take strong notes during Mod 0. Show us your skills while you learn how to pre-teach content for your first lesson in Mod 1!
- [ ] Complete the [Pre Teaching Practice exercise](https://gist.github.com/ericweissman/0036e8fe272c02bd6d4bb14f42fd2f79) gist
- [ ] Add a link to your gist here:
- [x] Complete the [Pre Teaching Practice exercise](https://gist.github.com/ericweissman/0036e8fe272c02bd6d4bb14f42fd2f79) gist
- [x] Add a link to your gist [here](https://gist.github.com/B-gann21/cf547c5d354c5290c14cbf097c6c3a9e)

### Group Work Prep
As part of Turing's project-based learning approach, you will often be working in pairs or larger groups. In order to set yourself (and your team) up for success, it is important to ensure you are prepared to be an equitable contributor and teammate.
- [ ] Complete the [DTR Guiding Questions](https://gist.github.com/ericweissman/c56f3a98cdce761808c21d498a52f5c6)
- [ ] Add a link to your gist here:
- [x] Complete the [DTR Guiding Questions](https://gist.github.com/ericweissman/c56f3a98cdce761808c21d498a52f5c6)
- [x] Add a link to your gist [here](https://gist.github.com/B-gann21/ede57b59a0c0d672433504df15dcac8e)

## All Done? How to Submit your M1 Prework
When you have completed *all* the activities described above, follow the steps below to submit your technical prework.
Expand Down
44 changes: 22 additions & 22 deletions final_prep/annotations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,39 @@

# Build a Bear

def build_a_bear(name, age, fur, clothes, special_power)
greeting = "Hey partner! My name is #{name} - will you be my friend?!"
demographics = [name, age]
power_saying = "Did you know that I can #{special_power}?"
built_bear = {
'basic_info' => demographics,
'clothes' => clothes,
'exterior' => fur,
'cost' => 49.99,
'sayings' => [greeting, power_saying, "Goodnight my friend!"],
'is_cuddly' => true,
def build_a_bear(name, age, fur, clothes, special_power) # creates a method called build a bear and defines what values it requires in ()
greeting = "Hey partner! My name is #{name} - will you be my friend?!" # prints the given name inside of a string to introduce itself
demographics = [name, age] # stores both name and age variables into an array called demographics
power_saying = "Did you know that I can #{special_power}?" # prints the given value for super_power in a string
built_bear = { # creates constant variables in a hash, assigns each value given by the user to a variable
'basic_info' => demographics, # puts 'demographics' variable into the 'basic info' category
'clothes' => clothes, # creares a category for the 'clothes' variable
'exterior' => fur, # puts 'fur' into the 'exterior' category
'cost' => 49.99, # assigns a cost to each bear, '49.99'
'sayings' => [greeting, power_saying, "Goodnight my friend!"], # places 1 constant saying and 2 variable sayings into their own category 'sayings'
'is_cuddly' => true, # creates a category to store whether or not the given bear is cuddly
}
end

end # tell ruby this is the end of our method, so any code beneath will not be inside the build_a_bear method
# the next 2 lines create two bears named "fluffy" and "sleepy", each with their own values set to be used by the build_a_bear method.
build_a_bear('Fluffy', 4, 'brown', ['pants', 'jorts', 'tanktop'], 'give you nightmares')
build_a_bear('Sleepy', 2, 'purple', ['pajamas', 'sleeping cap'], 'sleeping in')


# FizzBuzz

def fizzbuzz(num_1, num_2, range)
(1..range).each do |i|
if i % num_1 === 0 && i % num_2 === 0
def fizzbuzz(num_1, num_2, range) #creates a method with 3 variables to input, 'num_1', 'num_2', "range"
(1..range).each do |i| # a loop is used to iterate the same process over each number from 1 to the value given in "range"
if i % num_1 === 0 && i % num_2 === 0 # checks if the value of i is divisible by nums 1 and 2. if both are true, prints "fizzbuzz".
puts 'fizzbuzz'
elsif i % num_1 === 0
elsif i % num_1 === 0 # if only num_1 is divisibly by i, prints "fizz"
puts 'fizz'
elsif i % num_2 === 0
elsif i % num_2 === 0 # if only num_2 is divisible by i, prints "buzz"
puts 'buzz'
else
puts i
end
puts i # defaults to print the value of i, if neither num_1 or num_2 are divisible by any of the numbers from 1 up to the given range.
end # every if/else needs an end, and so does every method!
end
end

fizzbuzz(3, 5, 100)
fizzbuzz(5, 8, 400)
fizzbuzz(3, 5, 100) # tries out the fizzbuzz method on 3 and 5, from 1 to 500
fizzbuzz(5, 8, 400) # tries the method again on 5 and 8, from 1 to 400
101 changes: 75 additions & 26 deletions final_prep/mod_zero_hero.rb
Original file line number Diff line number Diff line change
@@ -1,41 +1,55 @@
# Challenge - See if you can follow the instructions and complete the exercise in under 30 minutes!

# Declare two variables - hero_name AND special_ability - set to strings

hero_name = "Epic Man"
special_ability = "super strength"
# Declare two variables - greeting AND catchphrase
# greeting should be assigned to a string that uses interpolation to include the hero_name
# catchphrase should be assigned to a string that uses interpolation to include the special_ability

greeting = "Do not fret, #{hero_name} will take care of this threat!"
catchphrase = "This fool is no match for my #{special_ability}!"
# Declare two variables - power AND energy - set to integers

power = 500
energy = 1000
# Declare two variables - full_power AND full_energy
# full_power should multiply your current power by 500
# full_energy should add 150 to your current energy

full_power = power * 500
full_energy = energy + 150
# Declare two variables - is_human and identity_concealed - assigned to booleans

is_human = true
identity_concealed = false

# Declare two variables - arch_enemies AND sidekicks
# arch_enemies should be an array of at least 3 different enemy strings
# sidekicks should be an array of at least 3 different sidekick strings

arch_enemies = ["Florida Man", "Fire Fiend", "Nougat Nemesis"]
sidekicks = ["Eletric Tiger", "Timmy Timebomb", "Gerald"]
# Print the first sidekick to your terminal

p sidekicks[0]
# Print the last arch_enemy to the terminal

p arch_enemies[2]
# Write some code to add a new arch_enemy to the arch_enemies array

arch_enemies.append "Thanos 2.0"
# Print the arch_enemies array to terminal to ensure you added a new arch_enemey

p arch_enemies
# Remove the first sidekick from the sidekicks array

sidekicks.delete_at(0)
# Print the sidekicks array to terminal to ensure you added a new sidekick

p sidekicks
# Create a method called assess_situation that takes three arguments - danger_level, save_the_day, bad_excuse
# - danger_level should be an integer
# - save_the_day should be a string a hero would say once they save the day
# - save_the_day should be a string a hero would say once they save the day
# - bad_excuse should be a string a hero would say if they are too afraid of the danger_level

def assess_situation(danger_level, save_the_day, bad_excuse)
if danger_level < 10
puts "Meh. Had pass."
elsif danger_level > 9 && danger_level <51
puts save_the_day
else
puts bad_excuse
end
end
# Your method should include an if/else statement that meets the following criteria
# - Danger levels that are above 50 are too scary for your hero. Any danger level that is above 50 should result in printing the bad_excuse to the terminal
# - Anything danger_level that is between 10 and 50 should result in printing the save_the_day string to the terminal
Expand All @@ -44,9 +58,9 @@
#Test Cases
announcement = 'Never fear, the Courageous Curly Bracket is here!'
excuse = 'I think I forgot to lock up my 1992 Toyota Coralla. Be right back.'
# assess_situation(99, announcement, excuse) > Should print - 'I think I forgot to lock up my 1992 Toyota Coralla. Be right back.'
#assess_situation(21, announcement, excuse) > should print - 'Never fear, the Courageous Curly Bracket is here!'
#assess_situation(3, announcement, excuse) > should print - "Meh. Hard pass."
assess_situation(99, announcement, excuse)
assess_situation(21, announcement, excuse)
assess_situation(3, announcement, excuse)

# Declare a new variable - scary_monster - assigned to an hash with the following key/values
# - name (string)
Expand All @@ -55,30 +69,65 @@
# - citiesDestroyed (array)
# - luckyNumbers (array)
# - address (hash with following key/values: number , street , state, zip)

scary_monster = {
name: "Gilgamesh",
smell: "Daisies",
weight: 1000,
cities_destroyed: ["Denver", "Lakewood", "Aurora"],
lucky_numbers: [50, 312, 7]
}

# Create a new class called SuperHero
# - Your class should have the following DYNAMIC values
# - name
# - name
# - super_power
# - age
# - age
# - Your class should have the following STATIC values
# - arch_nemesis, assigned to "The Syntax Error"
# - power_level = 100
# - energy_level = 50

# - energy_level = 50

class SuperHero
attr_accessor :power_level, :energy_level, :arch_nemesis
@@power_level = 100
@@arch_nemesis = "The Syntax Error"
@@energy_level = 50
def initialize(name, super_power, age)
@name = name
@age = age
@super_power = super_power
end
def say_name
puts "It is I, #{@name}!"
end
def maximize_energy
energy_level = 1000
puts "#{@name} is now ready to take on anything!"
end
def gain_power(increase)
self.power_level = increase + @@power_level
puts "#{@name}'s power level is now #{power_level}."
end
end
# - Create the following class methods
# - say_name, should print the hero's name to the terminal
# - maximize_energy, should update the energy_level to 1000
# - gain_power, should take an argument of a number and INCREASE the power_level by that number

# - Create 2 instances of your SuperHero class

epic_man = SuperHero.new("Epic Man", "super strength", 35)
timmy_timebomb = SuperHero.new("Timmy Timebomb", "explosive anger", 16)
epic_man.say_name
timmy_timebomb.say_name
epic_man.maximize_energy
timmy_timebomb.maximize_energy
epic_man.gain_power(1000)
timmy_timebomb.gain_power(500)

# Reflection
# What parts were most difficult about this exerise?

## the gain_power method inside of my class was the hardest to get the syntax right. It was quite the struggle trying to figure out when to use @, @@, or self.[variable] on my own.
# What parts felt most comfortable to you?

## creating a method that interpolates a variable into a string (like maximize_energy and say_name) is pretty easy for me.
# What skills do you need to continue to practice before starting Mod 1?

## I need to remember syntaxes for variables inside of a class, rather than repeatedly re-running the code after every small edit.
16 changes: 8 additions & 8 deletions section1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ This will open the `section1` directory in Atom. You should be able to see the d

1. Next, you will complete several lessons from the Learn Ruby the Hard Way Tutorial. *For ***each*** lesson* ***follow these directions closely***:

1. Create a file within your `section1` directory that will contain this lesson's work. Verify that you are within the directory by using terminal command `pwd`. If you are not, `cd` into your `section1` directory. Once you are there, use the `touch` command in your terminal to create a file. For the first lesson, name this file `ex1.rb`. For each subsequent lesson, use `ex2.rb`, `ex3.rb`, so on, so forth.
1. Create a file within your `section1` directory that will contain this lesson's work. Verify that you are within the directory by using terminal command `pwd`. If you are not, `cd` into your `section1` directory. Once you are there, use the `touch` command in your terminal to create a file. For the first lesson, name this file `ex1.rb`. For each subsequent lesson, use `ex2.rb`, `ex3.rb`, so on, so forth.

1. Work through the lesson, **typing** the code into your file, and running it in the terminal with `ruby ex1.rb`, replacing `ex1` with the actual file name of what you'd like to run. Make sure the output you get is similar to what the lesson shows. If you get an error saying "No such file or directory", be sure to verify the directory you are located in via the terminal- running command `ls` should show the file you are trying to run.

Expand All @@ -149,19 +149,19 @@ This will open the `section1` directory in Atom. You should be able to see the d

1. Check off the items below as you complete the steps you just read for each lesson. ***Remember to create a file containing your work for each lesson!***

- [ ] [A Good First Program](https://learnrubythehardway.org/book/ex1.html)
- [x] [A Good First Program](https://learnrubythehardway.org/book/ex1.html)

- [ ] [Comments in Code](https://learnrubythehardway.org/book/ex2.html)
- [x] [Comments in Code](https://learnrubythehardway.org/book/ex2.html)

- [ ] [Numbers and Math](https://learnrubythehardway.org/book/ex3.html)
- [x] [Numbers and Math](https://learnrubythehardway.org/book/ex3.html)

- [ ] [Variables and Names](https://learnrubythehardway.org/book/ex4.html)
- [x] [Variables and Names](https://learnrubythehardway.org/book/ex4.html)

- [ ] [Strings](https://learnrubythehardway.org/book/ex5.html)
- [x] [Strings](https://learnrubythehardway.org/book/ex5.html)

- [ ] [More Strings](https://learnrubythehardway.org/book/ex6.html)
- [x] [More Strings](https://learnrubythehardway.org/book/ex6.html)

- [ ] [Asking for Input](https://learnrubythehardway.org/book/ex11.html)
- [x] [Asking for Input](https://learnrubythehardway.org/book/ex11.html)


1. Work through the [Strings](http://tutorials.jumpstartlab.com/projects/ruby_in_100_minutes.html#3.-strings) and [Numbers](http://tutorials.jumpstartlab.com/projects/ruby_in_100_minutes.html#5.-numbers) sections from Ruby in 100 Minutes. For each of these sections, open an `irb` session by typing `irb` into your terminal and type in the code snippets provided.
Expand Down
5 changes: 3 additions & 2 deletions section1/exercises/booleans.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
p 7 > 2

# YOU DO: log to the console the result of "hello" is equal to "Hello":

p "hello" === "Hello"
# YOU DO: log to the console the result of 3 is not equal to 4:

p 3 != 4
# YOU DO: log to the console the result of 4 is less than or equal to 5:
p 4 <= 5
7 changes: 7 additions & 0 deletions section1/exercises/ex1.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
puts "Hello World!"
puts "Hello Again"
puts "I like typing this."
puts "This is fun."
#puts "Yay! Printing."
puts "I'd much rather you 'not'."
puts 'I "said" do not touch this.'
10 changes: 10 additions & 0 deletions section1/exercises/ex11.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
puts "What type of animals do you have?"
pets = gets.chomp # the .chomp after gets let's the terminal know to print a new line after the user's input
puts "How many #{pets}?"
amount = gets.chomp
puts "What type of food do you feed them?"
type = gets.chomp
puts "And how many cups of #{type} do they get daily?"
cups = gets.chomp
puts "Wow! So you feed your #{amount + " " + pets} #{cups} cups of #{type} daily?"
puts "They must love you so much!"
9 changes: 9 additions & 0 deletions section1/exercises/ex2.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# A comment, this is so you can read your program later.
# Anything after the # is ignored by ruby.

puts "I could have code like this." # and the comment after is ignored

# You can also use a comment to "disable" or comment out a piece of code:
# puts "This won't run."

puts "This will run."
Loading