i want to know how to write it in a code and will i use it in this state machine or i will use another code ? . and this is all the variable s that i need for now , if there is any thin came up i will modify it.The data structure has been discussed in posts 2,3,5&7. Are you asking how or when to modify them?
By the way, are there any other variables you might need? Like what the elevator is doing?