Skip to content

Instantly share code, notes, and snippets.

@blackmius
Last active June 2, 2020 00:25
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 blackmius/86ed874c4995a08da497971eb25e79f5 to your computer and use it in GitHub Desktop.
Save blackmius/86ed874c4995a08da497971eb25e79f5 to your computer and use it in GitHub Desktop.
name: remove last symbol
source code: |
input: 'babbaababbb'
blank: ' '
start state: right
table:
# scan to the rightmost symbol
right:
['a','b']: R
' ' : {L: clear}
# then carry the 1
clear:
' ' : {L}
['a','b']: {write: ' ', L: done}
done:
positions:
right: {x: 230, y: 250}
clear: {x: 390.36, y: 249.99, fixed: false}
done: {x: 570, y: 250}
editor contents: |-
input: 'babbaababbb'
blank: ' '
start state: right
table:
# scan to the rightmost symbol
right:
['a','b']: R
' ' : {L: clear}
# then remove the last
clear:
' ' : {L}
['a','b']: {write: ' ', L: done}
done:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment