Skip to content

Instantly share code, notes, and snippets.

@ADCDS
Created November 30, 2018 13:37
Show Gist options
  • Save ADCDS/286754499c11795d4fb0b46af62a353c to your computer and use it in GitHub Desktop.
Save ADCDS/286754499c11795d4fb0b46af62a353c to your computer and use it in GitHub Desktop.
input: '<abbabbbaaa'
blank: ' '
start state: start
table:
start:
<: {write: <, R: A}
A:
x: {write: x, R: A}
a: {write: x, R: B}
b: {write: x, R: D}
B:
a: {write: a, R: B}
x: {write: x, R: B}
b: {write: x, L: C}
' ': {write: ' ', R: error_G}
C:
a: {write: a, L: C}
x: {write: x, L: C}
b: {write: b, L: C}
<: {write: <, R: A}
D:
a: {write: x, L: E}
b: {write: b, R: D}
x: {write: x, R: D}
' ': {write: ' ', R: error_F}
E:
a: {write: a, L: E}
x: {write: x, L: E}
b: {write: b, L: E}
<: {write: <, R: A}
error_F:
error_G:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment