This brings back old memories. We were given this task as an assignment for a course in college called "Theory of Computation". I stayed up for 3 days without sleep to implement this thing. I did it in c++ though, so a lot of that time was due to the choice of the language.
Edit: Forgot to add, got 140pts on it(over a 100, there was a bonus). Yeah, I'm awesome.
Edit: Forgot to add, got 140pts on it(over a 100, there was a bonus). Yeah, I'm awesome.