Skip to content

Instantly share code, notes, and snippets.

@ADCDS
Last active November 30, 2018 12:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ADCDS/d3d4242136cbd7837a08f56879ab7a47 to your computer and use it in GitHub Desktop.
Save ADCDS/d3d4242136cbd7837a08f56879ab7a47 to your computer and use it in GitHub Desktop.
input: '<aaabaaa'
blank: ' '
start state: start
table:
start:
<: {write: <, R: A}
A:
a: {write: x, R: B}
b: {write: x, R: F}
' ': {write: ' ', L: accept_E}
B:
a: {write: a, R: B}
b: {write: b, R: B}
x: {write: x, R: B}
' ': {write: ' ', L: accept_C}
accept_C:
a: {write: ' ', L: E}
b: {write: a, R: reject_D}
E:
a: {write: a, L: E}
b: {write: b, L: E}
x: {write: x, R: A}
F:
a: {write: a, R: F}
b: {write: b, R: F}
x: {write: x, R: F}
' ': {write: ' ', L: accept_G}
accept_G:
a: {write: a, R: reject_I}
b: {write: ' ', L: H}
H:
a: {write: a, L: H}
b: {write: b, L: H}
x: {write: x, R: A}
accept_E:
reject_I:
reject_D:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment