Skip to content

Instantly share code, notes, and snippets.

@hyspace
Created August 25, 2014 07:24
Show Gist options
  • Select an option

  • Save hyspace/85f4ed0b331f31f13b83 to your computer and use it in GitHub Desktop.

Select an option

Save hyspace/85f4ed0b331f31f13b83 to your computer and use it in GitHub Desktop.
untrusted lv12
var directions = ['up', 'right', 'down', 'left']
if(me.__direction == undefined){
me.__direction = 1
}
y = me.getY()
if(y>=9){
me.move('down')
return
}
desired = directions[(me.__direction + 1) % 4]
face = directions[me.__direction % 4]
if(me.canMove(desired)){
me.move(desired)
me.__direction++
}else if(me.canMove(face)) {
me.move(face)
}else{
me.__direction += 3
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment