[Tutor] what's a state machine?

Alan Gauld alan.gauld at blueyonder.co.uk
Thu Aug 7 00:14:02 EDT 2003


> >The secret is to model the machine as a big table:
> >
> >Current State|Event|Action|Next State

> This is fascinating stuff. 

It is indeed. I meant to mention that it is theoretically possible 
to model any system as a state machine since at a trival level 
every software program can have the states:

Initialising
Running
Stopping

At this level the system while running is just a traditional event 
loop as used in GUI systems. Thus any GUI application can be 
designed using tools like SDL, and built using state techniques.
For example a modal dialog represents a state, during which only 
a limited set of events are permitted...

In batch processing states could include such things as
DatabaseOpen(or FileOpen)
ReadingData
ProcessingData

etc
In this case the program sends itself events whhich are 
processed according to current state...

Alan G
Author of the Learn to Program web tutor
http://www.freenetpages.co.uk/hp/alan.gauld



More information about the Tutor mailing list