Please enable JavaScript to use CodeHS

Introducción a la programación con Karel el Perro (Ace)

Description

En esta lección, los alumnos aprenden sobre la sentencia condicional “si”. El código dentro de una “sentencia if” sólo se ejecutará SI la condición es verdadera.

if (frontIsClear()) {
    // Código a ejecutar sólo si el frente está despejado
}
Objective

Students will be able to:

  • Use conditions to gather information about Karel’s world (is the front clear, is Karel facing north, etc)
  • Create if statements that only execute code if a certain condition is true
Description

En esta lección, los alumnos aprenden una estructura de control adicional, las sentencias if/else. Las sentencias if/else permiten a los alumnos hacer una cosa si una condición es verdadera, y otra en caso contrario.

Las sentencias if/else se escriben así:

if (frontIsClear()) {
      // código a ejecutar si el frente está despejado
 } else {
      // código a ejecutar en caso contrario
}
Objective

Students will be able to:

  • Explain the purpose of an If/Else statement
  • Create If/Else statements to solve new types of problems
  • Identify when it is appropriate to use an If/Else statement
Description

En esta lección, los alumnos aprenden más sobre las estrategias de depuración y practican el uso de las sentencias if / else.

Objective

Students will be able to:

  • Use debugging strategies to find and fix errors in their code.
  • Identify different types of errors in their code.
  • Explain the meaning of different error messages.
  • Explain the purpose of an If/Else statement
  • Create If/Else statements to solve new types of problems