Skip to main content
6 events
when toggle format what by license comment
Jul 2, 2015 at 14:18 comment added WernerCD Added Version #2, which includes some things from this answer (StopWatch, Action list)
Jul 1, 2015 at 8:50 comment added outoftime @WernerCD I went a sleep and when wake up, Rick Davin finished his version first.
Jun 30, 2015 at 22:57 comment added WernerCD Otherwise, I do like the Action part (I've used Actions in passing before). I'll have to see if i can wrap my head around it and work it in.
Jun 30, 2015 at 22:55 comment added WernerCD I was going to ask how this tracked the points the critter walked to determine when if crossed it's path (which is why my answer has Dict<Int,List<int>> - Dict<int, is X, List<int>> is Y and they both are required to "remember" where we've traveled. If I've put 4 in A[0], that means I go north 4 spaces: (0,0),(0,1),(0,2),(0,3),(0,4). Path[0] would then be a list of 0...4. Later, if I stop on (0,3) (not an end point, but a part of the path), that counts as crossing the path.
Jun 30, 2015 at 22:33 comment added Rick Davin I can forgive the Java style answer for a C# question, but your solve method returns the wrong result for the example input set of { 1, 3, 2, 5, 4, 4, 6, 3, 2 }. It's not a question of whether the ending points lands on a previous point but rather if the segment (or vector) between the current point and previous point would collide with any segments formed by the previous coordinates.
Jun 30, 2015 at 21:44 history answered outoftime CC BY-SA 3.0