I have this code I'm trying, but it's not producing the result I expect.
map nw -1 1 n 0 1 w -1 0 e 1 0 s 0 -1 se 1 -1;
def nextstep
cond and samecase space #1 space #0 onboard #1 (fn nextstep #1 where #1 direction #0 #1) #1;
def TEST mergeall
fn nextstep #0 where #0 nw
fn nextstep #0 where #0 n
fn nextstep #0 where #0 w
fn nextstep #0 where #0 e
fn nextstep #0 where #0 s
fn nextstep #0 where #0 se;
print fn TEST d4;
print fn nextstep d4 where d4 s;
I thought fn TEST d4 would return an array of coordinates, but instead it seems to produce an empty array. The bottom print command works as expected, so the problem has to be with TEST, but I can't figure it out.
I have this code I'm trying, but it's not producing the result I expect.
I thought
fn TEST d4
would return an array of coordinates, but instead it seems to produce an empty array. The bottom print command works as expected, so the problem has to be with TEST, but I can't figure it out.