Complete the code to define an entry action in a state.
state EntryActionState {
entry: [1];
}The entry action runs when the state is entered. Using disp('Entering state') shows a message at entry.
Complete the code to define a during action that runs repeatedly in a state.
state DuringActionState {
during: [1];
}The during action runs repeatedly while the state is active. disp('State active') shows a message continuously.
Fix the error in the exit action code to correctly display a message when leaving the state.
state ExitActionState {
exit: [1];
}The exit action runs once when leaving the state. Using disp('Leaving state') correctly shows the exit message.
Fill both blanks to create a state with entry and exit actions that display messages.
state MessageState {
entry: [1];
exit: [2];
}The entry action uses disp('Start') to show a start message. The exit action uses disp('Stop') to show a stop message.
Fill all three blanks to create a state with entry, during, and exit actions that display messages.
state FullActionState {
entry: [1];
during: [2];
exit: [3];
}The entry action shows disp('Entering'), the during action shows disp('Active'), and the exit action shows disp('Exiting'). This covers all three action types.
