4 kyu
Broken Image - Puzzles #1
73matt c
Loading description...
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.
This is a bad idea.
On top of that, this hint is horrible. I was rounding intermediate results, but all we need to do is round the final results after applying all operations.
That was very funny...
Very original Kata!
nice kata,i like.
approved; lowest available rank was 4
Satisfying kata. Pretty spot-on for me with the amount of information provided and the amount to figure out. Mathematically not very hard, but there are plenty of possible approaches to extracting the data you need to use. And a good amount of little sanity checks you need to factor in. Good job!
thank you :)
I really struggling with extracting data. I have no idea how to use the pixel class.
I have figured out that I can pass the first test using this method.
image.forEach(i =>{ j = i.length; for(j = 0; j < i.length; j++){ i[j].g = 155;
} })
A tough one, particularly not knowing in advance about the format of the message one has to decode (I put "subtract" instead of "minus" until I start logging it to see the error), if it could have like "each Red and..." then "each Green and..." and so on; I finally managed to overcome that guesswork too, but I would recommend to be more informative in the description about the statement format.
Sorry I'll add more descriptions about the input, Thank you :)
No need to apologize, of course: I am still the one taking and you are still the one making a gift to us :)
The kata could be fine as it is now, it is just that imho knowing in advance something more about the input format frees one's hands to focus more on the actual coding/fun part.
I've updated the description and moved the pixel class to the preload section as there was no need for it to be in the actual code.
Description seems much cleaner to me now; possible typo in the last line:
I have moved the pixel class to the reloaded section.
, I think you meantpreloaded
.Thank you, I'll fix it now
When I try to submit, I get this error:
Max Buffer reached: Too much information has been written to stdout.
20 Passed
0 Failed
0 Errors
UPD After ~10 tries it finally accepted my solution. I did not
console.log
anything so stdout overload was purely from tests' logs. I think it would be better not to show "Expected: ... Got: ..." stuff for passed tests.UPD2 Also did not find any check for "Image has a size of" parsing instead of simply using
length
of image nor any benefits. Is it really neccessary?not really I thought it might help, some people might use another approach to the problem? Also I think that's a good idea and I will not output the data if it is correct.
-->Sorry<-- I accidently set issue as resolved if the error still occurs, could you please just keep commenting here, and I'll try resolve the issue. Also I won't remove the size of part because there really is no need to, Thanks :)
Actually I meant removing
Value == [125,155,255,125,155,255,125,155,255,125,155,255,125,155,255
messages from output, not pictures. Pictures was a much better idea.oh ok! yeah I guess I could do that!
It's a bit difficult to decide without looking at your actual test data, but I think your bonus tests are wrong.
When I log the pixel values, it looks like the background is scrambled according to the statement, but the face is unscrambled.
So when I try to "fix" the face, it becomes double fixed (which is wrong, of course).
Could you take a peek at it, please?
Funny thing is that I've spent more time writing code to help me debug and visualize the problem than to actually solve the kata. :-)
You're right it does seem to only affect the background and not the face for the bonus test, I'll investigate further and try fix it asap.
I believe I have solved this issue. I have also removed the division, so no image pixel will never be divided. Please reply with success if it has worked, also your solution may have to change as I was populating the images (before bonus test cases) wrong and have fixed it.
Hmmm. You may have fixed that problem, but you seem to have introduced another. :-)
My first scrambled bonus image had the following statement: "Image has a size of 24 and each Red and each Blue and plus 40", but all of the background pixels were (13162,167,13295). The filters seem to be correct, but the arithmetic is off.
All the bonus pictures have similar problems. They only used plus and minus but the actual values are way too large.
The static images work without a problem.
I never had problems with the division, btw. The resulting value was never more wrong than rounding the value to the nearest integer fixed it.
Ok I believe I've fixed the issue and readded the dividsion as I found out what was actually causing the error. If you could confirm thank you very much :)
Looks good now. At least my solution passes all the tests. :-)
Thanks for your effort!