22 lines
330 B
Rust
22 lines
330 B
Rust
|
/// 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,
|
||
|
}
|