You were being helped, you just didn't know it because the answer wasn't given to you. Learning to program doesn't work that way, where you are given the answer. At some point, you have to engage your mind in thinking in logical, discrete, well-defined steps. If you can't do that, then this field of study is not for you. And believe me, it has nothing to do with intelligence -- some people can think with a "programming" brain, while others can't, regardless of how intelligent they may be in other topics.
if you are not going to try to help please do not answer at all okay?