I enjoy the names you picked, and I like how you're adding to the score using boolean operators to find the correct frame type.
Wow! This is a beautiful solution. With some recursion isn't it? (In the play instance method)
I have difficulty to implement such approach because definitively you need to come back to lines to complete it unitl filling all the squares.
And recursion is a good way to do this.
Not having CS background can you tell me if this is what is called backtracking?
In my code proposal I used this false - true - false structure wrapped into a loop.
But yours is so much more clever and elegant.
Thx. Will keep a copy of it and work through it.
Definitely not best practice, but the most naive brute force solution...
SPOILER FLAG! DAMN YOU!!
This comment is hidden because it contains spoiler information about the solution
Great solution! Where is the 'no way' being used?
I learn so much reading solutions like this, after struggling through the ugly behemoth that is mine.
Also add Hash into the list of frozen classes. Set class is using Hash class under the hood.
Awesome solution, how did you @torta come to that?
Thanks. Happy Coding! ^_^
I take off my hat and bow low. Congratulations with so elegant solution!
Then you displays a validation error until the user types without any errors.
Probably it passes these tests, however I'd not use it in live, for example:
for post = "Hello #World!" it returns , obviously that words might be splitted with commas and other punctuation marks not only spaces.
@serjmil: Please mark solution related comments as spoilers.