chore(i18n,learn): processed translations (#45197)

This commit is contained in:
camperbot
2022-02-20 21:06:06 +05:30
committed by GitHub
parent d17f136693
commit 614e1a88d4
8 changed files with 147 additions and 137 deletions

View File

@ -7,17 +7,17 @@ isPrivate: true
tests:
-
id: 587d8249367417b2b2512c41
title: Convertidor Métrico-Imperial
title: Convertidor de métricas imperiales
-
id: 587d8249367417b2b2512c42
title: Rastreador de Problemas
title: Seguidor de incidentes
-
id: 587d824a367417b2b2512c43
title: Librería Personal
title: Biblioteca personal
-
id: 5e601bf95ac9d0ecd8b94afd
title: Resolvedor de Sudoku
title: Solucionador de Sudoku
-
id: 5e601c0d5ac9d0ecd8b94afe
title: Traductor de Inglés Americano - Británico
title: Traductor británico americano

View File

@ -186,6 +186,12 @@ assert(telephoneCheck('(555)5(55?)-5555') === false);
assert(telephoneCheck('55 55-55-555-5') === false);
```
`telephoneCheck("11 555-555-5555")` debe devolver `false`.
```js
assert(telephoneCheck('11 555-555-5555') === false);
```
# --seed--
## --seed-contents--

View File

@ -12,9 +12,9 @@ Construye una aplicación full stack de JavaScript que sea funcionalmente simila
- Clona [este repositorio de GitHub](https://github.com/freeCodeCamp/boilerplate-project-american-british-english-translator/) y completa tu proyecto localmente.
- Usa [nuestro proyecto inicial de Replit](https://replit.com/github/freeCodeCamp/boilerplate-project-american-british-english-translator) para completar tu proyecto.
- Usa un constructor de sitios de tu elección para completar el proyecto. Asegúrate de incorporar todos los archivos de nuestro repositorio GitHub.
- Usa un constructor de sitios de tu elección para completar el proyecto. Asegúrate de incorporar todos los archivos de nuestro repositorio de GitHub.
Cuando hayas terminado, asegúrate de que un demo funcional de tu proyecto esté alojado en algún lugar público. Luego, ingresa la URL en el campo `Solution Link`. Opcionalmente, también ingresa un enlace al código fuente de tu proyecto en el campo `GitHub Link`.
Cuando hayas terminado, asegúrate de que una demostración funcional de tu proyecto esté alojado en algún lugar público. Luego, envía la URL en el campo `Solution Link`. Opcionalmente, también envía un enlace al código fuente de tu proyecto en el campo `GitHub Link`.
# --instructions--

View File

@ -11,10 +11,10 @@ dashedName: issue-tracker
Construye una aplicación full stack de JavaScript que sea funcionalmente similar a esta: <https://issue-tracker.freecodecamp.rocks/>. Trabajar en este proyecto implicará escribir tu código utilizando uno de los siguientes métodos:
- Clona [este repositorio de GitHub](https://github.com/freeCodeCamp/boilerplate-project-issuetracker/) y completa tu proyecto localmente.
- Usa [este proyecto inicial de Replit](https://replit.com/github/freeCodeCamp/boilerplate-project-issuetracker) para completar tu proyecto.
- Usa un constructor de sitios de tu elección para completar el proyecto. Asegúrate de incorporar todos los archivos de nuestro repositorio GitHub.
- Usa [nuestro proyecto inicial de Replit](https://replit.com/github/freeCodeCamp/boilerplate-project-issuetracker) para completar tu proyecto.
- Usa un constructor de sitios de tu elección para completar el proyecto. Asegúrate de incorporar todos los archivos de nuestro repositorio de GitHub.
Cuando hayas terminado, asegúrate de que una demostración de trabajo de tu proyecto esté alojado en algún lugar público. Luego, envía la URL en el campo `Solution Link`. Opcionalmente, también envía un enlace al código fuente de tu proyecto en el campo `GitHub Link`.
Cuando hayas terminado, asegúrate de que una demostración funcional de tu proyecto esté alojado en algún lugar público. Luego, envía la URL en el campo `Solution Link`. Opcionalmente, también envía un enlace al código fuente de tu proyecto en el campo `GitHub Link`.
# --instructions--

View File

@ -1,6 +1,6 @@
---
id: 587d8249367417b2b2512c41
title: Metric-Imperial Converter
title: Convertidor de métricas imperiales
challengeType: 4
forumTopicId: 301570
dashedName: metric-imperial-converter
@ -8,52 +8,52 @@ dashedName: metric-imperial-converter
# --description--
Build a full stack JavaScript app that is functionally similar to this: <https://metric-imperial-converter.freecodecamp.rocks/>. Working on this project will involve you writing your code using one of the following methods:
Construye una aplicación full stack de JavaScript que sea funcionalmente similar a esta: <https://metric-imperial-converter.freecodecamp.rocks/>. Trabajar en este proyecto implicará escribir tu código utilizando uno de los siguientes métodos:
- Clone [this GitHub repo](https://github.com/freeCodeCamp/boilerplate-project-metricimpconverter/) and complete your project locally.
- Use [our Replit starter project](https://replit.com/github/freeCodeCamp/boilerplate-project-metricimpconverter) to complete your project.
- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo.
- Clona [este repositorio de GitHub](https://github.com/freeCodeCamp/boilerplate-project-metricimpconverter/) y completa tu proyecto localmente.
- Usa [nuestro proyecto de inicio en Replit](https://replit.com/github/freeCodeCamp/boilerplate-project-metricimpconverter) para completar tu proyecto.
- Usa un constructor de sitios de tu elección para completar el proyecto. Asegúrate de incorporar todos los archivos de nuestro repositorio de GitHub.
When you are done, make sure a working demo of your project is hosted somewhere public. Then submit the URL to it in the `Solution Link` field. Optionally, also submit a link to your project's source code in the `GitHub Link` field.
Cuando hayas terminado, asegúrate de que una demostración funcional de tu proyecto esté alojado en algún lugar público. Luego, envía la URL en el campo `Solution Link`. Opcionalmente, también envía un enlace al código fuente de tu proyecto en el campo `GitHub Link`.
# --instructions--
- Complete the necessary conversion logic in `/controllers/convertHandler.js`
- Complete the necessary routes in `/routes/api.js`
- Copy the `sample.env` file to `.env` and set the variables appropriately
- To run the tests uncomment `NODE_ENV=test` in your `.env` file
- To run the tests in the console, use the command `npm run test`. To open the Replit console, press Ctrl+Shift+P (Cmd if on a Mac) and type "open shell"
- Completa la lógica de conversión necesaria en `/controllers/convertHandler.js`
- Completa las rutas necesarias en `/routes/api.js`
- Copia el archivo `sample.env` a `.env` y establece las variables apropiadamente
- Para ejecutar las pruebas, descomenta `NODE_ENV=test` en tu archivo `.env`
- Para ejecutar las pruebas en la consola, usa el comando `npm run test`. Para abrir la consola de Replit presiona Ctrl+Shift+P (Cmd si estas en Mac) y escribe "open shell"
Write the following tests in `tests/1_unit-tests.js`:
Escribe las siguientes pruebas en `tests/1_unit-tests.js`:
- `convertHandler` should correctly read a whole number input.
- `convertHandler` should correctly read a decimal number input.
- `convertHandler` should correctly read a fractional input.
- `convertHandler` should correctly read a fractional input with a decimal.
- `convertHandler` should correctly return an error on a double-fraction (i.e. `3/2/3`).
- `convertHandler` should correctly default to a numerical input of `1` when no numerical input is provided.
- `convertHandler` should correctly read each valid input unit.
- `convertHandler` should correctly return an error for an invalid input unit.
- `convertHandler` should return the correct return unit for each valid input unit.
- `convertHandler` should correctly return the spelled-out string unit for each valid input unit.
- `convertHandler` should correctly convert `gal` to `L`.
- `convertHandler` should correctly convert `L` to `gal`.
- `convertHandler` should correctly convert `mi` to `km`.
- `convertHandler` should correctly convert `km` to `mi`.
- `convertHandler` should correctly convert `lbs` to `kg`.
- `convertHandler` should correctly convert `kg` to `lbs`.
- `convertHandler` debe leer correctamente una entrada de número entero.
- `convertHandler` debe leer correctamente una entrada de número decimal.
- `convertHandler` debe leer correctamente una entrada fraccional.
- `convertHandler` debe leer correctamente una entrada fraccional con un decimal.
- `convertHandler` debe devolver correctamente un error en una fracción doble (i.e. `3/2/3`).
- `convertHandler` debe predeterminar correctamente una entrada numérica de `1` cuando no se proporciona ninguna entrada numérica.
- `convertHandler` debe leer correctamente cada unidad de las entradas válidas.
- `convertHandler` debe devolver correctamente un error por cada unidad de entrada no válida.
- `convertHandler` debe devolver la unidad de retorno correcta para cada unidad de entrada válida.
- `convertHandler` debe devolver correctamente la unidad de cadena deletreada para cada unidad de entrada válida.
- `convertHandler` debe convertir correctamente `gal` a `L`.
- `convertHandler` debe convertir correctamente `L` to `gal`.
- `convertHandler` debe convertir correctamente `mi` a `km`.
- `convertHandler` debe convertir correctamente `km` a `mi`.
- `convertHandler` debe convertir correctamente `lbs` a `kg`.
- `convertHandler` debe convertir correctamente `kg` a `lbs`.
Write the following tests in `tests/2_functional-tests.js`:
Escribe las siguientes pruebas en `tests/2_functional-tests.js`:
- Convert a valid input such as `10L`: `GET` request to `/api/convert`.
- Convert an invalid input such as `32g`: `GET` request to `/api/convert`.
- Convert an invalid number such as `3/7.2/4kg`: `GET` request to `/api/convert`.
- Convert an invalid number AND unit such as `3/7.2/4kilomegagram`: `GET` request to `/api/convert`.
- Convert with no number such as `kg`: `GET` request to `/api/convert`.
- Convierte una entrada válida como `10L`: petición `GET` a `/api/convert`.
- Convierte una entrada inválida como `32g`: petición `GET` a `/api/convert`.
- Convierte un número inválido como `3/7.2/4kg`: petición `GET` a `/api/convert`.
- Convierte un número Y una unidad no válidos como `3/7.2/4kilomegagram`: petición `GET` a `/api/convert`.
- Convierte sin número tal como `kg`: petición `GET` a `/api/convert`.
# --hints--
You can provide your own project, not the example URL.
Debes proporcionar tu propio proyecto, no la URL de ejemplo.
```js
getUserInput => {
@ -65,13 +65,13 @@ getUserInput => {
};
```
You can `GET` `/api/convert` with a single parameter containing an accepted number and unit and have it converted. (Hint: Split the input by looking for the index of the first character which will mark the start of the unit)
Puedes realizar una petición `GET` `/api/convert` con un único parámetro que contenga un número y una unidad aceptados y que lo convierta. (Pista: Divide la entrada buscando el índice del primer carácter que marcará el inicio de la unidad)
```js
```
You can convert `'gal'` to `'L'` and vice versa. (1 gal to 3.78541 L)
Puedes convertir `'gal'` a `'L'` y viceversa. (1 gal a 3.78541 L)
```js
async getUserInput => {
@ -94,7 +94,7 @@ async getUserInput => {
};
```
You can convert `'lbs'` to `'kg'` and vice versa. (1 lbs to 0.453592 kg)
Puedes convertir `'lbs'` a `'kg'` y viceversa. (1 lbs a 0.453592 kg)
```js
async getUserInput => {
@ -117,7 +117,7 @@ async getUserInput => {
};
```
You can convert `'mi'` to `'km'` and vice versa. (1 mi to 1.60934 km)
Puedes convertir `'mi'` a `'km'` y viceversa. (1 mi a 1.60934 km)
```js
async getUserInput => {
@ -140,7 +140,7 @@ async getUserInput => {
};
```
All incoming units should be accepted in both upper and lower case, but should be returned in both the `initUnit` and `returnUnit` in lower case, except for liter, which should be represented as an uppercase `'L'`.
Todas las unidades entrantes deben ser aceptadas en mayúsculas y minúsculas, pero debe ser devuelto en `initUnit` y `returnUnit` en minúsculas excepto por litro, que debe ser representado como una `'L'` mayúscula.
```js
async getUserInput => {
@ -163,7 +163,7 @@ async getUserInput => {
};
```
If the unit of measurement is invalid, returned will be `'invalid unit'`.
Si la unidad de medida no es válida, se devolverá `'invalid unit'`.
```js
async getUserInput => {
@ -176,7 +176,7 @@ async getUserInput => {
};
```
If the number is invalid, returned will be `'invalid number'`.
Si el número no es válido, devolverá `'invalid number'`.
```js
async getUserInput => {
@ -191,7 +191,7 @@ async getUserInput => {
};
```
If both the unit and number are invalid, returned will be `'invalid number and unit'`.
Si tanto la unidad como el número son inválidos, la devolución será `'invalid number and unit'`.
```js
async getUserInput => {
@ -209,7 +209,7 @@ async getUserInput => {
};
```
You can use fractions, decimals or both in the parameter (ie. 5, 1/2, 2.5/6), but if nothing is provided it will default to 1.
Puedes utilizar fracciones, decimales o ambos en el parámetro (es decir, 5, 1/2, 2.5/6), pero si no se proporciona nada, el valor predeterminado será 1.
```js
async getUserInput => {
@ -240,7 +240,7 @@ async getUserInput => {
};
```
Your return will consist of the `initNum`, `initUnit`, `returnNum`, `returnUnit`, and `string` spelling out units in the format `'{initNum} {initUnitString} converts to {returnNum} {returnUnitString}'` with the result rounded to 5 decimals.
Su devolución consistirá en `initNum`, `initUnit`, `returnNum`, `returnUnit`, y `string` detallando unidades en el formato `'{initNum} {initUnitString} converts to {returnNum} {returnUnitString}'` con el resultado redondeado a 5 decimales.
```js
async getUserInput => {
@ -257,7 +257,7 @@ async getUserInput => {
};
```
All 16 unit tests are complete and passing.
Las 16 pruebas unitarias están completas y pasan.
```js
async getUserInput => {
@ -282,7 +282,7 @@ async getUserInput => {
};
```
All 5 functional tests are complete and passing.
Las 5 pruebas funcionales están completas y pasan.
```js
async getUserInput => {

View File

@ -1,6 +1,6 @@
---
id: 587d824a367417b2b2512c43
title: Personal Library
title: Biblioteca personal
challengeType: 4
forumTopicId: 301571
dashedName: personal-library
@ -8,24 +8,24 @@ dashedName: personal-library
# --description--
Build a full stack JavaScript app that is functionally similar to this: <https://personal-library.freecodecamp.rocks/>. Working on this project will involve you writing your code using one of the following methods:
Construye una aplicación full stack de JavaScript que sea funcionalmente similar a esta: <https://personal-library.freecodecamp.rocks/>. Trabajar en este proyecto implicará escribir tu código utilizando uno de los siguientes métodos:
- Clone [this GitHub repo](https://github.com/freeCodeCamp/boilerplate-project-library) and complete your project locally.
- Use [our Replit starter project](https://replit.com/github/freeCodeCamp/boilerplate-project-library) to complete your project.
- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo.
- Clona [este repositorio de GitHub](https://github.com/freeCodeCamp/boilerplate-project-library) y completa tu proyecto localmente.
- Usa [nuestro proyecto inicial de Replit](https://replit.com/github/freeCodeCamp/boilerplate-project-library) para completar tu proyecto.
- Usa un constructor de sitios de tu elección para completar el proyecto. Asegúrate de incorporar todos los archivos de nuestro repositorio de GitHub.
When you are done, make sure a working demo of your project is hosted somewhere public. Then submit the URL to it in the `Solution Link` field. Optionally, also submit a link to your project's source code in the `GitHub Link` field.
Cuando hayas terminado, asegúrate de que una demostración funcional de tu proyecto esté alojado en algún lugar público. Luego, envía la URL en el campo `Solution Link`. Opcionalmente, también envía un enlace al código fuente de tu proyecto en el campo `GitHub Link`.
# --instructions--
1. Add your MongoDB connection string to `.env` without quotes as `DB` Example: `DB=mongodb://admin:pass@1234.mlab.com:1234/fccpersonallib`
2. In your `.env` file set `NODE_ENV` to `test`, without quotes
3. You need to create all routes within `routes/api.js`
4. You will create all functional tests in `tests/2_functional-tests.js`
1. Agrega tu cadena de conexión MongoDB a tu `.env` sin comillas como `DB` Ejemplo: `DB=mongodb://admin:pass@1234.mlab.com:1234/fccpersonallib`
2. En tu archivo `.env` establece `NODE_ENV` a `test`, sin comillas
3. Es necesario crear todas la rutas dentro de `routes/api.js`
4. Escribe las siguientes pruebas en `tests/2_functional-tests.js`
# --hints--
You can provide your own project, not the example URL.
Debes proporcionar tu propio proyecto, no la URL de ejemplo.
```js
(getUserInput) => {
@ -35,7 +35,7 @@ You can provide your own project, not the example URL.
};
```
You can send a <b>POST</b> request to `/api/books` with `title` as part of the form data to add a book. The returned response will be an object with the `title` and a unique `_id` as keys. If `title` is not included in the request, the returned response should be the string `missing required field title`.
Puedes enviar una petición <b>POST</b> a `/api/books` con `title` como parte de los datos del formulario para agregar un libro. La respuesta devuelta será un objeto con las propiedades `title` y un `_id` único como claves. Si `title` no está incluido en la petición, la respuesta devuelta será una cadena con `missing required field title`.
```js
async (getUserInput) => {
@ -56,7 +56,7 @@ async (getUserInput) => {
};
```
You can send a <b>GET</b> request to `/api/books` and receive a JSON response representing all the books. The JSON response will be an array of objects with each object (book) containing `title`, `_id`, and `commentcount` properties.
Puedes enviar una petición <b>GET</b> a `/api/books` y recibir una respuesta JSON que representa todos los libros. La respuesta JSON será un arreglo de objetos, cada objeto (libro) contienen las propiedades de `title`, `_id`, y `commentcount`.
```js
async (getUserInput) => {
@ -84,7 +84,7 @@ async (getUserInput) => {
};
```
You can send a <b>GET</b> request to `/api/books/{_id}` to retrieve a single object of a book containing the properties `title`, `_id`, and a `comments` array (empty array if no comments present). If no book is found, return the string `no book exists`.
Puedes enviar una petición <b>GET</b> a `/api/books/{_id}` para recuperar un solo objeto de un libro que contiene las propiedades `title`, `_id`, y un arreglo `comments` (arreglo vacío si no hay comentarios). Si no se encuentra ningún libro, devuelve la cadena `no book exists`.
```js
async (getUserInput) => {
@ -108,7 +108,7 @@ async (getUserInput) => {
};
```
You can send a <b>POST</b> request containing `comment` as the form body data to `/api/books/{_id}` to add a comment to a book. The returned response will be the books object similar to <b>GET</b> `/api/books/{_id}` request in an earlier test. If `comment` is not included in the request, return the string `missing required field comment`. If no book is found, return the string `no book exists`.
Puedes enviar una petición de <b>POST</b> que contenga un `comment` como los datos del cuerpo del formulario a `/api/books/{_id}` para agregar un comentario a un libro. La respuesta devuelta será el objeto de libros similar a la petición <b>GET</b> `/api/books/{_id}` en una prueba anterior. Si `comment` no está incluido en la petición, la respuesta devuelta será una cadena con `missing required field comment`. Si no se encuentra ningún libro, devuelve la cadena `no book exists`.
```js
async (getUserInput) => {
@ -146,7 +146,7 @@ async (getUserInput) => {
};
```
You can send a <b>DELETE</b> request to `/api/books/{_id}` to delete a book from the collection. The returned response will be the string `delete successful` if successful. If no book is found, return the string `no book exists`.
Puedes enviar una petición de <b>DELETE</b> a `/api/books/{_id}` para eliminar un libro de la colección. La respuesta devuelta será la cadena `delete successful` si tiene éxito. Si no se encuentra ningún libro, devuelve la cadena `no book exists`.
```js
async (getUserInput) => {
@ -170,7 +170,7 @@ async (getUserInput) => {
};
```
You can send a <b>DELETE</b> request to `/api/books` to delete all books in the database. The returned response will be the string `'complete delete successful` if successful.
Puedes enviar una petición de <b>DELETE</b> a `/api/books` para eliminar todos los libros de la base de datos. La respuesta devuelta será la cadena `'complete delete successful` si tiene éxito.
```js
async (getUserInput) => {
@ -187,7 +187,7 @@ async (getUserInput) => {
};
```
All 10 functional tests required are complete and passing.
Las 10 pruebas funcionales requeridas están completas y aprobadas.
```js
async (getUserInput) => {

View File

@ -1,6 +1,6 @@
---
id: 5e601bf95ac9d0ecd8b94afd
title: Sudoku Solver
title: Solucionador de Sudoku
challengeType: 4
forumTopicId: 462357
dashedName: sudoku-solver
@ -8,60 +8,60 @@ dashedName: sudoku-solver
# --description--
Build a full stack JavaScript app that is functionally similar to this: <https://sudoku-solver.freecodecamp.rocks/>. Working on this project will involve you writing your code using one of the following methods:
Construye una aplicación full stack de JavaScript que sea funcionalmente similar a esta: <https://sudoku-solver.freecodecamp.rocks/>. Trabajar en este proyecto implicará escribir tu código utilizando uno de los siguientes métodos:
- Clone [this GitHub repo](https://github.com/freecodecamp/boilerplate-project-sudoku-solver) and complete your project locally.
- Use [our Replit starter project](https://replit.com/github/freeCodeCamp/boilerplate-project-sudoku-solver) to complete your project.
- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo.
- Clona [este repositorio de GitHub](https://github.com/freecodecamp/boilerplate-project-sudoku-solver) y completa tu proyecto localmente.
- Usa [nuestro proyecto inicial de Replit](https://replit.com/github/freeCodeCamp/boilerplate-project-sudoku-solver) para completar tu proyecto.
- Usa un constructor de sitios de tu elección para completar el proyecto. Asegúrate de incorporar todos los archivos de nuestro repositorio de GitHub.
When you are done, make sure a working demo of your project is hosted somewhere public. Then submit the URL to it in the `Solution Link` field. Optionally, also submit a link to your project's source code in the `GitHub Link` field.
Cuando hayas terminado, asegúrate de que una demostración funcional de tu proyecto esté alojado en algún lugar público. Luego, envía la URL en el campo `Solution Link`. Opcionalmente, también envía un enlace al código fuente de tu proyecto en el campo `GitHub Link`.
# --instructions--
- All puzzle logic can go into `/controllers/sudoku-solver.js`
- The `validate` function should take a given puzzle string and check it to see if it has 81 valid characters for the input.
- The `check` functions should be validating against the *current* state of the board.
- The `solve` function should handle solving any given valid puzzle string, not just the test inputs and solutions. You are expected to write out the logic to solve this.
- All routing logic can go into `/routes/api.js`
- See the `puzzle-strings.js` file in `/controllers` for some sample puzzles your application should solve
- To run the challenge tests on this page, set `NODE_ENV` to `test` without quotes in the `.env` file
- To run the tests in the console, use the command `npm run test`. To open the Replit console, press Ctrl+Shift+P (Cmd if on a Mac) and type "open shell"
- Toda la lógica del rompecabezas puede ir dentro de `/controllers/sudoku-solver.js`
- La función `validate` debe tomar una cadena de rompecabezas dada y revisarla para ver si tiene 81 caracteres válidos para la entrada.
- La función `check` debe estar validando contra el estado *actual* del tablero.
- La función `solve` debe manejar la resolución de cualquier cadena de rompecabezas válida, no solo las entradas de prueba y soluciones. Se espera que escribas la lógica para resolver esto.
- Toda la lógica de enrutamiento puede ir a `/routes/api.js`
- Ve el archivo `puzzle-strings.js` en `/controllers` para algunos rompecabezas de ejemplo que tu aplicación debe resolver
- Para ejecutar las pruebas de desafío en esta página, establece `NODE_ENV` a `test` sin comillas en el archivo `.env`
- Para ejecutar las pruebas en la consola, usa el comando `npm run test`. Para abrir la consola de Replit presiona Ctrl+Shift+P (Cmd si estas en Mac) y escribe "open shell"
Write the following tests in `tests/1_unit-tests.js`:
Escribe las siguientes pruebas en `tests/1_unit-tests.js`:
- Logic handles a valid puzzle string of 81 characters
- Logic handles a puzzle string with invalid characters (not 1-9 or `.`)
- Logic handles a puzzle string that is not 81 characters in length
- Logic handles a valid row placement
- Logic handles an invalid row placement
- Logic handles a valid column placement
- Logic handles an invalid column placement
- Logic handles a valid region (3x3 grid) placement
- Logic handles an invalid region (3x3 grid) placement
- Valid puzzle strings pass the solver
- Invalid puzzle strings fail the solver
- Solver returns the expected solution for an incomplete puzzle
- La lógica maneja una cadena de rompecabezas válida de 81 caracteres
- La lógica maneja una cadena de rompecabezas con caracteres inválidos (no 1-9 o `.`)
- La lógica maneja una cadena de rompecabezas que no tiene 81 caracteres de longitud
- La lógica maneja una posición de fila válida
- La lógica maneja una posición de fila inválida
- La lógica maneja una posición de columna válida
- La lógica maneja una posición de columna inválida
- La lógica maneja la ubicación de una región válida (cuadrícula 3x3)
- La lógica maneja la ubicación de una región inválida (cuadrícula 3x3)
- Las cadenas de rompecabezas válidas pasan el solucionador
- Las cadenas de rompecabezas no válidas hacen fallar al solucionador
- El solucionador devuelve la solución esperada para un rompecabezas incompleto
Write the following tests in `tests/2_functional-tests.js`
Escribe las siguientes pruebas en `tests/2_functional-tests.js`
- Solve a puzzle with valid puzzle string: POST request to `/api/solve`
- Solve a puzzle with missing puzzle string: POST request to `/api/solve`
- Solve a puzzle with invalid characters: POST request to `/api/solve`
- Solve a puzzle with incorrect length: POST request to `/api/solve`
- Solve a puzzle that cannot be solved: POST request to `/api/solve`
- Check a puzzle placement with all fields: POST request to `/api/check`
- Check a puzzle placement with single placement conflict: POST request to `/api/check`
- Check a puzzle placement with multiple placement conflicts: POST request to `/api/check`
- Check a puzzle placement with all placement conflicts: POST request to `/api/check`
- Check a puzzle placement with missing required fields: POST request to `/api/check`
- Check a puzzle placement with invalid characters: POST request to `/api/check`
- Check a puzzle placement with incorrect length: POST request to `/api/check`
- Check a puzzle placement with invalid placement coordinate: POST request to `/api/check`
- Check a puzzle placement with invalid placement value: POST request to `/api/check`
- Resuelve un rompecabezas con una cadena de rompecabezas válida: petición POST a `/api/solve`
- Resuelve un rompecabezas con una cadena de rompecabezas faltante: petición POST a `/api/solve`
- Resuelve un rompecabezas con caracteres inválidos: petición POST a `/api/solve`
- Resuelve un rompecabezas con una longitud incorrecta: petición POST a `/api/solve`
- Resuelve un rompecabezas que no se puede resolver: petición POST a `/api/solve`
- Comprueba la ubicación de un rompecabezas con todos los campos: petición POST a `/api/check`
- Comprueba la ubicación de un rompecabezas con un conflicto de posición: petición POST a `/api/check`
- Comprueba la ubicación de un rompecabezas con múltiples conflictos de posición: petición POST a `/api/check`
- Comprueba la ubicación de un rompecabezas con todos los conflictos de posición: petición POST a `/api/check`
- Comprueba la ubicación de un rompecabezas con los campos requeridos faltantes: petición POST a `/api/check`
- Comprueba la ubicación de un rompecabezas con caracteres inválidos: petición POST a `/api/check`
- Comprueba la ubicación de un rompecabezas con una longitud incorrecta: petición POST a `/api/check`
- Comprueba la ubicación de un rompecabezas con coordenadas de posición no válidas: petición POST a `/api/check`
- Comprueba la ubicación de un rompecabezas con valor de posición no válido: petición POST a `/api/check`
# --hints--
You should provide your own project, not the example URL.
Debes proporcionar tu propio proyecto, no la URL del ejemplo.
```js
(getUserInput) => {
@ -70,7 +70,7 @@ You should provide your own project, not the example URL.
};
```
You can `POST` `/api/solve` with form data containing `puzzle` which will be a string containing a combination of numbers (1-9) and periods `.` to represent empty spaces. The returned object will contain a `solution` property with the solved puzzle.
Puedes realizar una petición `POST` `/api/solve` con datos del formulario que contienen `puzzle` que será una cadena que contiene una combinación de números (1-9) y puntos `.` para representar espacios vacíos. El objeto devuelto contendrá una propiedad de `solution` con el rompecabezas resuelto.
```js
async (getUserInput) => {
@ -89,7 +89,7 @@ async (getUserInput) => {
};
```
If the object submitted to `/api/solve` is missing `puzzle`, the returned value will be `{ error: 'Required field missing' }`
Si el objeto enviado a `/api/solve` no existe `puzzle`, el valor devuelto será `{ error: 'Required field missing' }`
```js
async (getUserInput) => {
@ -107,7 +107,7 @@ async (getUserInput) => {
};
```
If the puzzle submitted to `/api/solve` contains values which are not numbers or periods, the returned value will be `{ error: 'Invalid characters in puzzle' }`
Si el rompecabezas enviado a `/api/solve` contiene valores que no son números o periodos, el valor devuelto será `{ error: 'Invalid characters in puzzle' }`
```js
async (getUserInput) => {
@ -125,7 +125,7 @@ async (getUserInput) => {
};
```
If the puzzle submitted to `/api/solve` is greater or less than 81 characters, the returned value will be `{ error: 'Expected puzzle to be 81 characters long' }`
Si el rompecabezas enviado a `/api/solve` es mayor o menor que 81 caracteres, el valor devuelto será `{ error: 'Expected puzzle to be 81 characters long' }`
```js
async (getUserInput) => {
@ -143,7 +143,7 @@ async (getUserInput) => {
};
```
If the puzzle submitted to `/api/solve` is invalid or cannot be solved, the returned value will be `{ error: 'Puzzle cannot be solved' }`
Si el rompecabezas enviado a `/api/solve` no es válido o no se puede resolver, el valor devuelto será `{ error: 'Puzzle cannot be solved' }`
```js
async (getUserInput) => {
@ -161,7 +161,7 @@ async (getUserInput) => {
};
```
You can `POST` to `/api/check` an object containing `puzzle`, `coordinate`, and `value` where the `coordinate` is the letter A-I indicating the row, followed by a number 1-9 indicating the column, and `value` is a number from 1-9.
Puedes realizar una petición `POST` a `/api/check` un objeto que contenga `puzzle`, `coordinate`, y `value` donde `coordinate` es la letra del A-I que indica la fila, seguido por un número del 1-9 indicando la columna, y `value` es un numero del 1-9.
```js
async (getUserInput) => {
@ -180,7 +180,7 @@ async (getUserInput) => {
};
```
The return value from the `POST` to `/api/check` will be an object containing a `valid` property, which is `true` if the number may be placed at the provided coordinate and `false` if the number may not. If false, the returned object will also contain a `conflict` property which is an array containing the strings `"row"`, `"column"`, and/or `"region"` depending on which makes the placement invalid.
El valor devuelto del `POST` a `/api/check` será un objeto que contenga una propiedad `valid`, que es `true` si el número puede colocarse en la coordenada proporcionada y `false` si el número no lo es. Si es falso, el objeto devuelto también contendrá una propiedad `conflict` que contiene las cadenas `"row"`, `"column"`, y/o `"region"` dependiendo de que la ubicación sea inválida.
```js
async (getUserInput) => {
@ -203,7 +203,7 @@ async (getUserInput) => {
};
```
If `value` submitted to `/api/check` is already placed in `puzzle` on that `coordinate`, the returned value will be an object containing a `valid` property with `true` if `value` is not conflicting.
Si `value` enviado a `/api/check` ya está situado en `puzzle` en esa `coordinate`, el valor devuelto será un objeto que contiene una propiedad `valid` con `true` si `value` no está en conflicto.
```js
async (getUserInput) => {
@ -222,7 +222,7 @@ async (getUserInput) => {
};
```
If the puzzle submitted to `/api/check` contains values which are not numbers or periods, the returned value will be `{ error: 'Invalid characters in puzzle' }`
Si el rompecabezas enviado a `/api/check` contiene valores que no son números o puntos, el valor devuelto será `{ error: 'Invalid characters in puzzle' }`
```js
async (getUserInput) => {
@ -242,7 +242,7 @@ async (getUserInput) => {
};
```
If the puzzle submitted to `/api/check` is greater or less than 81 characters, the returned value will be `{ error: 'Expected puzzle to be 81 characters long' }`
Si el rompecabezas enviado a `/api/check` es mayor o menor que 81 caracteres, el valor devuelto será `{ error: 'Expected puzzle to be 81 characters long' }`
```js
async (getUserInput) => {
@ -262,7 +262,7 @@ async (getUserInput) => {
};
```
If the object submitted to `/api/check` is missing `puzzle`, `coordinate` or `value`, the returned value will be `{ error: Required field(s) missing }`
Si el objeto enviado a `/api/check` no existe `puzzle`,`coordinate` o `value`, el valor devuelto será `{ error: Required field(s) missing }`
```js
async (getUserInput) => {
@ -280,7 +280,7 @@ async (getUserInput) => {
};
```
If the coordinate submitted to `api/check` does not point to an existing grid cell, the returned value will be `{ error: 'Invalid coordinate'}`
Si la coordenada enviada a `api/check` no apunta a una celda de la cuadrícula existente, el valor devuelto será `{ error: 'Invalid coordinate'}`
```js
async (getUserInput) => {
@ -300,7 +300,7 @@ async (getUserInput) => {
};
```
If the `value` submitted to `/api/check` is not a number between 1 and 9, the returned values will be `{ error: 'Invalid value' }`
Si el `value` enviado a `/api/check` no es un número entre 1 y 9, los valores devueltos serán `{ error: 'Invalid value' }`
```js
async (getUserInput) => {
@ -320,7 +320,7 @@ async (getUserInput) => {
};
```
All 12 unit tests are complete and passing. See `/tests/1_unit-tests.js` for the expected behavior you should write tests for.
Las 12 pruebas unitarias están completas y pasan. Consulta `/tests/1_unit-tests.js` para el comportamiento esperado para el que debes escribir pruebas.
```js
async (getUserInput) => {
@ -343,7 +343,7 @@ async (getUserInput) => {
};
```
All 14 functional tests are complete and passing. See `/tests/2_functional-tests.js` for the functionality you should write tests for.
Las 14 pruebas funcionales están completas y pasan. Consulta `/tests/2_functional-tests.js` para la funcionalidad para la que debes escribir pruebas.
```js
async (getUserInput) => {

View File

@ -1,22 +1,26 @@
---
id: 5e7b9f060b6c005b0e76f05b
title: Build your own Functions
title: Construye tus propias funciones
challengeType: 11
videoId: nLDychdBwUg
bilibiliIds:
aid: 249487483
bvid: BV1Fv411J7bS
cid: 376340281
dashedName: build-your-own-functions
---
# --description--
More resources:
Más recursos:
\- [Exercise](https://www.youtube.com/watch?v=ksvGhDsjtpw)
\- [Ejercicio](https://www.youtube.com/watch?v=ksvGhDsjtpw)
# --question--
## --text--
What will the following Python program print out?:
¿Qué imprimirá el siguiente programa de Python?:
```python
def fred():