Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Please read the forum rules before posting.



Check if you are posting in the correct category.



The Off Topic section is not meant for discussing Cookie Clicker.

Turing mechanics

ZyChromeZyChrome Member Posts: 858 ✭✭✭
edited December 2015 in Off Topic
go to https://turingmachinesimulator.com/ and type stuff!
heres mine
name: 101
init: a
accept: q5

a,_,_,_
a,0,_,1,>,-,-

a,_,_,0
a,1,0,1,>,-,>

a,_,_,1
a,1,_,1,<,-,<

a,_,0,_
a,1,_,1,<,-,<

a,_,0,1
a,1,1,1,>,<,>

a,_,0,0
a,0,1,1,<,>,<

a,_,1,_
a,1,0,0,<,>,>

a,_,1,0
a,1,1,1,<,<,<

a,_,1,1
a,0,1,0,>,>,>

a,0,_,_
a,0,1,_,>,>,>

a,0,_,0
a,1,1,1,<,<,<

a,0,_,1
a,1,1,0,>,<,<

a,0,0,_
a,1,0,1,<,-,<

a,0,0,1
a,1,1,_,<,<,<

a,0,1,_
a,1,1,_,<,-,-

a,0,1,0
a,1,0,1,<,<,<

a,0,1,1
a,1,_,_,<,<,>

a,1,_,_
a,0,1,1,<,>,<

a,1,_,0
a,0,_,1,>,-,<

a,1,_,1
a,0,1,0,>,>,-

a,1,0,_
a,1,1,_,<,-,-

a,1,0,0
a,_,1,0,>,>,-

a,1,0,1
a,1,1,1,-,>,-

a,1,1,_
a,0,1,1,>,>,>

a,1,1,0
a,0,0,1,>,


name:negator
init:0
accept:z

0,1
0,0,>

0,0
0,1,>

0,_
y,_,<

y,1
y,1,<

y,0
y,0,<

y,_
z,_,>


also i think spoilers are broken...
Post edited by ZyChrome on

