-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding Una fiesta arruinada exercise
- Loading branch information
1 parent
27949b0
commit 5684ccd
Showing
2 changed files
with
47 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/// <reference path = "ElCangrejoAguafiestas.ts" /> | ||
|
||
class UnaFiestaArruinada extends ElCangrejoAguafiestas{ | ||
matriz(){ | ||
return [ | ||
['T','T','T','T','T'], | ||
['F','F','T','F','F'], | ||
['F','F','T','F','F'], | ||
['F','F','T','F','F']] | ||
} | ||
|
||
agregarAutomata(){ | ||
this.cuadricula.agregarActor(this.automata,0,this.cuadricula.cantColumnas-1); | ||
} | ||
|
||
estaResueltoElProblema(){ | ||
return this.contarActoresConEtiqueta('GloboAnimado')==0; | ||
} | ||
|
||
completarColumnaConGlobos(columna, filas){ | ||
filas.forEach(fila => this.agregarGlobo(this.cuadricula.casilla(fila, columna))) | ||
} | ||
|
||
completarConGlobos(){ | ||
this.agregarGlobo(this.cuadricula.casilla(0,0)) | ||
if(Math.random() > 0.5){ | ||
this.completarColumnaConGlobos(2, [0,1,2,3]) | ||
} | ||
} | ||
} |