6 kyu
One Line Task [Haskell]: 100 times...
83solitude
Loading description...
Restricted
Puzzles
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
I absolutely hated doing that, but I'm really glad I did :)
Also, if you have like 15 chars to work with, not overcomplicating things is a very, very good option.
Learned a lot while looking the answer. :)
This comment has been hidden.
That is a myjinxin quote which is not really appropriate here.
Yes, there is a way to do it shorter than using
replicate
. Laziness or trickery are not required; it's fairly straightforward actually.Well... I got it to 29. :)
You probably have the right idea. Don't give up. Give it some time; it may come to you how to make it shorter.
This comment has been hidden.
This comment has been hidden.
I thought that give up meant I was supposed to use fold!
Haha, now that really sent me barking down the wrong alley...
Hm. Only one solution. I'll spare you my vote, but I don't like that.
Couldn't you just forbid the obvious solution, but relax the character count and allow for some creativity?
I don't think I can, mainly because it's already approved and relaxing it will change the perceived difficulty a lot. (Looks like people think finding that exact solution is as easy as 6 or 7kyu already...)
Also, "forbid the obvious solution" isn't a very good option - golfing is an activity of throwing everything you can use into the code to make it shorter :)
Anyway, I guess I'll leave the suggestion open. Any improvement ideas are welcome.
I agree with JohanWiltink. IMO this is rather a "gimme-the-single-possible-solution-kata". "Golfing-with-restrictions" katas would be way more interesting and fun. Haskell is a perfect language for this type of katas with all the fancy operators and abstractions.
Ok, but even golfing katas should allow some variability/creativity either by relaxing the code length or by multiple possible shortest solutions.
Regards,
suic
What "creativity" are you talking about? This kata is super tight to allow only one solution for a good reason. In fact anything less tight will make it lose the point. If you're looking for "creativity" here, I'm afraid your princess is in another castle.
Kata best practice only says tests should be written so that a solution passes IIF it follows the requirement. It does not say a solution should pass if it is good enough. I know you don't like such katas (you don't like the
multi-line task
katas either, so...), but they exist for a good reason. Just move on, andgive up
like said in the description. You can't solve every kata on CW, and it's telling you to give up for exactly this reason. It's really your personal style issue and you should git gud instead.Resolving because it's not a suggestion.