diff --git a/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/62dabe2ef403a12d5d295273.md b/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/62dabe2ef403a12d5d295273.md index bd69f0a054a..ccab61fe846 100644 --- a/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/62dabe2ef403a12d5d295273.md +++ b/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/62dabe2ef403a12d5d295273.md @@ -75,7 +75,7 @@ assert( --fcc-editable-region--

Click here to view more cat photos.

- cat photos + link to cat pictures --fcc-editable-region-- A cute orange cat lying on its back. diff --git a/curriculum/challenges/chinese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/62dabe2ef403a12d5d295273.md b/curriculum/challenges/chinese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/62dabe2ef403a12d5d295273.md index 4b6e0b3eeaa..312d1d0bf91 100644 --- a/curriculum/challenges/chinese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/62dabe2ef403a12d5d295273.md +++ b/curriculum/challenges/chinese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/62dabe2ef403a12d5d295273.md @@ -75,7 +75,7 @@ assert( --fcc-editable-region--

Click here to view more cat photos.

- cat photos + link to cat pictures --fcc-editable-region-- A cute orange cat lying on its back. diff --git a/curriculum/challenges/espanol/11-machine-learning-with-python/machine-learning-with-python-projects/book-recommendation-engine-using-knn.md b/curriculum/challenges/espanol/11-machine-learning-with-python/machine-learning-with-python-projects/book-recommendation-engine-using-knn.md index b61ec6d5d1d..66f026df056 100644 --- a/curriculum/challenges/espanol/11-machine-learning-with-python/machine-learning-with-python-projects/book-recommendation-engine-using-knn.md +++ b/curriculum/challenges/espanol/11-machine-learning-with-python/machine-learning-with-python-projects/book-recommendation-engine-using-knn.md @@ -1,6 +1,6 @@ --- id: 5e46f8e3ac417301a38fb92f -title: Book Recommendation Engine using KNN +title: Motor de Recomendación de Libros Usando KNN challengeType: 10 forumTopicId: 462378 dashedName: book-recommendation-engine-using-knn @@ -8,19 +8,52 @@ dashedName: book-recommendation-engine-using-knn # --description-- -In this challenge, you will create a book recommendation algorithm using K-Nearest Neighbors. +En este proyecto trabajarás con Google Colaboratory. -You will use the Book-Crossings dataset. This dataset contains 1.1 million ratings (scale of 1-10) of 270,000 books by 90,000 users. +Después de ir a ese enlace, crea una copia del notebook en tu propia cuenta o de manera local. Una vez que hayas completado el proyecto y éste pase la prueba (incluida en ese enlace), envía el enlace de tu proyecto a continuación. Si envias un enlace a Google Colaboratory, asegúrate de que activas el uso compartido para "cualquiera con el enlace." -You can access [the full project instructions and starter code on Google Colaboratory](https://colab.research.google.com/github/freeCodeCamp/boilerplate-book-recommendation-engine/blob/master/fcc_book_recommendation_knn.ipynb). +Todavía estamos desarrollando la parte interactiva de la instrucción del plan de estudio de Python. Por ahora, usted puede pasar por los desafíos de vídeo en esta certificación. Es posible que también tengas que buscar recursos de aprendizaje adicionales, similares a lo que harías cuando trabajas en un proyecto del mundo real. -After going to that link, create a copy of the notebook either in your own account or locally. Once you complete the project and it passes the test (included at that link), submit your project link below. If you are submitting a Google Colaboratory link, make sure to turn on link sharing for "anyone with the link." +# --instructions-- -We are still developing the interactive instructional content for the machine learning curriculum. For now, you can go through the video challenges in this certification. You may also have to seek out additional learning resources, similar to what you would do when working on a real-world project. +En este desafío, crearás un algoritmo de recomendación de libros utilizando **K-Nearest Neighbors.**. + +Utilizará el conjunto de datos Book-Crossings. Este conjunto de datos contiene 1,1 millones de calificaciones (escala de 1-10) de 270,000 libros por 90.000 usuarios. + +Después de importar y limpiar los datos, usa `NearestNeighbors` desde `sklearn. eighbors` para desarrollar un modelo que muestre libros que son similares a un libro dado. El algoritmo de Neighbors más cercano mide la distancia para determinar la “cercanía” de las instancias. + +Crea una función llamada `get_recommends` que toma el título del libro (desde el conjunto de datos) como argumento y devuelve una lista de 5 libros similares con sus distancias del argumento del libro. + +Este código: + +```py +get_recommends("The Queen of the Damned (Vampire Chronicles (Paperback))") +``` + +debe retornar: + +```py +[ + 'The Queen of the Damned (Vampire Chronicles (Paperback))', + [ + ['Catch 22', 0.793983519077301], + ['The Witching Hour (Lives of the Mayfair Witches)', 0.7448656558990479], + ['Interview with the Vampire', 0.7345068454742432], + ['The Tale of the Body Thief (Vampire Chronicles (Paperback))', 0.5376338362693787], + ['The Vampire Lestat (Vampire Chronicles, Book II)', 0.5178412199020386] + ] +] +``` + +Tenga en cuenta que los datos devueltos desde `get_recommends()` es una lista. El primer elemento de la lista es el título del libro pasado a la función. El segundo elemento de la lista es una lista de cinco listas más. Cada una de las cinco listas contiene un libro recomendado y la distancia del libro recomendado al libro pasado a la función. + +Si graficas conjunto de datos (opcional), notaras que la mayoria de los libros no se clafican con frecuencia. Para garantizar la importacia estadística, elimine del conjunto de datos a los usuarios con menos de 200 calificaciones y libros con menos de 100 calificaciones. + +Las primeras tres celdas importan las bibliotecas que puede necesitar y los datos a utilizar. La celda final es para pruebas. Escribe todo tu código entre esas celdas. # --hints-- -It should pass all Python tests. +Debería pasar todas las pruebas de Python. ```js diff --git a/curriculum/challenges/espanol/11-machine-learning-with-python/machine-learning-with-python-projects/cat-and-dog-image-classifier.md b/curriculum/challenges/espanol/11-machine-learning-with-python/machine-learning-with-python-projects/cat-and-dog-image-classifier.md index 07288906ade..e7f0f296f2b 100644 --- a/curriculum/challenges/espanol/11-machine-learning-with-python/machine-learning-with-python-projects/cat-and-dog-image-classifier.md +++ b/curriculum/challenges/espanol/11-machine-learning-with-python/machine-learning-with-python-projects/cat-and-dog-image-classifier.md @@ -1,6 +1,6 @@ --- id: 5e46f8dcac417301a38fb92e -title: Cat and Dog Image Classifier +title: Clasificador de imágenes de gatos y perros challengeType: 10 forumTopicId: 462377 dashedName: cat-and-dog-image-classifier @@ -8,17 +8,101 @@ dashedName: cat-and-dog-image-classifier # --description-- -For this challenge, you will use TensorFlow 2.0 and Keras to create a convolutional neural network that correctly classifies images of cats and dogs with at least 63% accuracy. +Trabajarás en este proyecto con Google Colaboratory. -You can access [the full project instructions and starter code on Google Colaboratory](https://colab.research.google.com/github/freeCodeCamp/boilerplate-cat-and-dog-image-classifier/blob/master/fcc_cat_dog.ipynb). +Después de acceder al enlace, crea una copia del cuaderno ya sea en tu propia cuenta o de manera local. Una vez hayas completado el proyecto y superes el test (incluido en el enlace), envía el enlace del proyecto a continuación. Si envias un enlace a Google Colaboratory, asegúrate de que activas el uso compartido para "cualquiera con el enlace." -After going to that link, create a copy of the notebook either in your own account or locally. Once you complete the project and it passes the test (included at that link), submit your project link below. If you are submitting a Google Colaboratory link, make sure to turn on link sharing for "anyone with the link." +Todavía estamos desarrollando el contenido instructivo interactivo para el plan de estudios de aprendizaje automático. Por ahora, puedes pasar por los desafíos en video de esta certificación. También puede que tengas que buscar recursos de aprendizaje adicionales, similares a lo que harías cuando trabajas en un proyecto del mundo real. -We are still developing the interactive instructional content for the machine learning curriculum. For now, you can go through the video challenges in this certification. You may also have to seek out additional learning resources, similar to what you would do when working on a real-world project. +# --instructions-- + +Para este desafio, deberás completar el código para clasificar las imágenes de perros y gatos. Usaras TensorFlow 2.0 y Keras para crear una red neuronal convolucional que clasifique correctamente las imágenes de gatos y perros al menos el 63% de las veces. (¡Crédito adicional si obtienes un 70% de precisión!) + +Se le entregara parte del código, pero debes añadir el faltante para completar este desafío. Lea las instrucciones de cada celda de texto para que sepa lo que tiene que hacer en cada celda de código. + +La primera celda de código importa las bibliotecas requeridas. La celda de segundo código descarga los datos y establece variables clave. La tercera celda es el primer lugar en el que escribes tu propio código. + +La estructura de los archivos de conjuntos de datos que se descargan se ve así (Notará que el directorio de pruebas no tiene subdirectorios y las imágenes no están etiquetadas): + +```py +cats_and_dogs +|__ train: + |______ cats: [cat.0.jpg, cat.1.jpg ...] + |______ dogs: [dog.0.jpg, dog.1.jpg ...] +|__ validation: + |______ cats: [cat.2000.jpg, cat.2001.jpg ...] + |______ dogs: [dog.2000.jpg, dog.2001.jpg ...] +|__ test: [1.jpg, 2.jpg ...] +``` + +Si lo deseas, puedes ajustar los epochs y el tamaño por lotes, pero no es necesario. + +Las siguientes instrucciones corresponden a números de celda específicos, indicados con un comentario en la parte superior de la celda (como `# 3`). + +## Celda 3 + +¡Ahora es tu turno! Establecer correctamente cada una de las variables de esta celda. (Ya no deberían ser iguales a `None`.) + +Crea generadores de imágenes para cada uno de los tres conjuntos de datos de imagen (entrenamiento, validación, prueba). Utilice `ImageDataGenerator` para leer / decodificar las imágenes y convertirlas en tensores de punto flotante. Utilice el argumento `rescale` (y ningún otro argumento por ahora) para cambiar la escala de los tensores de valores entre 0 y 255 a valores entre 0 y 1. + +Para las variables `*_data_gen`, utilice el método `flow_from_directory`. Pase en el tamaño del lote, directorio, tamaño de destino (`(IMG_HEIGHT, IMG_WIDTH)`), modo de clase y cualquier otra cosa requerida. `test_data_gen` será el más complicado. Para `test_data_gen`, asegúrese de pasar en `shuffle=False` al método `flow_from_directory`. Esto asegurará que las predicciones finales se mantengan en el orden que espera nuestra prueba. Para `test_data_gen` también será útil observar la estructura de directorio. + + +Después de ejecutar el código, la salida debería verse así: + +```py +Found 2000 images belonging to 2 classes. +Found 1000 images belonging to 2 classes. +Found 50 images belonging to 1 class. +``` + +## Celda 4 + +La función `plotImages` se utilizará varias veces para trazar imágenes. Toma una matriz de imágenes y una lista de probabilidades, aunque la lista de probabilidades es opcional. Este código es para ti. Si creaste correctamente la variable `train_data_gen`, ejecutar esta celda graficará cinco imágenes de entrenamiento aleatorias. + +## Celda 5 + +Recree el `train_image_generator` usando `ImageDataGenerator`. + +Dado que hay una pequeña cantidad de ejemplos de entrenamiento, existe el riesgo de sobreajuste. Una forma de solucionar este problema es crear más datos de entrenamiento a partir de ejemplos de entrenamiento existentes mediante el uso de transformaciones aleatorias. + +Añade 4-6 transformaciones aleatorias como argumentos para `ImageDataGenerator`. Asegúrese de reescalar lo mismo que antes. + +## Celda 6 + +No tienes que hacer nada por esta celda. `train_data_gen` se crea como antes pero con el nuevo `train_image_generator`. Luego, una sola imagen se traza cinco veces diferentes usando diferentes variaciones. + +## Celda 7 + +En esta celda, cree un modelo para la red neuronal que genere probabilidades de clase. Debería usar el modelo secuencial de Keras. Probablemente involucre una pila de capas Conv2D y MaxPooling2D y luego una capa completamente conectada en la parte superior que se activa mediante una función de activación de ReLU. + +Compile el modelo pasando los argumentos para configurar el optimizador y la pérdida. Pase también `metrics=['accuracy']` para ver la precisión del entrenamiento y la validación para cada época de entrenamiento. + +## Celda 8 + +Utilice el método `fit` en su `model` para entrenar la red. Asegúrese de pasar argumentos para `x`, `steps_per_epoch`, `epochs`, `validation_data` y `validation_steps`. + +## Celda 9 + +Ejecute esta celda para visualizar la precisión y la pérdida del modelo. + +## Celda 10 + +Ahora es el momento de usar su modelo para predecir si una nueva imagen es un gato o un perro. + +En esta celda, obtenga la probabilidad de que cada imagen de prueba (de `test_data_gen`) sea un perro o un gato. `probabilities` debe ser una lista de números enteros. + +Llame a la función `plotImages` y pase las imágenes de prueba y las probabilidades correspondientes a cada imagen de prueba. + +Después de ejecutar la celda, debería ver las 50 imágenes de prueba con una etiqueta que muestra el porcentaje de "seguro" de que la imagen es un gato o un perro. La precisión corresponderá a la precisión que se muestra en el gráfico anterior (después de ejecutar la celda anterior). Más imágenes de entrenamiento podrían conducir a una mayor precisión. + +## Celda 11 + +Ejecute esta celda final para ver si pasó el desafío o si necesita seguir intentándolo. # --hints-- -It should pass all Python tests. +Debería pasar todas las pruebas de Python. ```js diff --git a/curriculum/challenges/espanol/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/62dabe2ef403a12d5d295273.md b/curriculum/challenges/espanol/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/62dabe2ef403a12d5d295273.md index 2da7e3ea07c..15ff1971cbb 100644 --- a/curriculum/challenges/espanol/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/62dabe2ef403a12d5d295273.md +++ b/curriculum/challenges/espanol/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/62dabe2ef403a12d5d295273.md @@ -75,7 +75,7 @@ assert( --fcc-editable-region--

Click here to view more cat photos.

- cat photos + link to cat pictures --fcc-editable-region-- A cute orange cat lying on its back. diff --git a/curriculum/challenges/espanol/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/5d5a813321b9e3db6c106a46.md b/curriculum/challenges/espanol/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/5d5a813321b9e3db6c106a46.md new file mode 100644 index 00000000000..c44e49ba526 --- /dev/null +++ b/curriculum/challenges/espanol/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/5d5a813321b9e3db6c106a46.md @@ -0,0 +1,154 @@ +--- +id: 5d5a813321b9e3db6c106a46 +title: Paso 1 +challengeType: 0 +dashedName: step-1 +--- + +# --description-- + +JavaScript es un poderoso lenguaje que le permite construir sitios web que sean interactivos. Para comenzar, cree su plantilla HTML estándar con un `DOCTYPE`, `html`, `head`, and `body`. Incluye un elemento `title` y un `link` para tu hoja de estilo, y tu etiqueta `meta` para el `charset`. Luego, crea un elemento `div` con el id `juego` dentro de tu `cuerpo`. Usa el texto `RPG - Dragon Repeller` para tu elemento `title`. + +# --hints-- + +Tu código debe contener la referencia `DOCTYPE`. + +```js +assert(code.match(/` después del tipo. + +```js +assert(code.match(//gi)); +``` + +Tu elemento `html` debe tener una etiqueta de apertura. No olvides el atributo `lang`. + +```js +assert(code.match(//gi)); +``` + +Tu elemento `html` debe tener una etiqueta de cierre. + +```js +assert(code.match(/<\/html\s*>/)); +``` + +Tu declaración `DOCTYPE` debe estar al comienzo de su HTML. + +```js +assert(__helpers.removeHtmlComments(code).match(/^\s*/i)); +``` + +Debe tener una etiqueta de apertura `head`. + +```js +assert(code.match(//i)); +``` + +Debe tener una etiqueta de cierre `head`. + +```js +assert(code.match(/<\/head\s*>/i)); +``` + +Debe tener una etiqueta de apertura `body`. + +```js +assert(code.match(//i)); +``` + +Debe tener una etiqueta de cierre `body`. + +```js +assert(code.match(/<\/body\s*>/i)); +``` + +Los elementos `head` y `body` deben ser hermanos. + +```js +assert(document.querySelector('head')?.nextElementSibling?.localName === 'body'); +``` + +El elemento `head` debe estar dentro del elemento `html`. + +```js +assert([...document.querySelector('html')?.children].some(x => x?.localName === 'head')); +``` + +El elemento `body` debe estar dentro del elemento `html`. + +```js +assert([...document.querySelector('html')?.children].some(x => x?.localName === 'body')); +``` + +Tu código debe tener un elemento `meta`. + +```js +const meta = document.querySelector('meta'); +assert.exists(meta); +``` + +Tu elemento `meta` debe tener un atributo `charset` con el valor `UTF-8`. + +```js +assert.match(code, / link'); +assert.exists(link); +``` + +Debe tener un elemento `div`. + +```js +const div = document.querySelector('div'); +assert.exists(div); +``` + +Tu elemento `div` debe tener un atributo `id` con el valor `game`. + +```js +const div = document.querySelector('div'); +assert.equal(div?.id, 'game'); +``` + +Tu elemento `div` debe estar dentro del elemento `body`. + +```js +const div = document.querySelector('div'); +assert.equal(div?.parentElement?.localName, 'body'); +``` + +# --seed-- + +## --seed-contents-- + +```html +--fcc-editable-region-- + +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/italian/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/62dabe2ef403a12d5d295273.md b/curriculum/challenges/italian/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/62dabe2ef403a12d5d295273.md index d28091449c4..0d84558b8ea 100644 --- a/curriculum/challenges/italian/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/62dabe2ef403a12d5d295273.md +++ b/curriculum/challenges/italian/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/62dabe2ef403a12d5d295273.md @@ -75,7 +75,7 @@ assert( --fcc-editable-region--

Click here to view more cat photos.

- cat photos + link to cat pictures --fcc-editable-region-- A cute orange cat lying on its back. diff --git a/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a2401b9842721796b72850.md b/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a2401b9842721796b72850.md new file mode 100644 index 00000000000..8caeb1c5f2f --- /dev/null +++ b/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a2401b9842721796b72850.md @@ -0,0 +1,62 @@ +--- +id: 62a2401b9842721796b72850 +title: Step 7 +challengeType: 0 +dashedName: step-7 +--- + +# --description-- + +Dai all'elemento `#text` il seguente testo: + +``` +Welcome to Dragon Repeller. You must defeat the dragon that is preventing people from leaving the town. +You are in the town square. Where do you want to go? Use the buttons above. +``` + +# --hints-- + +L'elemento `#text` dovrebbe contenere il testo fornito. + +```js +const text = document.querySelector('#text'); +assert.equal(text.innerText, "Welcome to Dragon Repeller. You must defeat the dragon that is preventing people from leaving the town. You are in the town square. Where do you want to go? Use the buttons above."); +``` + +# --seed-- + +## --seed-contents-- + +```html + + + + + + RPG - Dragon Repeller + + +
+
+ XP: 0 + Health: 100 + Gold: 50 +
+
+ + + +
+
+ Monster Name: + Health: +
+--fcc-editable-region-- +
+ +
+--fcc-editable-region-- +
+ + +``` diff --git a/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a3bb9aeefe4b3fc43c6d7b.md b/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a3bb9aeefe4b3fc43c6d7b.md new file mode 100644 index 00000000000..64811794318 --- /dev/null +++ b/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a3bb9aeefe4b3fc43c6d7b.md @@ -0,0 +1,116 @@ +--- +id: 62a3bb9aeefe4b3fc43c6d7b +title: Step 31 +challengeType: 0 +dashedName: step-31 +--- + +# --description-- + +`button1` è una variabile che non sarà riassegnata. Se non riassegnerai un nuovo valore a una variabile, è una buona pratica dichiararla usando la parola chiave `const` invece della parola chiave `let`. In questo modo JavaScript ti darà un errore se la riassegni accidentalmente. + +Cambia la variabile `button1` in modo che sia dichiarata con la parola chiave `const`. + +# --hints-- + +La variabile `button1` dovrebbe essere dichiarata con `const`. + +```js +assert.match(code, /const button1/); +``` + +La variabile `button1` dovrebbe ancora avere il valore dell'elemento `#button1`. + +```js +assert.deepEqual(button1, document.querySelector("#button1")); +``` + +# --seed-- + +## --seed-contents-- + +```html + + + + + + RPG - Dragon Repeller + + +
+
+ XP: 0 + Health: 100 + Gold: 50 +
+
+ + + +
+
+ Monster Name: + Health: +
+
+ Welcome to Dragon Repeller. You must defeat the dragon that is preventing people from leaving the town. You are in the town square. Where do you want to go? Use the buttons above. +
+
+ + + +``` + +```css +body { + background-color: darkblue; +} + +#text { + background-color: black; + color: white; + padding: 10px; +} + +#game { + max-width: 500px; + max-height: 400px; + background-color: lightgray; + color: white; + margin: 0 auto; + padding: 10px; +} + +#controls, #stats { + border: 1px solid black; + padding: 5px; + color: black; +} + +#monsterStats { + display: none; + border: 1px solid black; + padding: 5px; + color: white; + background-color: red; +} + +.stat { + padding-right: 10px; +} +``` + +```js +let xp = 0; +let health = 100; +let gold = 50; +let currentWeapon = 0; +let fighting; +let monsterHealth; +let inventory = ["stick"]; + +--fcc-editable-region-- +let button1 = document.querySelector("#button1"); +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a3bec30ea7f941412512dc.md b/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a3bec30ea7f941412512dc.md new file mode 100644 index 00000000000..d0380e45758 --- /dev/null +++ b/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a3bec30ea7f941412512dc.md @@ -0,0 +1,181 @@ +--- +id: 62a3bec30ea7f941412512dc +title: Step 33 +challengeType: 0 +dashedName: step-33 +--- + +# --description-- + +Proprio come hai fatto con i pulsanti, crea delle variabili per i seguenti `id` e usa `querySelector()` per dar loro l'elemento come valore: + +`text`, `xpText`, `healthText`, `goldText`, `monsterStats` e `monsterName`. + +Ricorda di dichiarare le variabili con la parola chiave `const` e di dar loro nomi corrispondenti agli `id`. + +# --hints-- + +Dovresti dichiarare una variabile `text` con `const`. + +```js +assert.match(code, /const text/); +``` + +La variabile `text` dovrebbe avere il valore dell'elemento `#text`. + +```js +assert.deepEqual(text, document.querySelector('#text')); +``` + +Dovresti dichiarare una variabile `xpText` con `const`. + +```js +assert.match(code, /const xpText/); +``` + +La variabile `xpText` dovrebbe avere il valore dell'elemento `#xpText`. + +```js +assert.deepEqual(xpText, document.querySelector('#xpText')); +``` + +Dovresti dichiarare una variabile `healthText` con `const`. + +```js +assert.match(code, /const healthText/); +``` + +La variabile `healthText` dovrebbe avere il valore dell'elemento `#healthText`. + +```js +assert.deepEqual(healthText, document.querySelector('#healthText')); +``` + +Dovresti dichiarare una variabile `goldText` con `const`. + +```js +assert.match(code, /const goldText/); +``` + +La variabile `goldText` dovrebbe avere il valore dell'elemento `#goldText`. + +```js +assert.deepEqual(goldText, document.querySelector('#goldText')); +``` + +Dovresti dichiarare una variabile `monsterStats` con `const`. + +```js +assert.match(code, /const monsterStats/); +``` + +La variabile `monsterStats` dovrebbe avere il valore dell'elemento `#monsterStats`. + +```js +assert.deepEqual(monsterStats, document.querySelector('#monsterStats')); +``` + +Dovresti dichiarare una variabile `monsterName` con `const`. + +```js +assert.match(code, /const monsterName/); +``` + +La variabile `monsterName` dovrebbe avere il valore dell'elemento `#monsterName`. + +```js +assert.deepEqual(monsterName, document.querySelector('#monsterName')); +``` + +# --seed-- + +## --seed-contents-- + +```html + + + + + + RPG - Dragon Repeller + + +
+
+ XP: 0 + Health: 100 + Gold: 50 +
+
+ + + +
+
+ Monster Name: + Health: +
+
+ Welcome to Dragon Repeller. You must defeat the dragon that is preventing people from leaving the town. You are in the town square. Where do you want to go? Use the buttons above. +
+
+ + + +``` + +```css +body { + background-color: darkblue; +} + +#text { + background-color: black; + color: white; + padding: 10px; +} + +#game { + max-width: 500px; + max-height: 400px; + background-color: lightgray; + color: white; + margin: 0 auto; + padding: 10px; +} + +#controls, #stats { + border: 1px solid black; + padding: 5px; + color: black; +} + +#monsterStats { + display: none; + border: 1px solid black; + padding: 5px; + color: white; + background-color: red; +} + +.stat { + padding-right: 10px; +} +``` + +```js +let xp = 0; +let health = 100; +let gold = 50; +let currentWeapon = 0; +let fighting; +let monsterHealth; +let inventory = ["stick"]; + +--fcc-editable-region-- +const button1 = document.querySelector("#button1"); +const button2 = document.querySelector("#button2"); +const button3 = document.querySelector("#button3"); + +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a3c0ab883fd9435cd5c518.md b/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a3c0ab883fd9435cd5c518.md new file mode 100644 index 00000000000..0e5248b2573 --- /dev/null +++ b/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a3c0ab883fd9435cd5c518.md @@ -0,0 +1,134 @@ +--- +id: 62a3c0ab883fd9435cd5c518 +title: Step 35 +challengeType: 0 +dashedName: step-35 +--- + +# --description-- + +I commenti ti consentono di aggiungere note al codice. In JavaScript, un commento su singola riga può essere scritto con `//` e un commento multi-riga può essere scritto con `/*` e `*/`. Ad esempio, ecco commenti singoli e multi-riga che dicono "Hello World": + +```js +// hello world +/* + hello world +*/ +``` + +Aggiungi un commento su una sola riga che dice `initialize buttons`. + +# --hints-- + +Dovresti usare il simbolo `//` per iniziare un commento su singola riga. + +```js +assert.match(code, /\/\//); +``` + +Il commento dovrebbe avere il testo `initialize buttons`. + +```js +assert.match(code, /\/\/\s*initialize buttons/); +``` + +# --seed-- + +## --seed-contents-- + +```html + + + + + + RPG - Dragon Repeller + + +
+
+ XP: 0 + Health: 100 + Gold: 50 +
+
+ + + +
+
+ Monster Name: + Health: +
+
+ Welcome to Dragon Repeller. You must defeat the dragon that is preventing people from leaving the town. You are in the town square. Where do you want to go? Use the buttons above. +
+
+ + + +``` + +```css +body { + background-color: darkblue; +} + +#text { + background-color: black; + color: white; + padding: 10px; +} + +#game { + max-width: 500px; + max-height: 400px; + background-color: lightgray; + color: white; + margin: 0 auto; + padding: 10px; +} + +#controls, #stats { + border: 1px solid black; + padding: 5px; + color: black; +} + +#monsterStats { + display: none; + border: 1px solid black; + padding: 5px; + color: white; + background-color: red; +} + +.stat { + padding-right: 10px; +} +``` + +```js +let xp = 0; +let health = 100; +let gold = 50; +let currentWeapon = 0; +let fighting; +let monsterHealth; +let inventory = ["stick"]; + +const button1 = document.querySelector('#button1'); +const button2 = document.querySelector("#button2"); +const button3 = document.querySelector("#button3"); +const text = document.querySelector("#text"); +const xpText = document.querySelector("#xpText"); +const healthText = document.querySelector("#healthText"); +const goldText = document.querySelector("#goldText"); +const monsterStats = document.querySelector("#monsterStats"); +const monsterName = document.querySelector("#monsterName"); +const monsterHealthText =document.querySelector("#monsterHealth"); + +--fcc-editable-region-- + +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a3c2fccf186146b59c6e96.md b/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a3c2fccf186146b59c6e96.md new file mode 100644 index 00000000000..17605ddb3b5 --- /dev/null +++ b/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a3c2fccf186146b59c6e96.md @@ -0,0 +1,134 @@ +--- +id: 62a3c2fccf186146b59c6e96 +title: Step 36 +challengeType: 0 +dashedName: step-36 +--- + +# --description-- + +`button1` rappresenta il primo elemento `button`. Questi elementi possiedono una proprietà particolare chiamata `onclick`, che puoi usare per determinare cosa accade quando qualcuno clicca il pulsante. In JavaScript è possibile accedere alle proprietà in un paio di modi - il primo è con la dot notation. Il modo per accedere alla proprietà `onclick` di un elemento button sarà `button.onclick`. + +Usa la dot notation per impostare la proprietà `onclick` di `button1` sulla variabile `goStore`. Questa variabile corrisponderà a qualcosa che scriverai più avanti. Nota che `button1` è già dichiarata, quindi non hai bisogno di usare `let` o `const`. + +# --hints-- + +Dovresti usare la dot notation per accedere alla proprietà `onclick` di `button1`. + +```js +assert.match(code, /button1\.onclick/); +``` + +Non dovresti usare `let` o `const`. + +```js +assert.notMatch(code, /(let|const)\s+button1\.onclick/); +``` + +Dovresti impostare la proprietà `onclick` di `button1` sulla variabile `goStore`. + +```js +assert.match(code, /button1\.onclick\s*=\s*goStore/); +``` + +# --seed-- + +## --seed-contents-- + +```html + + + + + + RPG - Dragon Repeller + + +
+
+ XP: 0 + Health: 100 + Gold: 50 +
+
+ + + +
+
+ Monster Name: + Health: +
+
+ Welcome to Dragon Repeller. You must defeat the dragon that is preventing people from leaving the town. You are in the town square. Where do you want to go? Use the buttons above. +
+
+ + + +``` + +```css +body { + background-color: darkblue; +} + +#text { + background-color: black; + color: white; + padding: 10px; +} + +#game { + max-width: 500px; + max-height: 400px; + background-color: lightgray; + color: white; + margin: 0 auto; + padding: 10px; +} + +#controls, #stats { + border: 1px solid black; + padding: 5px; + color: black; +} + +#monsterStats { + display: none; + border: 1px solid black; + padding: 5px; + color: white; + background-color: red; +} + +.stat { + padding-right: 10px; +} +``` + +```js +let xp = 0; +let health = 100; +let gold = 50; +let currentWeapon = 0; +let fighting; +let monsterHealth; +let inventory = ["stick"]; + +const button1 = document.querySelector('#button1'); +const button2 = document.querySelector("#button2"); +const button3 = document.querySelector("#button3"); +const text = document.querySelector("#text"); +const xpText = document.querySelector("#xpText"); +const healthText = document.querySelector("#healthText"); +const goldText = document.querySelector("#goldText"); +const monsterStats = document.querySelector("#monsterStats"); +const monsterName = document.querySelector("#monsterName"); +const monsterHealthText =document.querySelector("#monsterHealth"); + +--fcc-editable-region-- +// initialize buttons + +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a3c4a0e52767482c5202d4.md b/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a3c4a0e52767482c5202d4.md new file mode 100644 index 00000000000..c61d9da0980 --- /dev/null +++ b/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a3c4a0e52767482c5202d4.md @@ -0,0 +1,151 @@ +--- +id: 62a3c4a0e52767482c5202d4 +title: Step 37 +challengeType: 0 +dashedName: step-37 +--- + +# --description-- + +Usando la stessa sintassi, imposta le proprietà `onclick` di `button2` e `button3` rispettivamente su `goCave` e `fightDragon`. + +# --hints-- + +Dovresti usare la dot notation per accedere alla proprietà `onclick` di `button2`. + +```js +assert.match(code, /button2\.onclick/); +``` + +Non dovresti usare `let` o `const` per assegnare `button2.onclick`. + +```js +assert.notMatch(code, /(let|const)\s+button2\.onclick/); +``` + +Dovresti impostare la proprietà `onclick` di `button2` sulla variabile `goCave`. + +```js +assert.match(code, /button2\.onclick\s*=\s*goCave/); +``` + +Dovresti usare la dot notation per accedere alla proprietà `onclick` di `button3`. + +```js +assert.match(code, /button3\.onclick/); +``` + +Non dovresti usare `let` o `const` per assegnare `button3.onclick`. + +```js +assert.notMatch(code, /(let|const)\s+button3\.onclick/); +``` + +Dovresti impostare la proprietà `onclick` di `button3` sulla variabile `fightDragon`. + +```js +assert.match(code, /button3\.onclick\s*=\s*fightDragon/); +``` + +# --seed-- + +## --seed-contents-- + +```html + + + + + + RPG - Dragon Repeller + + +
+
+ XP: 0 + Health: 100 + Gold: 50 +
+
+ + + +
+
+ Monster Name: + Health: +
+
+ Welcome to Dragon Repeller. You must defeat the dragon that is preventing people from leaving the town. You are in the town square. Where do you want to go? Use the buttons above. +
+
+ + + +``` + +```css +body { + background-color: darkblue; +} + +#text { + background-color: black; + color: white; + padding: 10px; +} + +#game { + max-width: 500px; + max-height: 400px; + background-color: lightgray; + color: white; + margin: 0 auto; + padding: 10px; +} + +#controls, #stats { + border: 1px solid black; + padding: 5px; + color: black; +} + +#monsterStats { + display: none; + border: 1px solid black; + padding: 5px; + color: white; + background-color: red; +} + +.stat { + padding-right: 10px; +} +``` + +```js +let xp = 0; +let health = 100; +let gold = 50; +let currentWeapon = 0; +let fighting; +let monsterHealth; +let inventory = ["stick"]; + +const button1 = document.querySelector('#button1'); +const button2 = document.querySelector("#button2"); +const button3 = document.querySelector("#button3"); +const text = document.querySelector("#text"); +const xpText = document.querySelector("#xpText"); +const healthText = document.querySelector("#healthText"); +const goldText = document.querySelector("#goldText"); +const monsterStats = document.querySelector("#monsterStats"); +const monsterName = document.querySelector("#monsterName"); +const monsterHealthText =document.querySelector("#monsterHealth"); + +--fcc-editable-region-- +// initialize buttons +button1.onclick = goStore; + +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62fc20387ef88d1d1998aac5.md b/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62fc20387ef88d1d1998aac5.md new file mode 100644 index 00000000000..ef53a815f34 --- /dev/null +++ b/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62fc20387ef88d1d1998aac5.md @@ -0,0 +1,127 @@ +--- +id: 62fc20387ef88d1d1998aac5 +title: Step 32 +challengeType: 0 +dashedName: step-32 +--- + +# --description-- + +Usa `querySelector()` per ottenere gli altri due elementi button usando i loro `id`, `#button2` e `#button3`. Conservali in variabili chiamate `button2` e `button3`. Ricorda di usare `const`. + +# --hints-- + +Dovresti dichiarare una variabile `button2` con `const`. + +```js +assert.match(code, /const button2/); +``` + +La variabile `button2` dovrebbe avere il valore dell'elemento `#button2`. + +```js +assert.deepEqual(button2, document.querySelector('#button2')); +``` + +Dovresti dichiarare una variabile `button3` con `const`. + +```js +assert.match(code, /const button3/); +``` + +La variabile `button3` dovrebbe avere il valore dell'elemento `#button3`. + +```js +assert.deepEqual(button3, document.querySelector('#button3')); +``` + +# --seed-- + +## --seed-contents-- + +```html + + + + + + RPG - Dragon Repeller + + +
+
+ XP: 0 + Health: 100 + Gold: 50 +
+
+ + + +
+
+ Monster Name: + Health: +
+
+ Welcome to Dragon Repeller. You must defeat the dragon that is preventing people from leaving the town. You are in the town square. Where do you want to go? Use the buttons above. +
+
+ + + +``` + +```css +body { + background-color: darkblue; +} + +#text { + background-color: black; + color: white; + padding: 10px; +} + +#game { + max-width: 500px; + max-height: 400px; + background-color: lightgray; + color: white; + margin: 0 auto; + padding: 10px; +} + +#controls, #stats { + border: 1px solid black; + padding: 5px; + color: black; +} + +#monsterStats { + display: none; + border: 1px solid black; + padding: 5px; + color: white; + background-color: red; +} + +.stat { + padding-right: 10px; +} +``` + +```js +let xp = 0; +let health = 100; +let gold = 50; +let currentWeapon = 0; +let fighting; +let monsterHealth; +let inventory = ["stick"]; + +--fcc-editable-region-- +const button1 = document.querySelector("#button1"); + +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62fc211760bfc220f4734800.md b/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62fc211760bfc220f4734800.md new file mode 100644 index 00000000000..13baaadc65b --- /dev/null +++ b/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62fc211760bfc220f4734800.md @@ -0,0 +1,123 @@ +--- +id: 62fc211760bfc220f4734800 +title: Step 34 +challengeType: 0 +dashedName: step-34 +--- + +# --description-- + +Infine, usa `querySelector()` per ottenere l'elemento `#monsterHealth`. Dato che hai già dichiarato la variabile `monsterHealth` precedentemente, devi dare un nome diverso alla variabile per questo elemento. Dichiara una nuova variabile con la parola chiave `const` e dalle il nome `monsterHealthText`. + +# --hints-- + +Dovresti dichiarare una variabile `monsterHealthText` con `const`. + +```js +assert.match(code, /const monsterHealthText/); +``` + +La variabile `monsterHealthText` dovrebbe avere il valore dell'elemento `#monsterHealth`. + +```js +assert.deepEqual(monsterHealthText, document.querySelector('#monsterHealth')); +``` + +# --seed-- + +## --seed-contents-- + +```html + + + + + + RPG - Dragon Repeller + + +
+
+ XP: 0 + Health: 100 + Gold: 50 +
+
+ + + +
+
+ Monster Name: + Health: +
+
+ Welcome to Dragon Repeller. You must defeat the dragon that is preventing people from leaving the town. You are in the town square. Where do you want to go? Use the buttons above. +
+
+ + + +``` + +```css +body { + background-color: darkblue; +} + +#text { + background-color: black; + color: white; + padding: 10px; +} + +#game { + max-width: 500px; + max-height: 400px; + background-color: lightgray; + color: white; + margin: 0 auto; + padding: 10px; +} + +#controls, #stats { + border: 1px solid black; + padding: 5px; + color: black; +} + +#monsterStats { + display: none; + border: 1px solid black; + padding: 5px; + color: white; + background-color: red; +} + +.stat { + padding-right: 10px; +} +``` + +```js +let xp = 0; +let health = 100; +let gold = 50; +let currentWeapon = 0; +let fighting; +let monsterHealth; +let inventory = ["stick"]; + +--fcc-editable-region-- +const button1 = document.querySelector("#button1"); +const button2 = document.querySelector("#button2"); +const button3 = document.querySelector("#button3"); +const text = document.querySelector("#text"); +const xpText = document.querySelector("#xpText"); +const healthText = document.querySelector("#healthText"); +const goldText = document.querySelector("#goldText"); +const monsterStats = document.querySelector("#monsterStats"); +const monsterName = document.querySelector("#monsterName"); + +--fcc-editable-region-- +``` diff --git a/curriculum/challenges/portuguese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/62dabe2ef403a12d5d295273.md b/curriculum/challenges/portuguese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/62dabe2ef403a12d5d295273.md index cccfc8bc12b..6afbeea3897 100644 --- a/curriculum/challenges/portuguese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/62dabe2ef403a12d5d295273.md +++ b/curriculum/challenges/portuguese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/62dabe2ef403a12d5d295273.md @@ -75,7 +75,7 @@ assert( --fcc-editable-region--

Click here to view more cat photos.

- cat photos + link to cat pictures --fcc-editable-region-- A cute orange cat lying on its back. diff --git a/curriculum/challenges/ukrainian/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/62dabe2ef403a12d5d295273.md b/curriculum/challenges/ukrainian/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/62dabe2ef403a12d5d295273.md index 20c64f87309..f0e89ba4214 100644 --- a/curriculum/challenges/ukrainian/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/62dabe2ef403a12d5d295273.md +++ b/curriculum/challenges/ukrainian/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/62dabe2ef403a12d5d295273.md @@ -75,7 +75,7 @@ assert( --fcc-editable-region--

Click here to view more cat photos.

- cat photos + link to cat pictures --fcc-editable-region-- A cute orange cat lying on its back.