summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/utils.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/utils.rs b/src/utils.rs
index bd435af..9f2e0d2 100644
--- a/src/utils.rs
+++ b/src/utils.rs
@@ -7,6 +7,15 @@ pub enum Cardinal {
}
impl Cardinal {
+ pub fn to_string(&self) -> &'static str {
+ match self {
+ Self::North => "north",
+ Self::South => "south",
+ Self::West => "west",
+ Self::East => "east",
+ }
+ }
+
pub fn turn_cw(&self) -> Self {
match self {
Self::North => Self::East,