Skip to content

Commit

Permalink
Merge tag '1.4.14' of github.com:Program-AR/pilas-bloques-exercises i…
Browse files Browse the repository at this point in the history
…nto reciclandoPapeles
  • Loading branch information
danielferro69 committed Oct 25, 2023
2 parents c4d12f1 + a557472 commit 830429a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion 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
@@ -1,6 +1,6 @@
{
"name": "pilas-bloques-exercises",
"version": "1.4.13",
"version": "1.4.14",
"description": "Exercises for Pilas Bloques",
"homepage": "http://pilasbloques.program.ar",
"author": {
Expand Down
10 changes: 9 additions & 1 deletion src/escenas/libroPrimaria/EscenaDesdeMapa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ abstract class EscenaDesdeMapa extends EscenaActividad {
let nroColumna: number = casilla.nroColumna;
let ids: string[] = mapa[nroFila][nroColumna].split("&");
ids.forEach(id => {
if (id != '' && id != ' ' && id != '-' && id != '_') { // si no es casilla libre
if(id === '+'){
this.guardarPosicionFinal([nroColumna, nroFila])
}else if (id != '' && id != ' ' && id != '-' && id != '_') { // si no es casilla libre
let actor = this.mapearIdentificadorAActor(id, nroFila, nroColumna);
cuadricula.agregarActorEnCasilla(actor, casilla, true);
}
Expand Down Expand Up @@ -497,6 +499,12 @@ class GeneradorDeCasillaNula implements GeneradorDeCasilla {
esAleatorioPara(generador: GeneradorDeMapasAleatorios): boolean { return false; }
}

/** Corresponde a las casillas indicadas con `+`. */
class GeneradorDeCasillaFinal implements GeneradorDeCasilla {
generarSemillaDeCasilla(generador: GeneradorDeMapasAleatorios): SemillaDeCasilla { return new SemillaDeCasilla('+'); }
esAleatorioPara(generador: GeneradorDeMapasAleatorios): boolean { return false; }
}

/** Corresponde al modificador `?` (recursivo). */
class GeneradorDeCasillaMaybe implements GeneradorDeCasilla {
constructor(private generadorInterno: GeneradorDeCasilla, private proba?: number) { }
Expand Down
5 changes: 4 additions & 1 deletion src/gramaticaAleatoria.ne
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ Atom -> Id {% d => new GeneradorDeCasillaSimple(d[0]) %}
| Col {% id %}
| Nil {% id %}
| Void {% id %}
| "(" _ Term _ ")" {% d => d[2] %}
| End {% id %}
| "(" _ Term _ ")" {% d => d[2] %}
Id -> [a-zA-Z0-9]:+ {% d => d[0].join("") %}
Bag -> "$" {% d => new GeneradorDeCasillaBolsa() %}
| "$" _ Id {% d => new GeneradorDeCasillaBolsa(d[2]) %}
Expand All @@ -56,4 +57,6 @@ Macro -> "#" _ Id {% d => new GeneradorDeCasillaMacro(d[2]) %}

And -> Atom _ "&" _ Atom {% d => new GeneradorDeCasillaAnd(d[0], d[4]) %}

End -> "+" {% d => new GeneradorDeCasillaFinal() %}

Void -> "_" {% d => new GeneradorDeCasillaNula() %}

0 comments on commit 830429a

Please sign in to comment.