keskiviikko 10. joulukuuta 2014

Tehtävä 7. Koodaustunti

 Kiva työ :D Kerrankin oikeasti nopea työ, johon ei tarvinnut tehdä oman pään mukaisia muokkauksia.

 Koodit:

13
while (notFinished()) {
  turnRight();
  moveForward();
  turnLeft();
  moveForward();
}

16
while (notFinished()) {
  moveForward();
  if (isPathLeft()) {
    turnLeft();
  }
}

18 
while (notFinished()) {
  if (isPathForward()) {
    moveForward();
  } else {
    turnLeft();
  }
}


20
while (notFinished()) {
  if (isPathForward()) {
    moveForward();
  } else {
    if (isPathRight()) {
      turnRight();
    } else {
      turnLeft();
    }
  }
}


Todistus:

Ei kommentteja:

Lähetä kommentti