Kevin Powell - CommunityKP-C
Kevin Powell - Community4mo ago
80 replies
roelof

How to make this a proper state machine in c++

I have now this c++ code :

enum traffic_colors { 
   RED; 
   GREEN; 
   YELLOW; 
} 

enum traffic_light { 
   color: COLOR; 
   time : int 
   next_color: COLOR 
} 


Is this a proper state machine and if not how can I improve it ?

@Rägnar
Was this page helpful?