From 918334a3cb6fdabea4475134c06eabf10665d69e Mon Sep 17 00:00:00 2001 From: Volodymyr Patuta <6977238-fiplox@users.noreply.gitlab.com> Date: Fri, 16 Oct 2020 09:11:28 +0200 Subject: [PATCH 1/2] position and robot structs --- src/main.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index a27e2b3..60212cc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,16 @@ use std::fs; use std::io; +struct Position { + x: i32, + y: i32, +} + +struct Robot { + o: Orientation, + p: Position, +} + enum Orientation { N, E, @@ -68,5 +78,4 @@ mod tests { assert!(open_file("two_robots.txt").is_ok()); assert!(open_file("test_unexisting_file.extension").is_err()); } - } From a688c11d4b6a94d3d03dbc3fbfd283c8f58a6058 Mon Sep 17 00:00:00 2001 From: Volodymyr Patuta <90917-fiplox@users.noreply.framagit.org> Date: Fri, 16 Oct 2020 12:59:40 +0200 Subject: [PATCH 2/2] Changed position to u32 and added ID. --- src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 60212cc..48fdae4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,11 +2,12 @@ use std::fs; use std::io; struct Position { - x: i32, - y: i32, + x: u32, + y: u32, } struct Robot { + id: u32, o: Orientation, p: Position, }