covid-sim
src
Direction.cpp
1
#include "Direction.hpp"
2
#include <stdexcept>
3
4
Direction rotate_left(Direction direction) {
5
switch
(direction) {
6
case
Right:
return
Up;
7
case
Up:
return
Left;
8
case
Left:
return
Down;
9
case
Down:
return
Right;
10
}
11
throw
std::out_of_range(
"direction"
);
12
}
Generated by
1.8.14