Commit Graph

137 Commits

Author SHA1 Message Date
Volodymyr Patuta f4dde09370 fixed check_map() 2020-10-30 15:59:01 +01:00
Martin HART 5d4d3a29c7 Change string conversion methods 2020-10-30 15:29:52 +01:00
Martin HART 46d4f27e24 Add instruction validator 2020-10-30 15:15:11 +01:00
Martin HART 6fa55b6924 Need to fix a lot of bugs... 2020-10-30 13:23:17 +01:00
Martin HART f4a1eac5b7 Convert values of the setup line 2020-10-30 12:08:12 +01:00
Martin HART 5c9aeabd03 parse token setup line 2020-10-30 11:56:24 +01:00
Martin HART a50ec5d79b change var name 2020-10-29 14:52:43 +01:00
Martin HART 037df42271 correct typo 2020-10-29 14:44:16 +01:00
Martin HART 0dd5080d63 Change err msg 2020-10-29 14:43:38 +01:00
Martin HART cd0f4a0867 Add shitty parser 2020-10-29 14:34:04 +01:00
Martin HART d2058ef71d del unused var 2020-10-29 11:55:29 +01:00
EliasCubz 15d8cc473a change of style 2020-10-29 10:52:06 +01:00
EliasCubz 506a71f678 added test of function check collisions 2020-10-29 10:47:49 +01:00
EliasCubz 782fccf31c Added function's description to the doc for check_collisions 2020-10-29 10:32:32 +01:00
EliasCubz e4b25281f7 function to check collisions at given position 2020-10-29 10:30:11 +01:00
EliasCubz d35da41c90 test of the function check_map 2020-10-29 10:16:09 +01:00
EliasCubz 2eaf624137 function to check if robot is in the map 2020-10-29 10:05:54 +01:00
EliasCubz 4fc0f07e78 declare prototype func collision and check if robot is in the map 2020-10-29 09:28:13 +01:00
Martin HART 15b68ae764 Merge branch 'parsing-config-file' into 'master'
Parsing config file prototype

