add Task206.py
This commit is contained in:
parent
f87398e70c
commit
4332aabe86
40
automata/Task206.py
Normal file
40
automata/Task206.py
Normal file
@ -0,0 +1,40 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
Rozwiązanie zadania 206
|
||||
"""
|
||||
|
||||
from deterministic_automaton import DeterministicAutomaton
|
||||
|
||||
def big_no_automaton():
|
||||
automaton = DeterministicAutomaton()
|
||||
|
||||
|
||||
state_a = automaton.add_state()
|
||||
state_b = automaton.add_state()
|
||||
state_c = automaton.add_state()
|
||||
state_d = automaton.add_state()
|
||||
state_e = automaton.add_state()
|
||||
state_f = automaton.add_state()
|
||||
state_g = automaton.add_state()
|
||||
state_h = automaton.add_state()
|
||||
state_i = automaton.add_state()
|
||||
state_z = automaton.add_state()
|
||||
|
||||
automaton.mark_as_initial(state_a)
|
||||
automaton.mark_as_final(state_z)
|
||||
|
||||
automaton.add_transition(state_a, 'N', state_b)
|
||||
automaton.add_transition(state_b, 'O', state_c)
|
||||
automaton.add_transition(state_c, 'O', state_d)
|
||||
automaton.add_transition(state_d, 'O', state_e)
|
||||
automaton.add_transition(state_e, 'O', state_f)
|
||||
automaton.add_transition(state_f, 'O', state_g)
|
||||
|
||||
automaton.add_transition(state_g, 'O', state_g)
|
||||
automaton.add_transition(state_g, '!', state_z)
|
||||
# automaton.add_transition(state_f, 'O', state_g)
|
||||
# automaton.add_transition(state_f, 'O', state_g)
|
||||
|
||||
return automaton
|
Loading…
Reference in New Issue
Block a user