robot "Mouse" author "SANYA" color 808080 front eye back gun +rw1_std.rwi main() { buf = 0 recv buf say "N=&N " if(N==@mouse) // received code from mouse { say "receive X=&X Y=&Y buf=&BUF " xx=X yy=Y if(yy<=0) { left;left yy = -yy xx = -xx } while(1) { act front if(d==1) { if(n==1) break if(n==2) call attack if(n==6) call attack if(n==5) call attack step } else step yy=yy-1 if(yy>0) continue if(xx==0) break if(xx>0) { right yy=xx xx=0 } else { left yy=-xx xx=0 } } } else { act front if(N==@t_robot) call attack else { if(N==@t_box||D>1) step else { if(R>500) right else left } } } } attack() { left;left act back act back act back act back act back left;left }