![](http://habrastorage.org/getpro/habr/avatars/111/8bc/cc5/1118bccc5562f95c9804baa4cf6ecb4d.jpg)
We use habracommentation as a Turing machine
How did it even get into my head?
![](https://habrastorage.org/storage2/ac6/fab/aec/ac6fabaec47743ec2af2bd741d9a4442.jpg)
Each habrakommentarii has its own address. The structure of the comment address:
habrahabr.ru/blogs/gtd/135090/#comment_4486120
Before “#”, this is a link to the topic, and after that, an anchor indicating the position of the comment on the page.
If you specify links to other comments in the comments, and then click on them, the page will scroll to the desired location. Also, the comments themselves have a couple of arrows ↑ ↓ that allow you to move between replies to comments.
“Hey!” I thought, “there is something in it.” At first, I thought about the limit of the confusion of comments, if they put links to each other. But then I realized that there is generally something from elementary programming, very much like a Turing machine. But some details were not enough, and I did not want to use the links in the content of the comments. Help came to your favorites!
Implementation of the algorithm for adding unary numbers on a Turing machine
To start, I trained on the Javascript version of the Turing machine http://matinf.igpu.ru/simulator/tm.html , summarized 2 and 3.
01101110 -> 01111100
Wrote a small algorithm for these purposes:
0q1->0q2R
1q2->1q2R
0q2->1q3R
1q3->1q3R
0q3->0q4H
0q4->0q4L
1q4->0q5L
1q5->1q5L
0q5->0STOP
We select tree-like comments and add two posts to our favorites and then 3 more posts:
![](https://habrastorage.org/storage2/27d/625/ba7/27d625ba7b42ea12328036409c559db8.png)
And now briefly the steps themselves (not all):
![](https://habrastorage.org/storage2/a30/8e9/699/a308e96997c7eb8cc4a55b21336a892a.png)
As a result, we get what we wanted: 2 + 3 = 5. It is
so simple and easy to perform arithmetic operations using just comments habrazhiteli.