Moore machine

From dankwiki