....not quite what I meant.
Do you think that code would do what you want it to? Try putting the program together and run it. It's better to learn through trying. Don't be afraid of getting errors and weird outcomes, if you don't make the mistakes you won't learn how to fix and avoid them.