piece(beacon) do
  anchor(0, -1)
  {
    do anchor(-1, 0) while
    friendly(0, 0) jne(0)
    piece-on(pawn, 0, 0) jmp(0)
    piece-on(beacon, 0, 0) jmp(0)
    shift(0, 0) label(0)
    do
      friendly(1, 0) jne(2)
      piece-on(pawn, 1, 0) jmp(2)
      piece-on(beacon, 1, 0) jmp(2)
      shift(1, 0) jmp(1) label(2)
      anchor(1, 0)
      label(1)
    while
  }
while;

piece(beacon) do
  {
    do anchor(-1, 0) while
    friendly(0, 0) jne(0)
    piece-on(pawn, 0, 0) jmp(0)
    piece-on(beacon, 0, 0) jmp(0)
    shift(0, 0) label(0)
    do
      friendly(1, 0) jne(2)
      piece-on(pawn, 1, 0) jmp(2)
      piece-on(beacon, 1, 0) jmp(2)
      shift(1, 0) jmp(1) label(2)
      anchor(1, 0)
      label(1)
    while
  }
  anchor(0, 1)
while;

beacon은 아군 기물이 어디에 있든 자리를 바꿀 수 있어야 하기 때문에 체스판 전체를 탐색해야 합니다.

absolute 식 사용

piece(beacon)
absolute-y(0)
do
	absolute-x(0)
	do
		friendly(0, 0)
		jne(0)
		piece-on(beacon, 0, 0)
		jmp(0)
		piece-on(pawn, 0, 0)
		jmp(0)
		shift(0, 0)
		label(0)
		anchor(1, 0)
	while
	anchor(0, 1)
while;