Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This comment is hidden because it contains spoiler information about the solution
This is great! I did something similar but somehow much longer with redundant code. I am interested though in how this and all the top solutions I looked at had some form of forcinf a float, e.g. the 1.0 in this one which also seems redundant when the division will result in a float and the the format will force 2 decimal places. Is there some functional reason for this?
TL;DR, it all depends on who you are writing the code for. Personally, I enjoyed it but wouldn't write it.
This feels like an age old argument between concise and readable code. To a complete beginner this would not be very useful or accessible. For me, knowing some JS and a week into learning Python, it is not readable but fun and interesting to dissect and understand, and it helps me to learn. Thank you. And I can easily understand that this becomes quite obvious with time.
I was wondering how to avoid the repetition. Nicely done.
This comment is hidden because it contains spoiler information about the solution
I'd be grateful if someone could exlpain how this works. I have never seen ; used in ruby before, nor come across shift.
This comment is hidden because it contains spoiler information about the solution
Love this code! So simple and to the point. Thank you.
If you have return, it is an explicit return which can be at any point in a method, but the last expression of any method is always returned as an implicit return, so no return is ever needed for the last expression in a Ruby method.
Ah, thank you both for that. Too late to copy and check, but that makes sense. Thanks for taking the time. :)
Hello Chrono79,
You are right but I believe that there is still a problem!
Thank you, your comment made me look again and I had missed that despite the eyes and mouth, the nose was invalid. But please take a peek at this screenshot, https://drive.google.com/file/d/1NS14WGR19X7I3RZTQfKKwHWET7cv2vL8/view?usp=sharing . My apologies if I am missing something obvious but I can see two valid smilies and the test says it expected only one.
Thanks
seriously!? :)
This comment is hidden because it contains spoiler information about the solution
I love the simple logic of this code. Nice!
This comment is hidden because it contains spoiler information about the solution
Loading more items...