Git Product home page Git Product logo

phase_0_unit_2's People

Contributors

chapmansnowden avatar mbtomori avatar tleung999 avatar

Watchers

 avatar  avatar

phase_0_unit_2's Issues

Week 6: Boggle Board

Hey Tony!

I enjoyed looking through this code - there were several places where we were using the same techniques to do things, but I really liked seeing the way you dealt with diagonals. Iterating through you diag loop and changing the state of startcoord until it was the same as endcoord was really clever. I would never have thought of that.

I also liked your use of inject on line 45 - I feel like I'm behind on really learning and remembering to use all the powerful methods Ruby offers for working with arrays and hashes. Seeing that stuff encourages me to get better on that.

Only nitpick I would have is on indentation โ€” so minor tho. Nice work on this.

Returning the Ruby Way - phase_0_unit_2 / week_4 / 1_mathy_ruby_intro / easy_add_it_up

Great job on the refactored 'total' array. I felt in my gut there had to be a better way to do it than just the each method but couldn't think it and never used that method before.

One thing to shorten your code the tiniest of bit at the end is to leave out the statement "return". Any statement in ruby automatically returns the value of the last evaluated expression. Good Ruby style is said to leave out explicit returns unless needed clarity in complex code. Ruby is big on code minimalism/implicit magic. I reference the following when I'm not sure I'm styling it "The Ruby Way":
http://github.com/styleguide/ruby

JY Review

Hey Tony,

I liked your solution to the easy math challenge because it was different. I didn't realize that we didn't need to put the array in parameters after defining the method's name. Very interesting - how does that work exactly?

Also, I think you're supposed to do 2 challenges (i.e., easy, medium, hard, harder)

Creative Review

Hey again Tony (yep, I'm doing my reivews and decided to do 2 of yours).

Your refactored solution is, for lack of a better term, impressive.

I believe I understand everything you're doing but as I tend to use Arrays instead of Hashes... it took me a bit to figure out exactly what methodology you were pursuing. I had to run the code on my own to make sure what I thought was going to happen, actually did happen.

Another facet I found interesting, that I didn't really try out... though thought about was the idea of "buckets". We can put 4 people into each bucket... which is seemingly what you did/pursued in your initial solution.

The other way I thought about it was "# of students" / 4 == Is how many buckets I need.
"# of students" % 4 = the number of students I'm going to "push" onto other groups. I figured that while we may be allowed to have a group of 5, we cannot have one of 3, for instance.

Again, codin' up a storm and lookin' good while doing it :)

John

BoggleBoard

I think your code looks great. I like how you used transpose, I had to look it up but haven't used it yet in code.Your code was readable, indentation was a bit inconsistent. Also, I don't think attr_reader is necessary for this challenge. Maybe it is, with my code I didn't use it and everything worked fine.

Week 5: Die Class 2

Hi Tony,
Your pseudocode is great, your code looks really clean and DRY. From everything including your reflection it really seems like you were applying things from the first challenge and putting them to good use here! Good work!

Week 5: Die Class 1

Hi Tony.
Hope all is going well for you so far this week.
This wasn't the most diffucult challenge, and your solution is nice. Very clean.

As I've been looking at other people's work on this, I came across a couple of things I thougth were cool and thought I'd pass them along:

attr_reader :sides
This one line will actually generate the following method automatically:
def sides
@sides
end

More here: http://stackoverflow.com/questions/5046831/why-use-rubys-attr-accessor-attr-reader-and-attr-writer

and also came across Random.rand(x..y) - another way to get a random number within a range. Not totally sure what the differences are between it and rand tho... and I think it only works in newer versions of ruby.

Refactor Review

Hi Tony...

Seeing your comments, it seems you really understand whats going on within the dynamics of this program.

The only real suggestions I have are when defining what something is doing, such as .zip... perhaps don't use "zip" in the definition? Though, it is difficult to define methods and what they're doing sometimes... sort of like defining the color red... without calling it red :)

Great work as always :)

John

Week 4: Challenge 1: Median

Your code is very methodical, which makes it very easy for me to follow along! Two suggestions that I have to make your code even more DRY are:

  1. When you make an if/else statement, you can take out the 'then'. Ruby will still run without the 'then' statement, so it's one less thing for Ruby to calculate.
  2. You can take out the 'return' statements. Ruby will return your answer even without you telling you to 'return' the answer.

I hope that this helps, and I will actually try to follow your method and be very step-by-step; I tend to be all over the place.

Mathy Ruby Intro - JA

Hey Tony,

I like what you did originally with your "Initial Solutions". Taking them down to 1 line Refactored solutions was pretty great as well. I believe you fall guilty to naming conventions as well as it took me a second to figure out what you were doing with "first + sentence + last" but perhaps its the way I read the code.

While there wasn't a lot of "meat" on this assignment, it does seem as though you have a great understanding of how you want to approach your code and then put it in to practice... your pseudocode exemplifies this as well.

Looking forward to working with you more and reading more of your code :)

John

Review - Cipher challenge

Hi Tony -

Just left this comment for John ... thought I would copy here for you as well:

I liked looking through this - I think our ASCII conversion was kind of novel, but I like this better. Ruby arrays have so many built in features that serve this problem well. Using (a..z).to_a is a clear, compact way to get the array set up, and then relying on Ruby's "count back from the end" feature means you can do the shift -4 and not have to manually deal with wrapping around the end of the alphabet like we did with the ASCII numbers.

Slick.

Your solution got me thinking, could you use a literal array with all the $,%,@ stuff and "include?" to do the test for converting spaces?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.