Commit Graph

26 Commits

Author SHA1 Message Date
689fb894ad report position of the obstacle when stopped 2023-01-23 22:22:12 +00:00
dc9088ffa5 implement collision detection 2023-01-23 22:17:58 +00:00
8b638fcc18 move expect macro nearer its first use 2023-01-22 22:09:34 +00:00
64c9fd7b88 handle north pole 2023-01-22 22:05:14 +00:00
4b1f2ee923 add test for southern hemisphere 2023-01-22 21:39:56 +00:00
33243ca123 mars is a sphere: account for wrapping x values and scaling when y>0 2023-01-22 21:37:53 +00:00
bcd833e26b avoid resultant lateral movement except at equator
if x and y represent lat/long, the angular distance we move
along the lines of longitude will vary depending on latitude.
2023-01-22 19:07:25 +00:00
570fe8dadc test list for wrapping around a sphere 2023-01-22 19:05:35 +00:00
7b68206577 make turn-left/right return mergable tables
this gives greater symmetry with `drive`
2023-01-22 18:50:38 +00:00
13e283a2a5 extract drive function which can go forward and backward 2023-01-22 18:47:54 +00:00
a4ac0dfe52 oops, forgot to implement backwards 2023-01-22 18:42:38 +00:00
67bfda490e rewrite execute usiung accumulate, add second test case 2023-01-22 18:19:04 +00:00
574c982368 make execute a regular function not a method 2023-01-22 18:12:58 +00:00
db552b8c11 extract common call to merge 2023-01-22 18:11:43 +00:00
94325e53a0 separate turn-left and turn-right functions 2023-01-22 18:09:39 +00:00
e746bb514e now it can turn left as well as right 2023-01-22 18:06:41 +00:00
78484b1115 implement rotate right 2023-01-22 18:03:16 +00:00
f8a58c4a68 extract function "command" 2023-01-22 17:54:03 +00:00
3375906dee rename command -> execute 2023-01-22 17:51:53 +00:00
1ba4399221 reduce repetition 2023-01-22 17:50:48 +00:00
c02c0aabca test it acts on multiple commands
as opposed to accepting multiple commands and ignoring them
2023-01-22 17:31:09 +00:00
b4ade2e114 test it works with non-zero starting position 2023-01-22 17:30:56 +00:00
6546a16ec6 move forward east and west 2023-01-22 17:21:34 +00:00
89945064d5 moves forward southwards 2023-01-22 17:15:23 +00:00
74fb26f293 write expect macro for ease of testing. first test passes 2023-01-22 17:12:18 +00:00
459b1088c1 first failing test 2023-01-22 14:59:29 +00:00