diff --git a/src/main.rs b/src/main.rs index 215b814..ba78715 100644 --- a/src/main.rs +++ b/src/main.rs @@ -17,6 +17,8 @@ use clap::{App, Arg}; use std::fs; use std::io; +mod robot; + /// Retrieve the content of a file and return it as a string. fn open_file(filename: &str) -> io::Result { let content = fs::read_to_string(filename)?; diff --git a/src/robot.rs b/src/robot.rs new file mode 100644 index 0000000..a9d6e6a --- /dev/null +++ b/src/robot.rs @@ -0,0 +1,21 @@ +/// A Robot *aka droid* is represented here. +/// Each robot must have a unique id. +pub struct Robot { + id: u32, + o: Orientation, + p: Position, +} + +/// Enum to store all possible orientations. +enum Orientation { + N, + E, + S, + W, +} + +/// Struct to store robot position. +struct Position { + x: i32, + y: i32, +}