I am too lucky, since my answer is 378980 then it took only 61262ms (one minute!!). User16087 says 30M, then mine is about 1%...

Aha, it was "part 1". My answer for "part 2" is 26,889,114 then about 30M. It took 4496315ms (about 75 min.)

I used another pattern that Evaluate("Case()"), emulation for inline "While ... Wend" (or "Loop... Exit Loop If ... End Loop).

Let ( [

$maze=Puzzle::Puzzle;

$c=ValueCount($maze);

$step=0;

$pos=1;

f1="Let([$step=$step+1;v=GetValue($maze;$pos);nextpos=$pos+v;$maze=Case($pos>1;LeftValues($maze;$pos-1))&(v+1)&Case($pos<$c;\¶&RightValues($maze;$c-$pos));$pos=nextpos];$pos>$c);$step;";

$f2="Case(" & Substitute(10^400-1;9;f1) & "-1)";

f3="Evaluate($f2)<>-1;$step;";

$f4="Case(" & Substitute(10^400-1;9;f3) & "-1)";

f5="Evaluate($f4)<>-1;$step;"

] ;

//

Evaluate(

"Case(" & Substitute(10^400-1;9;f5) & "-1)"

//

)

)

This is not written as infinite loop (endless recursive call), there is limit at 400^3=64,000,000. So it is really lucky I can get answer with this for "part 2". I hadn't test it with adding one more 10^400, it will take at least 3 hours if works.

First I mistook using List(LeftValues();value;RightValues()), this insert extra line break (value) in list...

No, I used data in Jeremy's file on Day 1 then got message like "your answer is incorrect but matched to someone else's".

And Malocolm's answers for Day 5 are 375042 and 28707598.

I'm not sure why the answers are not same but very close on this puzzle.

I forgot to mention my code is for part 1, for part 2 need changing

&(v+1)&

to

&Case(v<3;v+1;v-1)&

I simply counted "Go To Record" steps. Easy to design and hard to get wrong.

Malcolm