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
46 changes: 24 additions & 22 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,50 +19,52 @@ 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`
* I Want to say upfront that I know this is a barebones calendar. I'm trying to purposefully leave some sections reserved so that I can intentionally go back and add specific tasks in those slots once they're posted, but I'm also leaving a lot of free time in the margins so that I can schedule the smaller bits I know are going to crop up in the coming six weeks. Here's at least my skeleton of a schedule;

- ![alt text](/images/wk1.png)
- ![alt text](/images/wk2.png)
- ![alt text](/images/wk3.png)

### 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]https://gist.github.com/Josenecal/2df2dbc93ac03579c72cd6620600c710

### 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/Josenecal/f64e810efacf91209a61888a1e4c44c7

### 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/Josenecal/ad98afbb60c2a2fae0a5aac26d87a8c6

## 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.

1. Go to *your* prework repository on GitHub
1. Click on `New Pull Request` per the image below:

![new pull request](/images/be_s1.png)
![new pull request](../images/be_s1.png)

<br>
2. On the Pull Request page, make sure you see something similar to below (but with your username):

![new pull request step 2](/images/be_s2.png)
![new pull request step 2](../images/be_s2.png)

<br>
3. Click on `Create New Pull Request` (circled in the image above).
Expand Down
27 changes: 25 additions & 2 deletions final_prep/annotations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,62 @@

# Build a Bear

#declare method build_a_bear with 5 parameters
def build_a_bear(name, age, fur, clothes, special_power)
#declares and assigns greeting variable by interpolating name argument
greeting = "Hey partner! My name is #{name} - will you be my friend?!"
#declares and assigns demographics variable using arguments
demographics = [name, age]
#declares power_saying variable and assigns to an interpolated string
power_saying = "Did you know that I can #{special_power}?"
#declares hash built_bear, maps previously declared variables as values to related keys, adds cost and cuddly attributes
built_bear = {
#all the following are our key-value pairs
'basic_info' => demographics,
'clothes' => clothes,
'exterior' => fur,
'cost' => 49.99,
'sayings' => [greeting, power_saying, "Goodnight my friend!"],
'is_cuddly' => true,
# bracket marks end of hash
}
# end marks end of method
end

#returns built_bear variable as a hash with arguments incorporated into values
build_a_bear('Fluffy', 4, 'brown', ['pants', 'jorts', 'tanktop'], 'give you nightmares')
#reassigns and returns built_bear variable with new arguments incorporated into hash
build_a_bear('Sleepy', 2, 'purple', ['pajamas', 'sleeping cap'], 'sleeping in')


# FizzBuzz

#defines method fizzbuzz with three parameters
def fizzbuzz(num_1, num_2, range)
#sets up a counting loop that will repeat itself range number of times
(1..range).each do |i|
#Passes count number to i and tests whether num_1 AND num_2 factor evenly into i.
if i % num_1 === 0 && i % num_2 === 0
#If so, prints "fizzbuzz"
puts 'fizzbuzz'
#If both don't factor evenly, test if only num_1 factors evenly into i...
elsif i % num_1 === 0
#prints fizz, if so
puts 'fizz'
#If at least num_1 does not factor evenly into i, tests whether only number 2 factors evenly into i
elsif i % num_2 === 0
#If so, prints "buzz"
puts 'buzz'
#If neither number factors evenly into i...
else
#prints i
puts i
#ends conditional loop
end
#ends (1..range) counting loop
end
#ends fizzbuzz definition
end

#tests whether 3 and / or 5 factor evenly into the numbers 1 through 100
fizzbuzz(3, 5, 100)
#tests whether 5 and / or 8 factor evenly into the numbers 1 through 400.
fizzbuzz(5, 8, 400)
88 changes: 66 additions & 22 deletions final_prep/mod_zero_hero.rb
Original file line number Diff line number Diff line change
@@ -1,45 +1,59 @@
# Challenge - See if you can follow the instructions and complete the exercise in under 30 minutes!

#Challenge accepted.
# Declare two variables - hero_name AND special_ability - set to strings

hero_name = "Raul"
special_ability = "Tap Dance of Justice"
# 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 = "It's a typewriter! An earthquake! It's... #{hero_name}!"
catchphrase = "Prepare to experience art! No criminal escapes the #{special_ability}"
# Declare two variables - power AND energy - set to integers

power = 7
energy = 100
# 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 = ["Pianississimo", "Dissonance", "Thereminstrumental"]
side_kicks = ["Polyrythmic", "The Masked Accidental", "Lenord Burnstein"]
# Print the first sidekick to your terminal

puts side_kicks[0]
# Print the last arch_enemy to the terminal

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

arch_enemy.push("Pentatonic")
# Print the arch_enemies array to terminal to ensure you added a new arch_enemey

puts arch_enemies
# Remove the first sidekick from the sidekicks array

side_kicks.shift
# Print the sidekicks array to terminal to ensure you added a new sidekick

puts side_kicks
# 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

# 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
# - If the danger_level is below 10, it means it is not worth your time and should result in printing the string "Meh. Hard pass." to the terminal.
def assess_situation (danger_level, save_the_day, bad_excuse)
if danger_level > 50
puts bad_excuse
elsif danger_level > 10
puts save_the_day
else
puts "Meh. Hard pass."
end
end

#Test Cases
announcement = 'Never fear, the Courageous Curly Bracket is here!'
Expand All @@ -55,30 +69,60 @@
# - citiesDestroyed (array)
# - luckyNumbers (array)
# - address (hash with following key/values: number , street , state, zip)

scary monster = {
name: "The Great Mute",
smell: "pungent",
weight: 719,
citiesDestroyed:["Paris", "London", "Woodstock", "Sidney", "New York", "Reno"],
luckyNumbers: [5, 7, 11],
address: {number: 253 stree: "Atonal Ln" state: "MD" zip: 21824}
}

# 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

# - 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

class SuperHero
attr_accessor :name, :super_power, :age,:arch_nemesis, :power_level, :energy_level
def initialize(n, p, a)
@name = n
@super_power = p
@age = a
@arch_nemesis = "The Syntax Error"
@power_level = 100
@energy_level = 50
end

def say_name
puts name
end

def maximize_energy
self.energy_level = 1000
end

def gain_power (n)
self.power_level = power_level + n
# - Create 2 instances of your SuperHero class

bob = SuperHero.new ("Riverdancer", 12, 54)
bill = SuperHero.new ("Picardy Third", 300, 1000) #Yes, picardy third is OP.

# Reflection
# What parts were most difficult about this exerise?
# Trying to stay with the theme. Mostly though, there were just little bits of syntax that I had to check and run and barely modify to get right. It's the details. Dealing with variables and accessor symbols in classes, too, could use a bit more practice before I'll feel really comfortable with it.

# What parts felt most comfortable to you?
# most everything else outside of classes felt really pretty good, actually.

# What skills do you need to continue to practice before starting Mod 1?

# I need to keep working with classes just to get a better feel for them. Everything else feels almost intuitive at this point, but not the nitty gritty details here. I also need to keep working with github, I'd like to set up RSA for gist.github.com so I can push and clone effortlessly, and I STILL CAN'T INSTALL different versions of ruby with homebrew 😱
Binary file added images/wk1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/wk2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/wk3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added section1/.DS_Store
Binary file not shown.
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
4 changes: 4 additions & 0 deletions section1/exercises/booleans.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
p 7 > 2

# YOU DO: log to the console the result of "hello" is equal to "Hello":
p "hello" === "Hello"
# side note here - Ruby has an == and === operator.

# 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
28 changes: 28 additions & 0 deletions section1/exercises/ex11_inputs.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#I am reformatting these prompts only slightly to increase the odds that we generate an output that reads well.
print "How old are you? Please include units ; "
age = gets.chomp
print "How tall are you? Please include units ; "
height = gets.chomp
print "How much do you weigh? Please include units ; "
weight = gets.chomp

puts "So, you're #{age} old, #{height} tall and #{weight} heavy."

#STUDY DRILLS
# 1 - The gets method will ask the user to manually input the value of a variable at assignment. By default, the gets method will add a line break at the end of this input. Depending on your use, that can make formatting the output really awkward. The gets.chomp method will take user input just like gets, but will "chomp" off the line break at the end.
# 2 - Oh my goodness yes I can think of SEVERAL other uses for user input! Account access, user profiles, payment info if this is an online market... you could probably use this to drive most interactive features, albeit on a very strange and outdated website that would feel like command prompt.
# 3 - Let's help some math students use hacks;

p "The standard formula of a quadratic equation is y = ax^2 + bx + c"
p "what is your value for 'a'? Please only enter numbers"
a = gets.chomp.to_f
p "what is your value for 'b'? Please only enter numbers"
b = gets.chomp.to_f
p "what is your value for 'c'? Please only enter numbers"
c = gets.chomp.to_f
ans1 = (-b + Math.sqrt(4 * a * c)) / (2 * a)
ans2 = (-b - Math.sqrt(4 * a * c)) / (2 * a)

p "your roots are at y=#{ans1} and y=#{ans2}!!!"

#Bonus, we can now force integer-like strings to integer format and do math!... although retrospectively I'm changing this to .to_f instead of .to_i because we will ABSOLUTELY get rounding errors with integers!!!
10 changes: 10 additions & 0 deletions section1/exercises/ex1_good_first_program.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
puts "Hello World!"
puts "Hello again!"
puts "I like typing this."
puts "this is fun."
puts "yay, printing!"
puts "I'd much rather that you 'not'"
puts 'I "said" do not touch this'
# This is a comment!

# I ended up using the comment hash to play around with forcing just one line to print at a time, so I guess I kind of got ahead of myself with the extensions!
Loading