Python - 525 491 478 430 bytes r=range def t(s): m=s.find("\n")+1 for q in r(4): try: for i in r(-q%2,m-1,2): for j in r(-q/2,len(s)/m,2): k,g=j*m+i,"" b=[k,k+1,k+m,k+m+1] ...

KindaRandomAI Every turn, do the following: If there is a token at your position, "EAT". Otherwise, move in a random viable direction, i.e. if you're at the left edge don't say "LEFT". kindaRandomAI ...

NaiveAI Starting with r=0, look at all tokens with taxicab distance r away from your position. If there are any, pick one that would give you the highest score if you got it right now. Otherwise, ...

Python, 217 bytes def f(A,B): x=y=0;c=[-1,1,0] for i in range(len(A)): a=A[i];b=B[i] for s in[0,1]: if(a,b)==(2,1):return c[s]*c[x<1] if(a,b)==(2,3)and x<1:return-c[s] x-=c[a-1];...

Python 2, 236 bytes n=input();r=len;u=[("",*(n//4))] while n>r(u[-1]): y,t=u.pop() for c in 0,1: s=t[:];u+=(y+"LR"[c],s), for i in range(r(s)): if-~r(y)//-~i*-~i==-~r(y):s[i]+=2*c-1;...

Python 3, 319, 270, 251 bytes t,h,n,k,q*=range,input(),1,2, while h>len(q)or n*k<=len(str(q[h])): q+=[int("".join([str(c+s)for c in t(k+1)if c-y]))for s in t(10**~-n,10**n)for y in t(...