Documentos de Académico
Documentos de Profesional
Documentos de Cultura
moveForward();
turnRight(); //Solo se voltea a la derecha
turnLeft();//solo se voltea a la izquierda
for (var count = 0; count < 5;count++) { //para repetir algun tipo de funcion,
colocando el patron en loas llaves
moveForward();
}
for(var count = 0; count2 <4;count2++) { //cuando usas repetir 2 veces, tienes que
enumerar el "count"
moveForward();
}
//para llegar repetir un paso, hasta llegar a una notificación, éste será el código
while (notiFinished()) {
moveForwad
}
while (notFinished()) {
moveForward();
moveForward();
turnLeft();
}
//Con condiconales
while (notFinished()) {
moveForward();
if (isPathLeft()) {
turnLeft();
}
}
while (notFinished()) {
moveForward
if (isPathRight()){
moveForward;
}
}
//Condicional con orden
while (notFinished()) {
if (isPathForward()) {
moveForward();
} else {
turnLeft();
}
}
While (notFinished()); {
if (isPathForward()){
moveForward();
} else {
if (isPathRight()){
turnRight();
} else {
turnleft();
}
}
}
//programar con pixeles, además coloreando con un aleatorio cada vez y "repitiendo
pasos"
//
//
for (var count = 0; count < 3; count++) {
moveForward(100);
turnRight(120);
}
turnLeft(90);
for (var count2 = 0; count2 < 4; count2++) {
moveForward(100);
turnLeft(90);
}
//
turnRight(90);
penColour('228b22');
for (var count = 0; count < 4; count++) {
moveForward(100);
turnRight(90);
}
turnRight(180);
moveForward(150);
for (var count2 = 0M count2 < 3; count2++) {
turnLeft(90);
moveForward(100);
}