<h1>Failing At A Bouncing Ball <p dir="auto"><em>Deutsche Zusammenfassung unten <p dir="auto">After my last article I was so motivated and enthusiastic that I could understand difficult things few people could understand or care about at all but then last Friday at the day of <a href="https://en.wikipedia.org/wiki/All_Saints%27_Day" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Allerheiligen I wanted to cook some tea for my parents and used a different plant. The result was horrifying and I am happy we survived it. <h2>So what did I want to show days ago <p dir="auto">Well, I wanted to show a simple program in Thue which emulates a bouncing ball or a ball which bounces back over and over again between two walls. <p dir="auto">The code is relative simple and I wanted to show that it stays that simple for Turing Machines and further for 2-tag systems. <p dir="auto">Here's the Code in Thue: <pre><code>#::=bouncing ball program ))O.::=.))O .O((::=O((. ]O((.::=].))O .))O[::=O((.[ ::= ]...))O...[ <p dir="auto">Produces <pre><code>]...))O...[ ]....))O..[ ].....))O.[ ]......))O[ ].....O((.[ ]....O((..[ ]...O((...[ ]..O((....[ ].O((.....[ ]O((......[ ].))O.....[ ]..))O....[ <p dir="auto">over and over again ... <p dir="auto">Then I tried to program it in a Turing Machine and fortunately there is a quite <a href="http://morphett.info/turing/turing.html" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">good implementation. <p dir="auto">Here's the code: <pre><code> ; simulates a bouncing ball as in bouncingball.thue ; however D is ))O or ball going to the right while ; C is O(( or ball going to the left ; ] [ are the reflecting walls on which the ball bounces off ; ; Input : ]....D....[ ; alternative Input: ]....C....[ ; 0 has to be the initial state 0 ] ] R 0 0 . . R 0 0 D . R D> 0 C . L C> D> . D R Dx D> [ [ L Dx D> C D R Dx Dx . . L Dx Dx D . R D> Dx [ [ L C> C> D C L Cx C> . C L Cx C> ] ] R Dx Cx . . R Cx Cx C . L C> Cx ] ] R D> <h2>And finally here is how I failed at 2-tag systems <p dir="auto">Although the Turing machine program turned out to be much bigger than I expected --- at least it just took me a couple of minutes to program it. It was a bit annoying<br /> that I could only write one symbol at a time and only scan or read one but despite all of that it was quite an easy task. <p dir="auto">So I first thought --- "geistige Umnachtung" as it is said in German --- that the 2-tag system program would be as easy as the Thue program but it turned out to be far worse ... <p dir="auto">2-tag systems are so called because the first symbol is read then the first two symbols are erased and then according to the rule associated with the symbol, symbols are<br /> added. There is only one direction and no way you can read two or more symbols. <p dir="auto">Here's a sample of a 2-tag system: <p dir="auto">rule: a->aac , initial input: aaa <p dir="auto">Here's the output: <p dir="auto">aaa<br /> aaac<br /> acaac<br /> aacaac<br /> caacaac <p dir="auto">... and then it holds because there is no rule for symbol 'c' <p dir="auto">Here are some of my failing attempts into programming the bouncing ball for 2-tag systems. <pre><code> ] -> ]. . -> .. D -> .D [ -> [. <p dir="auto">The initial input was similar to that in the Turing Machine Program. <p dir="auto">I realized that symbols can get skipped and that this might be the clue in programming a 2-tag system and making it as powerful as a Turing Machine probably but I somehow did not get it. <h1>Zusammenfassung <p dir="auto">Begeistert von meinem letzten Artikel und in voller Euphorie wollte ich dann zeigen wie man eine Turingmaschine durch ein 2-Tag-System emuliert. Als Beispiel hatte ich vor ein einfaches Programm zu schreiben, dass einen Ball darstellt, der immer an einer von zwei Wänden abprallt. Fürs 2-Tag-System habe ich das bis heute nicht geschafft.
Failing At A Bouncing Ball
5 years ago in #programming by mattgroening (59)
$0.64
- Past Payouts $0.64
- - Author $0.32
- - Curators $0.32
40 votes
- twinner: $0.39
- chriddi: $0.07
- vikisecrets: $0.07
- steem-bootcamp: $0.03
- kryptodenno: $0.02
- stayoutoftherz: $0.01
- sirbruce92: $0.01
- kuttmoped: $0.01
- eisenbart: $0.00
- quekery: $0.00
- spirajn: $0.00
- reconnectnature: $0.00
- ichbins: $0.00
- don-thomas: $0.00
- taxguy: $0.00
- m3bot: $0.00
- siphon: $0.00
- dreimaldad: $0.00
- greece-lover: $0.00
- misan: $0.00
- and 20 more
Du hast ein Upvote von unserem Kuration – Support Account erhalten.
Dieser wird nicht von einem Bot erteilt. Wir lesen die Beiträge. (#deutsch) und dann entscheidet der Kurator eigenverantwortlich ob und in welcher Stärke gevotet wird. Unser Upvote zieht ein Curation Trail von vielen Followern hinter sich her!!!
Wir, die Mitglieder des German Steem Bootcamps möchten "DIE DEUTSCHE COMMUNITY" stärken und laden Dich ein Mitglied zu werden.
Discord Server an https://discord.gg/Uee9wDB