I made a machine

In providing materials for teaching students about Turing Machines, I thought I’d have a go creating one in Elm

annotatedMachineSmall

You can play with it here or look at the source code. All styling is done via elm-ui (thanks @mdgriffith), which I find much easier than separating HTML and CSS. While I have been working with Elm for a couple of years now, I don’t normally use TEA, so there is probably scope for improvement.

I think what makes this potentially useful for teaching is the ability to add comments for each state and to encode the entire machine and tape via a URL (which itself is a useful way of introducing the ‘Universal Turing Machine’). Here are some examples:

A more challenging task for a two-element alphabet of symbols is to reverse the order of a sequence and halt. Here is my solution, but perhaps there are better ones?

BTW, Elm has been great for this kind of application building. So much easier than other languages I’ve used.

24 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.