Sure we can but we need to see what you have so far. If you have code written already please post it to the forums with codetags (Highlight all the code you pasted and click the <> under format:), if you don't have any code give us what you have come up with so far to solve it. That way we can give you pointers, advice, or make minor corrections for you to push you in the right direction.
But we will not give you the algorithm or code for it. That just eliminates the whole purpose behind programming (Finding way to solve problems).
Anyways give us something to work with and we will try and help you out.