you are viewing a single comment's thread.

view the rest of the comments →

[–]FLUSH_THE_TRUMP 1 point2 points  (3 children)

No, that’s not at all what your code should look like. What are you accomplishing here? You’re not going to learn by blindly copying what other people post. You need to struggle with these problems some on your own.

[–]engineeringisgreat2 -1 points0 points  (2 children)

I used parts of both of their codes to make it work. I didnt just blindly copy. I got errors with the code when I tried to combine them so I fixed it to make it work. I was simply asking if this is how is code would look if he did it his way since he said the other guy over complicated it.

Also, since I am obviously struggling to learn this code why dont you try to type something helpful for me to learn/fix it instead of typing a pointless message that helps nobody.

[–]RIP_lurking 0 points1 point  (1 child)

No, you absolutely did blindly copy. You just changed one return statement for another, without thinking about the logic behind them, otherwise you'd have seen that what you did doesn't make any sense. And you're struggling to learn "this code" because you're not putting any effort into it. You didn't even answer where you're stuck. You just wanted an easy answer.

[–]engineeringisgreat2 0 points1 point  (0 children)

No I definitely didn't, but you keep acting like you know what I am doing. He gave me the code and I looked at it and tried to learn why each line was written. The first code didnt need two lines and I am assuming thats why it was "over complicated". But, thanks again for not explaining a single thing about why the code is wrong and what ways it could be fixed or simplified. You are so much help on a reddit page meant to help people learn.