billy wrote:
> I found something about protothreads that can be used to simplify the state
> machines.
>
> http://www.sics.se/~adam/pt/expansion-print.html
>
> This is maby something I can use. :-)
Is this a homework? As the article wrote, this is weird code, don't use it.
The simplest solution for a statemachine would be to use an enum with
meaningful names and just a big switch-case.
I assume Edwin means something like the state pattern, as you can implement
it easily in object oriented languages like C++, Java or Lisp:
http://en.wikipedia.org/wiki/State_pattern
In C you'll need function pointers and object handles.
--
Frank Buss,
http://www.frank-buss.de,
http://www.it4-systems.de