Merge branch 'robot-struct' into 'master'
position and robot structs See merge request mhart/DancingDroids!11
This commit is contained in:
commit
5ea2024e31
12
src/main.rs
12
src/main.rs
@ -1,6 +1,17 @@
|
|||||||
use std::fs;
|
use std::fs;
|
||||||
use std::io;
|
use std::io;
|
||||||
|
|
||||||
|
struct Position {
|
||||||
|
x: u32,
|
||||||
|
y: u32,
|
||||||
|
}
|
||||||
|
|
||||||
|
struct Robot {
|
||||||
|
id: u32,
|
||||||
|
o: Orientation,
|
||||||
|
p: Position,
|
||||||
|
}
|
||||||
|
|
||||||
enum Orientation {
|
enum Orientation {
|
||||||
N,
|
N,
|
||||||
E,
|
E,
|
||||||
@ -68,5 +79,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