|
![]() |
Tim Driven Development | Test until the fear goes away
Tim Driven Development | Test until the fear goes away
Liutauras Vilda wrote:Horrible puzzle.
Junilu Lacar wrote:I have written a follow-up article that includes the lessons learned from solving Part 1 of Day 8: https://jlacar.github.io/kotlin/kotlin-oneliners.html
and another one to detail the process I used to solve it: https://jlacar.github.io/kotlin/0to1in5.html -- If you read the first few versions of that article, it was pretty bad. Sorry if you had to suffer through that first version. After a lot of edits, I think it's much better now. If you re-read it, you're a saint; and thank you.
Junilu Lacar wrote:Why do you say so, Liu? I think it's a very interesting and challenging puzzle, actually. Especially part 2.
Piet Souris wrote:yes, Kotlin has some powerful shortcuts compared to Java, when reading your website I get the same feeling I had when doing Scala and Python. But you show a Java snippet using the longest form possible. For instance, you have this example:
...
but you can also write
...
Liutauras Vilda wrote:
Anyway, I'll be interested to see your solution.
Moving fast forward, Day 8 I found equally uninteresting to me as a Day 10, while Day 9 and Day 11 were brilliant, found few areas to improve and at the end was quite happy with the result, code's expressiveness and conciseness.
But part of the fun I guess, you deal with whatever you get, and try to get best out of it.
Piet Souris wrote:
2) You are this sites Master of Refactoring and Master of Code that reads like a train.
With respect to this, what is your opinion on, for instance:
I wrote:I will update the article (with an attribution to you, of course). Thanks for the call out.
Liutauras Vilda wrote:I found it very mechanical and the solution itself required more of a human input with IFs, as opposed to some more elegant approach to the problem.
Stephan van Hulst wrote:I feel that I can greatly simplify my code, but this was the final result upon submitting my answer.
Junilu Lacar wrote: Seriously, I need to get to bed. Bye for now.
Junilu Lacar not long enough after... wrote:I'm OCD when it comes to refactoring
Liutauras Vilda wrote:[You also seem to write functions down->top, as opposed to more habitual way top->down.
I think top->down is a bit easier to read, because from the top functions you get introduced to the context WHAT is going to happen, then you gradually get introduced to HOW part.
Liutauras Vilda wrote:so far the backlog is for days: 12, 13, 14.
Tim Cooke wrote:Oh boy this is a post of shame if ever there was one. Brace yourselves......
Stephan van Hulst wrote:I think I did that in this snippet of code:
Tim Cooke wrote:
e.g.
Digit 0 has 6 segments, contains all segments of 1, and contains all segments of 7, and does not contain all segments of 4.
Digit 9 has 6 segments, contains all segments of 1, and contains all segments of 7, and contains all segments of 4.
I wrote:Cool. I will give this a shot with my code and let you know how it goes.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |