Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type direction = Gauche | Droite;;
- type symbole = char;;
- type position = int;;
- type etat = string;;
- type ruban = position -> symbole;;
- type etat_global =
- Etat of etat
- | Ruban of ruban
- | Pos of position;;
- type regle = etat * symbole * symbole * direction * etat;;
- type programme = regle list;;
- type tm =
- Programme of programme
- | Ei of etat
- | Efinaux of etat list;;
- let r' r p s = fun pos -> if p = pos then s else (r pos);;
- let print_direction d =
- match d with
- | Gauche -> print_string "Gauche"
- | _ -> print_string "Droite";;
- let affiche_etat_global eg =
- let rec affiche_helper eg pos =
- if (pos <= 10)
- then
- print_char (eg.Ruban pos);
- affiche_helper eg (pos + 1)
- in
- affiche_helper eg (eg.Pos - 10);;
- let d = Gauche;;
- print_direction d;;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement