From 98787b1efb62f23daabfdd7d53fbb98ea64e68d5 Mon Sep 17 00:00:00 2001 From: deadsmond <01.lewicki@gmail.com> Date: Sun, 24 Nov 2019 21:27:57 +0100 Subject: [PATCH] 'hm' --- TaskB01/run | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/TaskB01/run b/TaskB01/run index 1760a2d..e848a27 100644 --- a/TaskB01/run +++ b/TaskB01/run @@ -3,10 +3,11 @@ import sys import re -class automate: - self.storage = [] - self.accepting_states = [] - self.state = '0' +class automata: + def __init__(self): + self.storage = [] + self.accepting_states = [] + self.state = '0' def add_node(self, line): node = line.split(' ') @@ -16,17 +17,16 @@ class automate: self.accepting_states.append() def test_string(self, text): - + for i in text: self.state = self.get_node_transition([self.state, i]) if self.state == None: return 'FALSE' - + if self.state in self.accepting_states: return 'TRUE' else: return 'FALSE' - def get_node_transition(self, query): for i in self.storage: @@ -35,7 +35,7 @@ class automate: return None -auto = automate() +auto = automata() for line in sys.stdin: auto.add_node(line)