I'm a software engineer, get me out of here: Difference between revisions

Content added Content deleted
(J: part 1)
Line 548: Line 548:
One interpretation of this task would be that, for example, "4" means that it takes 6 hours to traverse that map position. Instead, it looks like "4" means we launch ourselves in one of eight directions and land four squares away -- this process takes one day. This concept adds some complexity to the task (we have to make sure we do not launch ourselves off the map, or outside the safe zones), but also reduces the size of intermediate results.
One interpretation of this task would be that, for example, "4" means that it takes 6 hours to traverse that map position. Instead, it looks like "4" means we launch ourselves in one of eight directions and land four squares away -- this process takes one day. This concept adds some complexity to the task (we have to make sure we do not launch ourselves off the map, or outside the safe zones), but also reduces the size of intermediate results.


Anyways, here's how we can implement this:<syntaxhighlight lang=J>map=: <:,"_1 {.@>:@".@>>cutLF{{)n
Anyways, here's how we can implement part 1:<syntaxhighlight lang=J>map=: <:,"_1 {.@>:@".@>>cutLF{{)n
00000
00000
00003130000
00003130000