Ask your own question, for FREE!
MIT 6.01SC Introduction to Electrical Engineering and Computer Science I 19 Online
OpenStudy (anonymous):

SoftwareLab 2: I got some guidance from https://tetriminos.wordpress.com/category/education/mit-ocw/6-01-introduction-to-eecs-i/

OpenStudy (anonymous):

################################## # Double Delay SM ################################## class Delay2Machine(sm.SM): def __init__(self, val0, val1): self.startState = (val0,val1) def getNextValues(self, state, inp): return ((state[1],inp),state[0])

OpenStudy (anonymous):

class CommentsSM(sm.SM): startState = 'Silent' def getNextValues(self, state, inp): if state == 'Silent': if inp == '#': return ('Echoing',inp) else: return ('Silent',None) else: if inp == '\n': return ('Silent', None) else: return ('Echoing', inp)

OpenStudy (anonymous):

class FirstWordSM(sm.SM): startState = 'Start_of_Line' def getNextValues(self, state, inp): if state == 'Start_of_Line': if inp!= '\n' and inp !=' ': return ('Echoing',inp) else: return ('Start_of_Line',None) elif state == 'Echoing': if inp == '\n': return ('Start_of_Line', None) elif inp ==' ': return('Silent',None) else: return ('Echoing', inp) else: if inp == '\n': return ('Start_of_Line', None) else: return ('Silent',None)

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!