Thursday, March 19, 2009

Bulls and cows

Truth values define program execution. Keeping track of truth values is critical to making useful decisions in the course of a flow.

Bulls and cows is an old code breaking game. It nicely illustrates how we need to keep track of truth values to crack the secret code. The rules of the game are available at: http://en.wikipedia.org/wiki/Bulls_and_cows

Vaitheeswaran used to play this game with me at College - thanks to him for doing that! The game is available as a "gadget" on the left margin.

Have fun :)

PS: One more reason why I include this script here. Bulls and cows is a fairly trivial game, but writing code to find the secret would pass as "artificial intelligence" today. I have no intention of writing such code. I am looking forward to the day when a machine would study the page and play the game. That would be artificial intelligence.