Our enum type ServerState has an underlying int type.
The possible values for ServerState are defined as constants in an enum. In Nim, the enums automatically get successive integer values starting from 0.
By implementing the toString method, values of ServerState can be printed out or converted to strings.
To run the program, put the code in enums.nim and use nim to compile and execute it.
The transition procedure emulates a state transition for a server; it takes the existing state and returns a new state.