Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- int main()
- {
- enum Directions {front=1,back,left,right};
- //enum Hands {left,right};
- //const int front{ 1 };
- //const int back{ 2 };
- //const int left{ 3 };
- //const int right{ 4 };
- Directions monsterDirection{ front };
- //...
- monsterDirection = -158;
- if (monsterDirection == front)
- {
- //.. some front action
- }
- else if (monsterDirection == back)
- {
- //.. some back action
- }
- else if (monsterDirection == left)
- {
- //.. some left action
- }
- else if (monsterDirection == right)
- {
- //.. some right action
- }
- else
- {
- //.. invalid direction
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement