↑ UP | Function propose_len_moves |
∇ Z←State propose_len_moves A;Len;Moves;Rad;Progress;N;Max_N [1] ⍝ [2] ⍝⍝ perform all combinations of Len moves from repertoire A. [3] ⍝⍝ Return the first combination (if any) that makes progress [4] ⍝ [5] (Moves Len)←A ◊ Rad←Len⍴⍴Moves [6] N←0 ◊ Max_N←(⍴Moves)⋆Len [7] ⍝'Length: ' Len 'Count:' Max_N [8] LOOP: Z←Moves[1+Rad⊤N] ◊ →(State try_moves ∈Z)/0 [9] →(Max_N>N←N+1)/LOOP [10] Z←'' ∇ |