See merge request mhart/DancingDroids!32
2020-10-29 09:15:51 +01:00
Volodymyr Patuta 83cbb0094e pub-issues 2020-10-28 21:38:30 +01:00
Volodymyr Patuta cd15d12549 comment 2020-10-28 19:18:31 +01:00
Volodymyr Patuta b8929887b5 omg... 2020-10-28 19:12:30 +01:00
Martin HART 2aa2af59ec simple typo 2020-10-28 18:29:16 +01:00
Volodymyr Patuta 0931835850 added hash in execute_instruction 2020-10-28 18:20:37 +01:00
Martin HART 44545cdc07 This is really bad.... 2020-10-28 18:05:22 +01:00
Volodymyr Patuta 466a257300 oups 2020-10-28 17:32:36 +01:00
Volodymyr Patuta c9ad310700 create and move robot + tests 2020-10-28 17:30:45 +01:00
Martin HART 194d6f5df2 Remove .unwrap() shit 2020-10-28 16:50:49 +01:00
Martin HART e4001c99c7 add token 2020-10-28 16:42:36 +01:00
Martin HART 9d0b96b4d7 add mut to the pool O_o 2020-10-28 16:17:34 +01:00
Martin HART 0a63ab5b53 exemple token 2020-10-28 14:06:03 +01:00
Martin HART bbcbfd4d41 Catch the first ligne of the config file
or throw a error !
2020-10-28 13:09:07 +01:00
Martin HART 430e706831 Prototype of the parsing_config() func 2020-10-28 12:36:56 +01:00
Martin HART 555a0ff6b8 x and y should be public 2020-10-28 12:20:20 +01:00
Martin HART c422060faf represent the world in a struct 2020-10-28 12:07:20 +01:00
Martin HART 77785e0d6d add vec of robot 2020-10-28 12:00:17 +01:00
Martin HART f88c972ceb Robot type 2020-10-27 22:55:31 +01:00
Martin HART 6f34f27eaa pop() shit 2020-10-27 16:09:44 +01:00
Martin HART ac6df77d8f pileOfShit.pop() 2020-10-27 15:58:19 +01:00
EliasCubz 00405e0df5 remove instruction related code 2020-10-27 13:32:00 +01:00
EliasCubz c1685f7f6e remove move left/right 2020-10-27 13:27:57 +01:00
Volodymyr Patuta f7d86c9991 completed move functions 2020-10-26 20:15:44 +01:00
Volodymyr Patuta 80dfe2d69e add place_robot + tests, changed coordinate calculation, fixed borrowing issues 2020-10-26 20:11:27 +01:00
stephane elias benabdeslam 106b19c73b Update main.rs 2020-10-26 15:29:14 +01:00
stephane elias benabdeslam 9bb4366eb5 Update main.rs 2020-10-26 15:25:18 +01:00
Martin HART 190423aacb Merge branch 'master' of https://framagit.org/mhart/DancingDroids into copyright
sync changes
2020-10-26 13:55:11 +01:00
Martin HART 2486cee7e1 Add copyright 2020-10-26 13:55:05 +01:00
Volodymyr Patuta 9d0dd5e6f7 add tests for `is_valid()` method 2020-10-26 13:45:04 +01:00
Volodymyr Patuta 62433b0fd2 change position x,y type + method is_valid and test for move robot 2020-10-26 13:32:14 +01:00
Martin HART 771a585446 add test_new_robot() 2020-10-26 13:14:44 +01:00
Martin HART 997b9d8dfb Add create() and new() methods to the Robot type 2020-10-26 13:00:30 +01:00
Martin HART bb58983b6c Change .create_map() to .create(), and turn* to set* 2020-10-20 21:39:45 +02:00
Volodymyr Patuta 2603fb5751 test of World methods 2020-10-20 17:33:57 +02:00
Martin HART 67c292b9e2 Add empty_position() 2020-10-20 16:57:51 +02:00
Martin HART 569a6eaf94 Change to_ to turn_ 2020-10-20 16:00:26 +02:00
Martin HART 2dba5a9721 add queues to Robot 2020-10-20 15:38:03 +02:00
Volodymyr Patuta ea4e5bad6d fix arrow type 2020-10-20 14:10:47 +02:00
Martin HART f1f052bdde add somme comments 2020-10-20 14:06:10 +02:00
Volodymyr Patuta f639fa3d63 set robot on the map 2020-10-20 13:57:23 +02:00
Martin HART 6c19f303fa Add create_map() 2020-10-20 13:42:32 +02:00
Volodymyr Patuta 7d89451fef we don't want to panic! 2020-10-20 13:17:50 +02:00
Volodymyr Patuta 0966268c85 open_file takes value of arg 2020-10-20 13:03:53 +02:00
Martin HART 861001a2e1 Add flags 2020-10-20 12:48:28 +02:00
Volodymyr Patuta e58313d76c implement orientation change and instructions to the robot 2020-10-20 11:53:53 +02:00
Volodymyr Patuta 015a8a33ae error handling in main 2020-10-19 12:50:48 +02:00
Volodymyr Patuta 22cf314f4d add map 2020-10-19 12:32:14 +02:00
Volodymyr Patuta b2b00d0d62 added struct World 2020-10-19 12:23:38 +02:00
mhart a55a4935ac Rename conf to raw_conf, conf will be the parsed configuration String 2020-10-17 21:17:36 +02:00
mhart bd89bfa744 Add Vec<Robot> to store all the robots 2020-10-17 21:05:06 +02:00
mhart 8508c53bef Add documentation to main.rs 2020-10-17 18:16:40 +02:00
Volodymyr Patuta a688c11d4b Changed position to u32 and added ID. 2020-10-16 12:59:40 +02:00
Volodymyr Patuta 918334a3cb position and robot structs 2020-10-16 09:11:28 +02:00
Volodymyr Patuta 972850310e No need to test file without permission. 2020-10-13 12:27:41 +02:00
Volodymyr Patuta 8c04fe7b9d Added `test_open_file()` 2020-10-13 12:15:04 +02:00
mhart 1ee584801a Add test to
parse_orientation()
parse_instruction()
2020-10-13 12:08:26 +02:00
Volodymyr Patuta 3106882ddb Update main.rs 2020-10-13 10:31:50 +02:00
Volodymyr Patuta 630e5e05b1 func to get file content as Result<String> 2020-10-13 10:19:34 +02:00
mhart 8c16773fe9 Revert "Change (c : char) in"
This reverts commit edf29050c6.

Bad optimization...
2020-10-11 21:45:56 +02:00
mhart edf29050c6 Change (c : char) in
parse_orientation()
parse_instruction()
to (c: &char)
2020-10-11 20:24:35 +02:00
mhart 6e1589ff7d Change Option<> in
parse_orientation()
parse_instruction()
for Result<Instruction, &'static str>
2020-10-11 20:10:17 +02:00
mhart c2d6e3422d Add parse_instruction()
Same as the parse_orientation() function but for the instruction model
2020-10-11 18:31:56 +02:00
mhart c1143ee396 Add parse_orientation()
This function parse a char and return the matching direction or None
2020-10-11 18:27:39 +02:00
mhart dcbc5aa74c correct typo 2020-10-11 18:25:42 +02:00
mhart 699933fcfd Load the 'simple' intruction file into a string.
Need to incorporate flags OR/AND stdin parsing in a later stage.
2020-10-11 15:14:20 +02:00
mhart b811b1a1c1 fix tipo error and create enum to represent instructions 2020-10-06 23:28:59 +02:00
mhart e6433f48ae Create enum to represent directions 2020-10-06 23:25:17 +02:00
Axel Viala ed2b1b152d initial commit let's droid dance. 2020-10-06 20:42:34 +02:00