dancing_droids/src/robot.rs

22 lines
330 B
Rust
Raw Normal View History

2020-10-27 22:55:31 +01:00
/// 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,
}