Skip to content

Instantly share code, notes, and snippets.

@bgrenet
Created January 5, 2026 09:12
Show Gist options
  • Select an option

  • Save bgrenet/2050b0a68bc2508a03c5647ee41d0744 to your computer and use it in GitHub Desktop.

Select an option

Save bgrenet/2050b0a68bc2508a03c5647ee41d0744 to your computer and use it in GitHub Desktop.
Exemples cours 1
name: écrit01
source code: |
input: ''
blank: ' '
start state: q0
table:
q0:
' ': {write: 0, R: q1}
q1:
' ': {write: 1, R: q0}
positions:
q0: {x: 329.64, y: 252.94}
q1: {x: 469.3, y: 247.11, fixed: false}
name: incrément
source code: |-
input: '101011'
blank: ' '
start state: droite
table:
droite:
[0, 1]: R
' ': {L: retenue}
retenue:
1: { write: 0, L }
[' ',0]: { write: 1, L: gauche }
gauche:
[0, 1]: L
' ': { R: fin }
fin:
positions:
droite: {x: 187.3, y: 211.38}
retenue: {x: 351.35, y: 215.69}
gauche: {x: 505.35, y: 216.41}
fin: {x: 683.49, y: 217.69}
name: palindromes
source code: |-
input: 'ABBABBA'
blank: ' '
start state: '?'
table:
'?':
A: {write: ' ', R: luA}
B: {write: ' ', R: luB}
' ': {R: oui}
luA:
[A,B]: R
' ': {L: 'A?'}
luB:
[A,B]: R
' ': {L: 'B?'}
'A?':
[A, ' ']: {write: ' ', L: '←'}
B: {R: non}
'B?':
A: {R: non}
[B, ' ']: {write: ' ', L: '←'}
'←':
[A,B]: L
' ': {R: '?'}
oui:
non:
positions:
'?': {x: 172.75, y: 233.71}
luA: {x: 302.99, y: 134.29}
luB: {x: 293.21, y: 331.69}
A?: {x: 486.06, y: 136.14}
B?: {x: 476.52, y: 329.85}
←: {x: 388.11, y: 240.88}
oui: {x: 167.35, y: 391.66}
non: {x: 582.29, y: 235.27}
name: parenthèses
source code: |
input: 'aababb'
blank: ' '
start state: '?'
table:
'?':
X: R
a: { write: X, R: '↝'}
b: { R: non }
' ': { R: oui }
'↝':
[a, X]: R
b: { write: X, L: '↜' }
' ': { R: non }
'↜':
[a, X]: L
' ': { R: '?' }
oui:
non:
positions:
'?': {x: 194.48, y: 236.58}
↝: {x: 454.74, y: 237.85}
↜: {x: 326.32, y: 120.1}
oui: {x: 190.49, y: 344.08}
non: {x: 332.38, y: 348.04}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment