<a href="https://gist.github.com/aras-p/6224951" rel="nofollow">https://gist.github.com/aras-p/6224951</a>
way more fun.
IIRC there is something similar in python
changing == to random yes/no. that's pure evil