The short answer to this is "you're going to have to take the time to write the code". The longer answer involves you creating an SSCCE that demonstrates what you've tried and where you're stuck, and...