Timeline for Ruby Koans' Greed Task
Current License: CC BY-SA 3.0
14 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jul 21, 2017 at 0:06 | history | edited | glebm | CC BY-SA 3.0 |
deleted 156 characters in body
|
Jul 3, 2014 at 12:28 | comment | added | glebm |
@addison Array#count walks the entire array for every i , we only walk it once
|
|
Jul 3, 2014 at 4:35 | comment | added | addison |
Is there a reason you make a count variable instead of using Array#count like this: dice.count(i)
|
|
Feb 25, 2011 at 7:44 | comment | added | Michelle Tilley | A great review. This clued me into a bug I had to go fix after I read it. :) | |
Feb 8, 2011 at 17:54 | comment | added | Jakub Hampl | Return is normally OK, but in Ruby is not necessary at the end of a method - in this case it was a bit wasteful. | |
Jan 31, 2011 at 15:43 | comment | added | John Kraft | Uber Noob to Ruby... why is using the return keyword not good? | |
Jan 30, 2011 at 5:29 | comment | added | glebm | No, recursion is alright :) But for this task it's just not approptiate! You are welcome! | |
Jan 29, 2011 at 22:38 | vote | accept | Felix Alcala | ||
Jan 29, 2011 at 21:14 | comment | added | Felix Alcala | Thanks for your review! It helped me quite a bit. I'm exceited to see thing like: "(1..6).each do |i|" ... Thanks. As for the recursion, to me it still seems a natural thing to do here. I nearly never use recusion but here it seemed to make it so very easy. Is recursion per se "non-Ruby"? | |
Jan 29, 2011 at 21:08 | comment | added | glebm |
What I am talking about is not multiple return points, but the usage of return keyword
|
|
Jan 29, 2011 at 20:05 | comment | added | Barry Hess | Since coming to ruby, I've actually dropped my rule of "one and only one return" per method. I often have more than a single return statement in a method. | |
Jan 29, 2011 at 19:42 | comment | added | glebm | It's not the opposite of straight forward in general. However, in this case I believe it is. | |
Jan 29, 2011 at 19:34 | comment | added | sepp2k | Recursion is not the opposite of straight forward. I found the OP's approach quite straight forward - just very repetitive. | |
Jan 29, 2011 at 18:46 | history | answered | glebm | CC BY-SA 2.5 |