Posts Tagged ‘shakespeare’

Shakespeare and programming

December 10, 2008

A great playwright and poet once wrote in his play Hamlet (and that great poet and playwright of course is none other than Shakespeare)  the following question from act three, scene one:

To be or not to be, that is the question;

Putting it into a more geeky format I have the following translation:

2B OR NOT 2B

Which sort of turns the question into a logical statement. Tidying it up a little further and noting the unary and binary operators in the statement, as well as the operator precedence, and further clarifying its (geeky) nature I have:

0x2B OR (NOT 0x2B)

And so I arrive at an answer to the question in Hamlet’s soliloquy:

0x2B OR (NOT 0x2B) = 0xFF

The answer turns out to be pretty simple and not so philosophical and deep! 😀 If you don’t know why my answer to the famous question is 0xFF, keep on guessing! 😀

(I’m feeling geekier than usual tonight, so there you go)