I mean, you can search this kind of thing up online. There's quite a bit of examples on Stack Overflow, and you can just piece them all together. If I just gave you the code, then you wouldn't be learning anything.
True true, Well thank you!!
btw, I am uloading the work in progress, so check it out if you want!