chore(i18n,learn): processed translations (#45197)
This commit is contained in:
@@ -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) => {
|
||||
|
Reference in New Issue
Block a user