This should be a rather trivial exercise (just a binary choice paradigm), so I would encourage you to tackle this yourself instead of hoping anyone might have something around already. Presumably, you're looking at implementing an iterated PD. You'll thus have to decide on the number of iterations you want to apply and, more importantly, which strategy you want the computer "opponent" to pursue. AFAIK, tit-for-tat still works best on average (and according to WikiPedia that only takes four lines of BASIC code).
If you hit any roadblock along the way, let us know.
Regards,
~Dave