position and robot structs
This commit is contained in:
parent
cff39f9dad
commit
918334a3cb
11
src/main.rs
11
src/main.rs
@ -1,6 +1,16 @@
|
|||||||
use std::fs;
|
use std::fs;
|
||||||
use std::io;
|
use std::io;
|
||||||
|
|
||||||
|
struct Position {
|
||||||
|
x: i32,
|
||||||
|
y: i32,
|
||||||
|
}
|
||||||
|
|
||||||
|
struct Robot {
|
||||||
|
o: Orientation,
|
||||||
|
p: Position,
|
||||||
|
}
|
||||||
|
|
||||||
enum Orientation {
|
enum Orientation {
|
||||||
N,
|
N,
|
||||||
E,
|
E,
|
||||||
@ -68,5 +78,4 @@ mod tests {
|
|||||||
assert!(open_file("two_robots.txt").is_ok());
|
assert!(open_file("two_robots.txt").is_ok());
|
||||||
assert!(open_file("test_unexisting_file.extension").is_err());
|
assert!(open_file("test_unexisting_file.extension").is_err());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user