What bitter_engineer was referring to with:
"The first time you meet another construct, do unto it as you would have it do unto you. Thereafter, do unto it as it last did unto you. "
is the Tit-for-Tat program.

When a veritable swarm of simple programs (simple being relative) were put into a random pool to interact with each other in an Iterated Prisoner's Dilemma situation, the program that did the best was Tit-for-tat. It had a one cell memory, and though it always began by trusting its fellow prisoner, during every turn thereafter, it did exactly what that particular opponent/program did during the previous turn.

This was by far the simplest program. There were several that were pages and pages of code and tried to use statistical maneuvering and various other tactics in order to get a few extra points.

What's important to note about this particular game theory model is that it assumes opponents are strangers. This is very important.

This means that in daily life such a strategy will not be optimal. This is due to the fact that social norms, social capital, and other altruistic benefits (don't listen to the present objectivists - they do exist) are simply not taken into account. We are social beings and to always act like a prisoner awaiting a sentence will certainly not lead to all roses and sunshine.