I would think the idea is that you write the code yourself, not just get someone else's and use that. If you understand what functionality your game needs then you should be able to make an attempt at implementing that functionality in code yourself. If you do that then we can help you with issues you encounter along the way.

The idea with homework is that you answer the question yourself, not get someone else's answer and have someone explain it to you so you can pass it off as your own. That seems an awful lot like cheating to me.