Talk:Push-down automaton

From Esolang
Jump to navigation Jump to search

I wish I was so lucky as to own a push-down automaton, but I'm stuck with my humble finite state machine... —ehird 16:36, 22 December 2010 (UTC)

umm actually it is possible, a () detector: BestCoder (talk)

input: 's()e'
blank: ' '
start state: right
table:
  right:
    a: R
    b: R
    s: R
    1: R
    "(": {write: a, L: add}
    ")": {write: b, L: rem}
    "e": {L: check}
  add:
    a: L
    b: L
    "s": {L: astack}
  rem:
    a: L
    b: L
    "s": {L: rstack}
  astack:
    " ": {write: 1, R: right}
    1: L
  rstack:
    1: L
    " ": {R: r}
  r:
    1: {write: " ", R: right}
    " ": {R: deny}
  check:
    " ": {L: accept}
    1: {L: deny}
    a: L
    b: L
  accept:
  deny:
also use website: turingmachine.io