GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Loops: while and for by Sjesc · Pull Request #50 · javascript-tutorial/es.javascript.info ConversationLogical operators Update fork Uh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Falta tilde en la U
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ``` | ||
|
|
||
| The first value is `i = 1`, because `++i` first increments `i` and then returns the new value. So the first comparison is `1 < 5` and the `alert` shows `1`. | ||
| El primer valor es `i = 1`, porque primero `++i` incrementa `i` y entonces retorna el valor nuevo. Así que la primera comparación es `1 < 5` y el `alert` muestra `1`. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Me parece que quedaría mejor "El primer valor es i = 1, porque ++i primero incrementa i y luego retorna el nuevo valor."
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| El primer valor es `i = 1`, porque primero `++i` incrementa `i` y entonces retorna el valor nuevo. Así que la primera comparación es `1 < 5` y el `alert` muestra `1`. | ||
|
|
||
| Then follow `2, 3, 4…` -- the values show up one after another. The comparison always uses the incremented value, because `++` is before the variable. | ||
| Entonces siguen `2, 3, 4…` -- los valores son mostrados uno tras de otro. La comparación siempre usa el valor incrementado, porque `++` esta antes de la variable. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Sugiero: "...mostrados uno tras otro. La comparación siempre usa el valor incrementado porque ++ está antes de la variable."
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| Finally, `i = 4` is incremented to `5`, the comparison `while(5 < 5)` fails, and the loop stops. So `5` is not shown. | ||
| 2. **From 1 to 5** | ||
| Finalmente, `i = 4` es incrementada a `5`, la comparación `while(5 < 5)` falla, y el bucle se detiene. Asi que `5` no es mostrado. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Asi -> Así
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ``` | ||
|
|
||
| The first value is again `i = 1`. The postfix form of `i++` increments `i` and then returns the *old* value, so the comparison `i++ < 5` will use `i = 0` (contrary to `++i < 5`). | ||
| El primer valor es de nuevo `i = 1`. La forma del sufijo de `i++` incrementa `i` y entonce retorna el valor *viejo*, asi que la comparación `i++ < 5` usara `i = 0` (contrario a `++i < 5`). |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
asi -> así
entonces -> luego
usara -> usará
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| El primer valor es de nuevo `i = 1`. La forma del sufijo de `i++` incrementa `i` y entonce retorna el valor *viejo*, asi que la comparación `i++ < 5` usara `i = 0` (contrario a `++i < 5`). | ||
|
|
||
| But the `alert` call is separate. It's another statement which executes after the increment and the comparison. So it gets the current `i = 1`. | ||
| Pero la llamada a `alert` esta separda. Es otra declaración la cual se ejecuta luego del increment y la comparación. Asi que obtiene el `i = 1` actual. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
esta->está
increment->incremento
Asi->Así
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| Luego siguen `2, 3, 4…` | ||
|
|
||
| Let's stop on `i = 4`. The prefix form `++i` would increment it and use `5` in the comparison. But here we have the postfix form `i++`. So it increments `i` to `5`, but returns the old value. Hence the comparison is actually `while(4 < 5)` -- true, and the control goes on to `alert`. | ||
| Vamos a parar en `i = 4`. La forma del prefijo `++i` lo incrementaria y usaria `5` en la comparación. Pero aqui tenemos la forma del sufijo `i++`. Asi que incrementa `i` a `5`, pero retorna el valor viejo. Por lo tanto, la comparación es en realidad `while(4 < 5)` -- verdadero, y el control sigue a `alert`. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Me parece que quedaría mejor "Detengámonos en i = 4." o "Paremos en i = 4."
Faltan varios tildes en incrementaría, usaría, aquí, así.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| --- | ||
|
|
||
| # Which values does the while loop show? | ||
| # ¿Qué valores seran mostrados por el bucle while? |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
"serán mostrados" o "muestra"
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| # ¿Qué valores seran mostrados por el bucle while? | ||
|
|
||
| For every loop iteration, write down which value it outputs and then compare it with the solution. | ||
| Para cada iteración del bucle, escribe cual valor sera impreso y entonces comparalo con la solución. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Quedaría mejor "Para cada iteración del bucle, escribe qué valor será mostrado y luego compáralo con la solución."
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| Para cada iteración del bucle, escribe cual valor sera impreso y entonces comparalo con la solución. | ||
|
|
||
| Both loops `alert` the same values, or not? | ||
| ¿Para cada bucle se alertan los mismos valores o no? |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Me parece que quedaría mejor "Ambos bucles ¿alertan los mismos valores?"
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| --- | ||
|
|
||
| # Which values get shown by the "for" loop? | ||
| # ¿Qué valores seran mostrados por el bucle "for"? |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
seran->serán
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| # ¿Qué valores seran mostrados por el bucle "for"? | ||
|
|
||
| For each loop write down which values it is going to show. Then compare with the answer. | ||
| Para cada bucle anota que valores va a mostrar. Entonces compara con la respuesta. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
No hace falta una traducción textual, quedaría mejor:
"Para cada bucle anota qué valores mostrará y luego compara con la respuesta."
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| Para cada bucle anota que valores va a mostrar. Entonces compara con la respuesta. | ||
|
|
||
| Both loops `alert` same values or not? | ||
| ¿Ambos bucles alertan los mismos valores o no? |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Me parece que quedaría mejor "Ambos bucles ¿
alertanlos mismos valores?"
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ``` | ||
|
|
||
| We use the "modulo" operator `%` to get the remainder and check for the evenness here. | ||
| Usamos el operador modulo `%` para conseguir el residuo y que los valores son pares. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Usamos el operador "módulo" % para conseguir el residuo y chequear la paridad.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| --- | ||
|
|
||
| # Output even numbers in the loop | ||
| # Produce números pares en el bucle |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Produce->Muestra
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| # Produce números pares en el bucle | ||
|
|
||
| Use the `for` loop to output even numbers from `2` to `10`. | ||
| Usa el bucle `for` para producir números pares del `2` al `10`. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
"...para mostrar..."
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| # Reemplaza "for" por "while" | ||
|
|
||
| Rewrite the code changing the `for` loop to `while` without altering its behavior (the output should stay same). | ||
| Reescribe el código cambiando el bucle `for` a `while` sin alterar su comportamient (la salida deberia ser la misma). |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
comportamientO
deberia->debería
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ``` | ||
|
|
||
| The loop `do..while` repeats while both checks are truthy: | ||
| El bucle `do..while` se repite mientras ambas comprobaciones sean valores verdaderos: |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Podría quedar mejor "mientras ambas condiciones sean verdaderas:" o no?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| 1. The check for `num <= 100` -- that is, the entered value is still not greater than `100`. | ||
| 2. The check `&& num` is false when `num` is `null` or a empty string. Then the `while` loop stops too. | ||
| 1. La comprobación para `num <= 100` -- eso es, el valor ingresado aún no es mayor que `100`. | ||
| 2. La comprobación `&& num` es falsa cuando `num` es `null` o una cadena de texto vacia. Entonces el bucle `while` se detiene tambien. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
"La condición num <= 100 ..."
"La condición && num ..."
tambien->también
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| 2. La comprobación `&& num` es falsa cuando `num` es `null` o una cadena de texto vacia. Entonces el bucle `while` se detiene tambien. | ||
|
|
||
| P.S. If `num` is `null` then `num <= 100` is `true`, so without the 2nd check the loop wouldn't stop if the user clicks CANCEL. Both checks are required. | ||
| PD. Si `num` es `null` entonces `num <= 100` es `true`, asi que sin la segunda comprabación el bucle no se detendria si el usuario hace click en CANCELAR. Ambas comprobaciones son requreridas. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
asi->así
detendria->detendría
Si arriba cambiaste comprobación por condición, acá deberías también para que haya más consistencia.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| **Escribe el código que muestra números primos en el intervalo de `2` a `n`.** | ||
|
|
||
| For `n = 10` the result will be `2,3,5,7`. | ||
| Para `n = 10` el resultado sera `2, 3, 5, 7`. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
sera->será
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| Para `n = 10` el resultado sera `2, 3, 5, 7`. | ||
|
|
||
| P.S. The code should work for any `n`, not be hard-tuned for any fixed value. | ||
| PD. El código deberia funcionar para cualquier `n`, no debe estar programado para valores fijos. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
deberia ->debería
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| Usualmente necesitamos repetir acciones. | ||
|
|
||
| For example, outputting goods from a list one after another or just running the same code for each number from 1 to 10. | ||
| Por ejemplo, imprimiendo bienes de una lista uno tras otro o simplemente ejecutando el mismo código para cada número del 1 al 10. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
"Por ejemplo, imprimir..." "...o simplemente ejecutar el mismo código por cada número...
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ## El bucle "while" | ||
|
|
||
| The `while` loop has the following syntax: | ||
| El bucle `while` (mientras) tiene el siguiente sintaxis: |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
el->la
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@tscandalitta Listo. Disculpa la cantidad de errores, tratare de mejorar mis siguientes traducciones. Aunque tengo algunas dudas con respecto al articulo en algunas palabras y me dio la impresion de que no terminates de revisarlo. Supongo que cuando tengas tiempo lo haras. Gracias por la correciones. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Please make the requested changes. After it, add a comment "/done". |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thank you 💖 I updated the Progress Issue #17 🎉 🎉 🎉 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.