Wednesday, October 15, 2008

Hamlet using a Markov chain

Still playing with Markov chains, created a webpage that generates alternative versions of Hamlet, sample excerpt:


SCENE I. Elsinore. A room in Polonius' house.

Enter KING CLAUDIUS, attended
KING CLAUDIUS and POLONIUS

LORD POLONIUS

[Behind] O, ho! do you mark that?

QUEEN GERTRUDE

As kill a king!

FRANCISCO

Nay, I know not:
Is by a sleep to say we end
The ratifiers and props of every word,
They are not the trail of policy so sure
As hush as death, anon the dreadful thunder
Doth all the days i' the church.

KING CLAUDIUS

Give you good night.

Exit POLONIUS

Will you be honest and fair, your honesty should
admit no discourse to your rest; at night we'll hear a play
Let me be accurst!
None wed the second time I kill my husband dead,
Till the foul crimes done in my life,
That I have found
The observed of all your son's distemper.

QUEEN GERTRUDE

Alas, poor Yorick! I knew him, Horatio: welcome, good Marcellus.

The best poor Yorick so far is "Alas, poor Yorick! I knew your father; " - obviously his dad was not a nice guy ;-)

No comments: