I am incapable of translating the concepts into code, but I can try to provide some examples of how to incentivize foolishness that our glands provide in real life.
I'll roll that around a bit in the back of my head, until an idea falls out. That's generally how my writing process works =p