Let's give some context. I've read some comments of the user Martijn Pieters that I find pretty complete and useful (on StackOverflow), so I was wondering if I could use those comments too, in other words, post the same comment. The comments in question are:
Contrary to popular belief, Stack Overflow is not a debugging service. You do need to do some work up front yourself. For example, you need to tell us what your code is supposed to do, what you expect to happen and where you think the problem may lie. Also see Are there legitimate "fix my code" questions? and the linked How to Debug Small Programs blog post.
and this one:
It looks like you want us to write some code for you. While many users are willing to produce code for a coder in distress, they usually only help when the poster has already tried to solve the problem on their own. A good way to demonstrate this effort is to include the code you've written so far, example input (if there is any), the expected output, and the output you actually get (console output, stack traces, compiler errors - whatever is applicable). The more detail you provide, the more answers you are likely to receive.
Related: Is posting someone's comment as an answer okay? (The difference is that I want to use those comments as comments, not in an answer)