Comments

  • erdbeereerdbeere Member, Helpful Posts: 3,384 ✭✭✭✭✭
    Have a solution for a bonus exercise from my university days, namely a Turing machine that calculates the square of a number in unary:


    name: square_unary
    init: s
    accept: z

    s,_,_
    z,_,_,-,-

    s,1,_
    a,1,_,-,-

    a,1,_
    a,1,1,>,>

    a,_,_
    b,_,_,-,<

    b,_,1
    b,_,1,-,<

    b,_,_
    c,_,_,<,>

    c,1,1
    c,1,1,<,-

    c,_,1
    d,_,1,>,-

    d,1,1
    e,_,1,>,-

    e,1,1
    e,1,1,>,-

    e,_,1
    f,_,1,>,-

    f,1,1
    f,1,1,>,-

    f,_,1
    f,1,1,>,>

    f,_,_
    g,_,_,<,-

    g,1,_
    g,1,_,<,-

    g,_,_
    h,_,_,-,<

    h,_,1
    h,_,1,-,<

    h,_,_
    i,_,_,<,>

    i,1,1
    c,1,1,<,-

    i,_,1
    z,_,1,-,-</div>
  • ZyChromeZyChrome Member Posts: 858 ✭✭✭
    edited December 2015
    Wow. Just... Wow
    Post edited by ZyChrome on
  • ZyChromeZyChrome Member Posts: 858 ✭✭✭
    i've made a true universal turing machine that can operate anything made only with numbers and blanks, the format of the input string being:
    inputNumbers#nameOfAnyLength!012newCardName!210OtherNewName#nameOfAnyLengthSameOrDifferent
    where 012 is 'read''write''go' read and write can be numbers or . to represent blank, and go can be . for nothing, 0 for left and 1 for right,
    otherwize you can mimic anything!
    The Turing God Has Been Born of the Rain God!
    And I am now Both.
  • DoomlordKravokaDoomlordKravoka Member, Wiener Posts: 3,375 ✭✭✭✭✭
    ZyChrome said:

    i've made a true universal turing machine that can operate anything made only with numbers and blanks, the format of the input string being:
    inputNumbers#nameOfAnyLength!012newCardName!210OtherNewName#nameOfAnyLengthSameOrDifferent
    where 012 is 'read''write''go' read and write can be numbers or . to represent blank, and go can be . for nothing, 0 for left and 1 for right,
    otherwize you can mimic anything!
    The Turing God Has Been Born of the Rain God!
    And I am now Both.

    I can't wait for someone to mess up your "perfect" machine.
  • ZyChromeZyChrome Member Posts: 858 ✭✭✭
    edited January 2016
    only if you enter letters. otherwise its impossible, thats the beauty of turing machines
    here: turingmachinesimulator.com/shared/jgkxeuvxno
  • erdbeereerdbeere Member, Helpful Posts: 3,384 ✭✭✭✭✭
    ZyChrome said:

    i've made a true universal turing machine that can operate anything made only with numbers and blanks, the format of the input string being:
    inputNumbers#nameOfAnyLength!012newCardName!210OtherNewName#nameOfAnyLengthSameOrDifferent
    where 012 is 'read''write''go' read and write can be numbers or . to represent blank, and go can be . for nothing, 0 for left and 1 for right,
    otherwize you can mimic anything!
    The Turing God Has Been Born of the Rain God!
    And I am now Both.

    Could you explain that in more detail? I'm not sure what you are trying to achieve.

    Also:
    ZyChrome said:

    only if you enter letters. otherwise its impossible, thats the beauty of turing machines
    here: turingmachinesimulator.com/shared/jgkxeuvxno

    The link leads to an empty Turing machine.
  • ZyChromeZyChrome Member Posts: 858 ✭✭✭
    edited January 2016
    crap. i thought this might happen. the website creator sends this:
    https://turingmachinesimulator.com/shared/qijjqztzld
    though im updating it to purge a bug.
    a better explanation follows:

    format: input#name!rwgn!rwgn#name!rwgn
    # encases cards #card#card#
    ! begins contingencies !ifThen!ifThen
    rwgn is read/write/go/newCard
    read/write can be . and 0-9 where .=(blank)
    go can be .,0, or 1 where . is nothing, 0 is left and 1 is right

    oops. delete lines 1969-2000 they're bad. i made a mistake in the drection and it cant function.
    replace with this:


    R5,#,_,.
    name,#,_,_,>,>,-

    R5,#,_,0
    name,#,0,_,>,>,-

    R5,#,_,1
    name,#,1,_,>,>,-

    R5,#,_,2
    name,#,2,_,>,>,-

    R5,#,_,3
    name,#,3,_,>,>,-

    R5,#,_,4
    name,#,4,_,>,>,-

    R5,#,_,5
    name,#,5,_,>,>,-

    R5,#,_,6
    name,#,6,_,>,>,-

    R5,#,_,7
    name,#,7,_,>,>,-

    R5,#,_,8
    name,#,8,_,>,>,-

    R5,#,_,9
    name,#,9,_,>,>,-

    name,#,_,_
    Name,#,_,_,-,>,-

    name,0,_,_
    Name,0,_,_,-,>,-

    name,1,_,_
    Name,1,_,_,-,>,-

    name,2,_,_
    Name,2,_,_,-,>,-

    name,3,_,_
    Name,3,_,_,-,>,-

    name,4,_,_
    Name,4,_,_,-,>,-

    name,5,_,_
    Name,5,_,_,-,>,-

    name,6,_,_
    Name,6,_,_,-,>,-

    name,7,_,_
    Name,7,_,_,-,>,-

    name,8,_,_
    Name,8,_,_,-,>,-

    name,9,_,_
    Name,9,_,_,-,>,-


    Edit: my mistake actually goes back to 1935.
    Post edited by ZyChrome on
  • erdbeereerdbeere Member, Helpful Posts: 3,384 ✭✭✭✭✭
    I haven't seen through the whole program, but here are some questions/observations:
    1. I guess that "#name" signals a state with rules for that state following. And there can be any number of "#name" in the input for your machine as well as any number of "!rwgn" following each state. Is that right?
    2. Can there be only zeros, ones and blanks in "input" in the input for your machine?
    3. You change the blanks (".") on the third tape to real blanks ("_") in R4 is that intended?
    4. After encountering the first "#name" and copying the name onto the second tape, you go back to the beginning of your first tape, but don't you want to stop at the beginning of the "#" of the first "#name"?
    The way it is now "R0,_,_,_" brings you to R2 and the first symbol of "input" on the first tape which can't be "#", but "#" is the only symbol on the first tape R2 recognizes.
  • ZyChromeZyChrome Member Posts: 858 ✭✭✭
    edited January 2016
    1. yes, numbers 0-9 and of any length, just know that repeat names will never be used, but 010 and 01 are counted as different as well.
    2. i added other numbers i think, possibly 0-9 only works in the new one, but yes.
    3. yes, i kept the . so it would know if/when it ran into the true beginning instead of the first blank
    4. R0 goes to the right after hitting the first blank because it needs to goto the beginning of the entire string because the same state that copies the first name initially is the one that copies the name after !rwgn when it gets to n and needs to find the card with that name, it doesn't bother to check the card it's currently in, untill it reaches the beginning, which is why i recommend you put cards in order of most used.

    Edit: yes, it does 0-9 completely thru-and-thru
    and as you can see when R0 first hits _ it immediately
    R0,_,_,_
    R2,_,_,_,>,-,-
    goes right and to R2, hitting the first # exactly as planned
    also: if you have any spare time feel free to copy/paste and rewrite from 10 listings 0-9 to add letters too, i would recommend adding it to the R series first, as those are the ones that ignore things, rather than detecting/editing.
Sign In or Register to comment.