Skip to content

Instantly share code, notes, and snippets.

@afelicioni
Created November 17, 2015 19:06
Show Gist options
  • Save afelicioni/ae2f084880589fbb4b61 to your computer and use it in GitHub Desktop.
Save afelicioni/ae2f084880589fbb4b61 to your computer and use it in GitHub Desktop.
Broken Blocky over final level at UC3Mx: IT.1.1x Introduction to Programming with Java - Part 1: Starting to Code with Java
while (notDone()) {
if (isPathLeft()) {
turnLeft();
if (isPathForward()) {
moveForward();
} else {
turnLeft();
turnLeft();
}
} else {
turnRight();
}
}
@afelicioni
Copy link
Author

with 6 blocks

while (notDone()) {
  if (isPathLeft()) {
    turnLeft();
    if (isPathForward()) {
      moveForward();
    }
  } else {
    turnRight();
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment