After completing my first hackathon project, I am now onto project number two. I am tired enough to create something completely insane.
What it does
This project simulates a Turing Machine using GitHub actions. The primary tool for performing the computation steps is
sed. I use regex replacement alongside a repeated GitHub action to read the description of a Turing machine from the version control system and output the value that the Turing machine computes.
How I built it
I created a GitHub action that waits for a push to the repository. On a push, it checks the contents of a file called
status. If the push sets the content of the
status file to
start, this triggers the GitHub action to begin simulating the Turing machine. The GitHub action continually calls
sed to modify the state of the Turing machine, reading and writing from a two-way infinite tape using
sed. After each step of computation, the GitHub Action workflow pushes a commit describing what it has done. When the Turing machine finally terminates, the GitHub action writes the Turing machine's output a file named
output inside the GitHub repository.
I defined a representation for the Turing machine. I use the 3-state busy beaver champion as an example.
1.R.1,1.L.2 1.L.0,1.R.1 1.L.1,1.L.H
Each line defines a state, defining what to do when reading input. Each section defines what to output to the read-write tape, which way to move the read-write head and which state to next transition to.
Challenges I ran into
Accomplishments that I'm proud of
I have simulated a Turing machine on GitHub actions.
What we learned
GitHub Actions isn't that difficult to use. Once you get used to the yaml syntax, it becomes quite intuitive.
What's next for Turing Machine using Actions