Beta
Road To Nowhere - Reverse engineer this picture (Golf)
Loading description...
Puzzles
Restricted
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 came from your random tests as the expected output. Is that really correct?
Yes this looks like a tall example
When failing the random tests, the tests try to output what the image should have looked like, however this quickly uses up the available memory buffer, cutting off further output.
Showing the expected output is important, but you might have to work with
canvas
or some other alternative to what you are currently doing, to make it work properly.Canvas wouldn't work as it's not available in node, and it uses a programmatic API so to use it on the client side would require XSS. I have updated it with an SVG approach, so it will always fit in the output buffer now.
Kata requires rounding of floating point values but does not test with a margin for error.
A few things:
draw
function is very cool.0-255
are all truthy and falsy numbers in JS too.It certainly looks like a daunting task but I will give it a go.
Thank you, I have updated the description.
and sorry I don't see the issue here?
0 ≈ false
,1-255 ≈ true
Apparently, there is no difference between
1
and255
. But there could be.A lot more "hints" would be nice, and would not detract from the kata.
Is that horizontal single pixel black line in the middle always there, or does it somehow scale with the image? Same for the vertical half white line.
Why isn't there purple in the dithered red and blue part? The colour encoding could handle that, no?
Will tests with different sizes compare for actual equality with a reference picture? Ie, will we have to reverse engineer any idiosyncrasies the reference solution might have ( and I can see a few in the dithering ) ? Or will it somehow test for average colours in regions? The latter would be interesting, the former - H3LL NO, that's just masochism ( on solver's part, and sadism on yours ).
Would more example images suffice as hints?
that would be a start, but you cannot avoid explanations about how scaling has to be handled
And I can understand you do not want to specify dithering, but generally, specification by example ( ie, reverse engineering ) is frowned upon in Codewars. The description should specify, examples can then clarify.
Mind reading is not an available language on here for a reason.
Could you address what's wrong with purple as well?
[1,0,1]
doesn't seem any more wrong than[1,1,1]
( ie, white ).I was just trying to write a challenge that I would enjoy.
There's nothing wrong with it, a different Kata with a different image could use it.
The problem is, reading your mind is a lot easier for you than for all of us.
It's not mind reading, it's pattern recognition.
I would absolutely agree with you, if tests are done by comparison with a margin for error ( see my third point in the original post ).
Since you never addressed that, I take it comparisons are done without one ( or you would have been proud to note you did things correctly ).
That means it's not just pattern recognition, it's also divining the order of operations your reference solution uses, when we can't even know which operations your reference solution uses. In short, mind reading.
Any kata that uses floating point calculations in a language with IEEE.754 floating point numbers relies on order of operations. This is well-documented, and I will not reproduce that here. Expecting solvers to reverse engineer what order of operations you used, when we are not even sure what operations you used, is too much. Did you know in JS there can be a difference in results between
Math.hypot
andMath.sqrt
for equivalent arguments? Between.toFixed
andround
? Betweena + b
andb + a
?Really, it's not the pattern recognition part of the kata I take issue with; it's the floating point repesentation inaccuracy mishandling. Which is inherent to JavaScript
Number
s. Which you'll have to address in your kata design and testing, not by saying "it's a challenge."Your first kata addressed this problem by specifying the full order of operations: PEMBDAS, and left-to-right within that ( right-to-left for powers ). That unambiguously specifies order of operations, which means testing should compare for exact equality ( comparing with a margin for error would be wrong there ); that kata ( probably ) did not have this
Issue
, quite possibly by accident. This one, and the next one I see you just published, very probably do.Hi,
...errr... Why the code formatting. The task could be interesting in itself, no?
I could do an easier version without it?
maybe, yeah.
But in the first place, you should actually describe what the task is. "Reverse engineer" could mean anything here.
'still a lot of work on this one before it's in state for approval, I believe
=> ?
this input in the description
2 numbers, width and height
and I can't find the condition you're referring to? and what's wrong with the output, it's an rgb array?inputs: mmh, I missed that, sorry. So, how many tests are there?
'never talked about a conditionnal thing. Maybe you mean as a "problem"? (I'm not native speaker, sorry). Here are some walls of text for you to read:
uh, I did read the sentence a bit too fast, yeah. I was missing the 0/1 info, ok.
Sorry I misread. I don't see an issue in the first link? and the second one is for python? Could you give me a direct quote of a rule it breaks?
Did I raise any issue? ;) nope. Not yet, at least.
But I see you keep avoiding my question: how many tests? are there random tests? Because that is mandatory, nowadays. If you don't have random tests, the kata will never get approved, sorry.
python/JS: damn it... I'm out of my head, this evening x/ Well, some ideas apply. And iirc... here is the JS version if needed, but that's mostly about the implementation, so might be useless to you.
The other link is far more "important", here.
My bad, yes, there are 100 random tests. Do I need to state that in the description?
and 11 fixed
+2 rule tests
ok, good. No, not necessarily. On the other hand, what you have to add is some information about what the user is tackling. For instance, how scaling is spposed to be done? You have to at least give some indications (otherwise, it's just like the very old kata where hald of the requirements are hiden/not even announced... You should dig a bit in that direction, you'll quickly realize how much it's annoying for the user x) )
Yeah, I believe an "unconstrained" version could maybe be interesting. Hard to tell so far, since the requirements seems a bit vague for now, tho.
?? not following