We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2b7a398 commit ae1e2e4Copy full SHA for ae1e2e4
src/direction.rs
@@ -0,0 +1,26 @@
1
+pub enum Direction4 {
2
+ Up,
3
+ Right,
4
+ Down,
5
+ Left,
6
+}
7
+
8
+impl Direction4 {
9
+ pub fn turn_right(self) -> Self {
10
+ match self {
11
+ Self::Up => Self::Right,
12
+ Self::Right => Self::Down,
13
+ Self::Down => Self::Left,
14
+ Self::Left => Self::Up,
15
+ }
16
17
18
+ pub fn turn_left(self) -> Self {
19
20
+ Self::Up => Self::Left,
21
+ Self::Left => Self::Down,
22
+ Self::Down => Self::Right,
23
+ Self::Right => Self::Up,
24
25
26
src/lib.rs
@@ -1,4 +1,5 @@
#[macro_use]
pub mod parse;
+pub mod direction;
pub mod map;
pub mod points;
0 commit comments