Skip to content

Instantly share code, notes, and snippets.

@sixthgear
Last active December 10, 2015 20:48
Show Gist options
  • Select an option

  • Save sixthgear/4490674 to your computer and use it in GitHub Desktop.

Select an option

Save sixthgear/4490674 to your computer and use it in GitHub Desktop.
STORE counter << 397
STORE direction << @NORTH
@LOOPSTART
CALL << @CHECKS
iftgoto << @LOOPSTART
FFI << @MOVE direction
POP
MINUS << counter 1
STORE counter
iftgoto << counter @LOOPSTART
EQUAL << direction @NORTH
iftgoto << @SETEAST
@SETNORTH
STORE counter << 397
STORE direction << @NORTH
goto << @LOOPSTART
@SETEAST
STORE counter << 3
STORE direction << @EAST
goto << @LOOPSTART
@CHECKS
CALLFF << @LOOK @EAST 2
iftgoto << @PULLEAST
CALLFF << @LOOK @WEST 2
iftgoto << @PULLWEST
CALLFF << @LOOK @NORTH 2
iftgoto << @PULLNORTH
CALLFF << @LOOK @SOUTH 2
iftgoto << @PULLSOUTH
RETURN << 0
@PULLEAST
CALLFF << @PULL @EAST 2
POP
RETURN << 1
@PULLWEST
CALLFF << @PULL @WEST 2
POP
RETURN << 1
@PULLNORTH
CALLFF << @PULL @NORTH 2
POP
RETURN << 1
@PULLSOUTH
CALLFF << @PULL @SOUTH 2
POP
RETURN << 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment