turing machine in an LC

Jeremy Bowers jerf at jerf.org
Tue Feb 8 15:18:54 EST 2005


On Tue, 08 Feb 2005 20:47:06 +0100, Bernhard Herzog wrote:
>     [x for L in [[[initial_state, 0]]]
>        for state, pos in L
>        if state is not None
>           and (L.append([M[state][T.get(pos, 0)][2],
>                          pos + M[state][T.get(pos, 0)][1]])
>                or T.__setitem__(pos, M[state][T.get(pos, 0)][0]))]
>     return T

I stand corrected!

Thanks for posting it; I wasn't going to ask anyone to produce one, but if
you had one lying around, that's great.

Nice job!



More information about the Python-list mailing list