Skip to content

Commit

Permalink
Merge pull request #1474 from Program-AR/challengeContandoManic
Browse files Browse the repository at this point in the history
Mañic contando astros
  • Loading branch information
asanzo authored Oct 3, 2023
2 parents bd9fd48 + feacf9d commit 57d079f
Show file tree
Hide file tree
Showing 16 changed files with 319 additions and 8 deletions.
22 changes: 22 additions & 0 deletions app/services/blocks-gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,18 @@ export default Service.extend({
argumentos: '{etiqueta: "ManzanaAnimada", nombreAnimacion: "comerManzana"}',
});

this.crearBloqueAccion('ContarPlaneta', 'countPlanet', {
icono: 'icono.planeta.png',
comportamiento: 'Contar',
argumentos: '{etiqueta: "Planeta", nombreAnimacion: "usarCatalejo"}',
});

this.crearBloqueAccion('ContarEstrella', 'countStar', {
icono: 'icono.estrella.png',
comportamiento: 'Contar',
argumentos: '{etiqueta: "Estrella", nombreAnimacion: "usarCatalejo"}',
});

this.crearBloqueAccion('ExplotarGlobo', 'blowUpBallon', {
icono: 'icono.globo.png',
comportamiento: 'Interactuar',
Expand Down Expand Up @@ -1254,6 +1266,16 @@ export default Service.extend({
funcionSensor: 'casillaActual().esFin()',
});

this.crearBloqueSensor('EstoySobreElInicioManic', 'atColumnBeginning', {
icono: 'icono.casillainiciomanic.png',
funcionSensor: 'casillaActual().esInicio()',
});

this.crearBloqueSensor('EstoySobreElFinalManic', 'atColumnEnd', {
icono: 'icono.casillafinmanic.png',
funcionSensor: 'casillaActual().esFin()',
});

this.crearBloqueSensor('LargoColumnaActual', 'currentColumnLength', {
icono: 'icono.largoCol.png',
funcionSensor: 'largoColumnaActual()-1',
Expand Down
22 changes: 22 additions & 0 deletions app/utils/staticData/desafios.js
Original file line number Diff line number Diff line change
Expand Up @@ -2931,6 +2931,28 @@ export const desafios = [
conditionalRepetition: true,
}
},
{
id: 'nuevo25',
nombre: 'ContandoPlanetasYEstrellas',
escena: 'ContandoPlanetasYEstrellas',
bloques: ['Procedimiento', 'MoverACasillaArriba', 'MoverACasillaAbajo',
'SiguienteColumna', 'ContarPlaneta', 'ContarEstrella',
'TocandoPlaneta', 'TocandoEstrellaManic', 'Repetir', 'Si', 'SiNo',
'Hasta', 'EstoySobreElInicioManic', 'EstoySobreElFinalManic'],
expectations: {
conditionalRepetition: true,
}
},
{
id: 'nuevo27',
nombre: 'ContandoDeNuevoManic',
escena: 'ContandoDeNuevoManic',
bloques: ['Procedimiento', 'MoverACasillaArriba', 'MoverACasillaAbajo',
'SiguienteColumna',
'ContarPlaneta', 'ContarEstrella', 'TocandoPlaneta',
'TocandoEstrellaManic', 'RepetirVacio', 'Repetir', 'Si', 'SiNo', 'Hasta',
'EstoySobreElInicioManic', 'LargoColumnaActual']
},
{
id: 'nuevo28',
nombre: 'ElPlanetaDeCapyYGuyra',
Expand Down
2 changes: 2 additions & 0 deletions app/utils/staticData/grupos.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,8 @@ export const grupos = [
'nuevo21',
'nuevo23',
'nuevo24',
'nuevo25',
'nuevo27',
'nuevo28',
'nuevo132',
'nuevo133',
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"creador-de-desafios-pilasbloques": "^1.0.1",
"mulang": "^6.0.5",
"pilas-bloques-ember-intl": "^1.1.2",
"pilas-bloques-exercises": "1.4.4",
"pilas-bloques-exercises": "1.4.5",
"pilasweb": "^0.5.0",
"proceds-blockly": "^1.1.0",
"ramda": "^0.28.0",
Expand Down
Binary file added public/iconos/icono.casillafinmanic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/iconos/icono.casillainiciomanic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/pilas.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

<head>
<script src="libs/pilasweb.js?v=0.5.0"></script>
<script src="libs/pilas-bloques-exercises.js?v=1.4.4"></script>
<script src="libs/pilas-bloques-exercises.js?v=1.4.5"></script>
</head>

</html>
110 changes: 110 additions & 0 deletions tests/integration/desafios/ContandoDeNuevoManic-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
import { moduloActividad, actividadTest } from '../../helpers/actividadTest';

const nombre = "ContandoDeNuevoManic";

moduloActividad(nombre, () => {

actividadTest(nombre, {
solucion: `<?xml version="1.0" encoding="UTF-8"?>
<xml xmlns="http://www.w3.org/1999/xhtml">
<block type="al_empezar_a_ejecutar" id="3" deletable="false" movable="false" editable="false" x="0" y="0">
<statement name="program">
<block type="Repetir" id="4" inline="true">
<value name="count">
<block type="math_number" id="5">
<field name="NUM">4</field>
</block>
</value>
<statement name="block">
<block type="procedures_callnoreturn" id="6">
<mutation name="Contar astros de columna" />
<next>
<block type="procedures_callnoreturn" id="7">
<mutation name="Volver al inicio" />
<next>
<block type="SiguienteColumna" id="8" />
</next>
</block>
</next>
</block>
</statement>
<next>
<block type="procedures_callnoreturn" id="37">
<mutation name="Contar astros de columna" />
</block>
</next>
</block>
</statement>
</block>
<block type="procedures_defnoreturn" id="9" x="280" y="35">
<mutation />
<field name="NAME">Volver al inicio</field>
<statement name="STACK">
<block type="hasta" id="10" inline="true">
<value name="condition">
<block type="EstoySobreElInicioManic" id="11" />
</value>
<statement name="block">
<block type="MoverACasillaArriba" id="12" />
</statement>
</block>
</statement>
</block>
<block type="procedures_defnoreturn" id="13" x="11" y="201">
<mutation />
<field name="NAME">Contar astros de columna</field>
<statement name="STACK">
<block type="Repetir" id="14" inline="true">
<value name="count">
<block type="LargoColumnaActual" id="15" />
</value>
<statement name="block">
<block type="MoverACasillaAbajo" id="16">
<next>
<block type="procedures_callnoreturn" id="17">
<mutation name="Contar planeta si hay" />
<next>
<block type="procedures_callnoreturn" id="18">
<mutation name="Contar estrella si hay" />
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</statement>
</block>
<block type="procedures_defnoreturn" id="19" x="319" y="281">
<mutation />
<field name="NAME">Contar planeta si hay</field>
<statement name="STACK">
<block type="si" id="20" inline="true">
<value name="condition">
<block type="TocandoPlaneta" id="21" />
</value>
<statement name="block">
<block type="ContarPlaneta" id="22" />
</statement>
</block>
</statement>
</block>
<block type="procedures_defnoreturn" id="23" x="47" y="393">
<mutation />
<field name="NAME">Contar estrella si hay</field>
<statement name="STACK">
<block type="si" id="24" inline="true">
<value name="condition">
<block type="TocandoEstrellaManic" id="25" />
</value>
<statement name="block">
<block type="ContarEstrella" id="26" />
</statement>
</block>
</statement>
</block>
</xml>`,

});

});
110 changes: 110 additions & 0 deletions tests/integration/desafios/ContandoPlanetasYEstrellas-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
import { moduloActividad, actividadTest } from '../../helpers/actividadTest';

const nombre = 'ContandoPlanetasYEstrellas';

moduloActividad(nombre, () => {

actividadTest(nombre, {
solucion: `<?xml version="1.0" encoding="UTF-8"?>
<xml xmlns="http://www.w3.org/1999/xhtml">
<block type="al_empezar_a_ejecutar" id="1" deletable="false" movable="false" editable="false" x="0" y="0">
<statement name="program">
<block type="Repetir" id="68" inline="true">
<value name="count">
<block type="math_number" id="69">
<field name="NUM">4</field>
</block>
</value>
<statement name="block">
<block type="procedures_callnoreturn" id="81">
<mutation name="Contar astros de columna" />
<next>
<block type="procedures_callnoreturn" id="87">
<mutation name="Volver al inicio" />
<next>
<block type="SiguienteColumna" id="93" />
</next>
</block>
</next>
</block>
</statement>
<next>
<block type="procedures_callnoreturn" id="108">
<mutation name="Contar astros de columna" />
</block>
</next>
</block>
</statement>
</block>
<block type="procedures_defnoreturn" id="53" x="277" y="15">
<mutation />
<field name="NAME">Contar astros de columna</field>
<statement name="STACK">
<block type="hasta" id="114" inline="true">
<value name="condition">
<block type="EstoySobreElFinalManic" id="129" />
</value>
<statement name="block">
<block type="MoverACasillaAbajo" id="146">
<next>
<block type="procedures_callnoreturn" id="163">
<mutation name="Contar estrella si hay" />
<next>
<block type="procedures_callnoreturn" id="157">
<mutation name="Contar planeta si hay" />
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</statement>
</block>
<block type="procedures_defnoreturn" id="49" x="13" y="211">
<mutation />
<field name="NAME">Contar estrella si hay</field>
<statement name="STACK">
<block type="si" id="202" inline="true">
<value name="condition">
<block type="TocandoEstrellaManic" id="217" />
</value>
<statement name="block">
<block type="ContarEstrella" id="228" />
</statement>
</block>
</statement>
</block>
<block type="procedures_defnoreturn" id="46" x="411" y="227">
<mutation />
<field name="NAME">Contar planeta si hay</field>
<statement name="STACK">
<block type="si" id="240" inline="true">
<value name="condition">
<block type="TocandoPlaneta" id="222" />
</value>
<statement name="block">
<block type="ContarPlaneta" id="234" />
</statement>
</block>
</statement>
</block>
<block type="procedures_defnoreturn" id="58" x="154" y="312">
<mutation />
<field name="NAME">Volver al inicio</field>
<statement name="STACK">
<block type="hasta" id="251" inline="true">
<value name="condition">
<block type="EstoySobreElInicioManic" id="256" />
</value>
<statement name="block">
<block type="MoverACasillaArriba" id="262" />
</statement>
</block>
</statement>
</block>
</xml>`,
});


});
2 changes: 2 additions & 0 deletions translations/blocks/en-us.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ nextLine: Go to the next line
nextColumn: Go to the next column
countBanana: Count a banana
countApple: Count an apple
countPlanet: Count a planet
countStar: Count a star
blowUpBallon: Pinch the balloon
kickBall: Kick the ball
kickFootballBall: Kick the football ball
Expand Down
2 changes: 2 additions & 0 deletions translations/blocks/es-ar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ nextLine: Pasar a la siguiente fila
nextColumn: Pasar a la siguiente columna
countBanana: Contar una banana
countApple: Contar una manzana
countPlanet: Contar un planeta
countStar: Contar una estrella
blowUpBallon: Explotar globo
kickBall: Patear pelota
kickFootballBall: Patear pelota de fútbol
Expand Down
2 changes: 2 additions & 0 deletions translations/blocks/pt-br.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ nextLine: Ir para a próxima linha
nextColumn: Ir para a linha anterior
countBanana: Contar uma banana
countApple: Contar uma maçã
countPlanet: Contar um planeta
countStar: Contar uma estrela
blowUpBallon: Explodir balão
kickBall: Chutar bola
kickFootballBall: Chutar bola de futebol
Expand Down
15 changes: 14 additions & 1 deletion translations/en-us.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,15 @@ model:
description: |
We should power all computers on taking into account that the scenario width and height change each time you run the program. Clue: think how you could turn on all computers from only one rectangle, and then repeat the same action for the rest of the sides.
clue: ''
'nuevo25':
title: Counting planets and stars
description: |
Mañic should visit all boxes and count how many planets and stars are there in total. Clue: first think how you could count whether there is any planet or star in a particular box. Then think how you could count all celestial bodies in only one particular column.
clue: 'Splitting a big problem into several little problems can help you better understand each of its parts. Even better: you can focus on solving smaller and easier parts!'
'nuevo27':
title: Mañic counts again
description: 'Mañic needs to count the celestial bodies again, but now she cannot check whether she reached the end of the column! Is there any sensor to help her?'
clue: 'A sensor will allow us to get information that can change each time you run the program, even during the same run. For example, the length of a column changes depending on the column on which Mañic is standing.'
'nuevo28':
title: Capy and Guyrá’s planet
description: |
Expand Down Expand Up @@ -908,6 +917,8 @@ model:
title: 'With Coty'
tecnopolis2021ConToto:
title: 'With Toto'
grupoTemporal:
title: 'Temporary Group'
books:
'1':
title: Beginner Level
Expand Down Expand Up @@ -940,4 +951,6 @@ model:
Parametrización de soluciones:
title: Solutions parameterizing
Desafios complementarios:
title: Complementary challenges
title: Complementary challenges
capiTemporal:
title: Temporary challenges
Loading

0 comments on commit 57d079f

Please sign in to comment.