-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 6a1affb
Showing
26 changed files
with
194 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: build | ||
|
||
on: [push, pull_request] | ||
jobs: | ||
wollok-ts: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: | | ||
wget -O wollok-ts-cli https://github.com/uqbar-project/wollok-ts-cli/releases/latest/download/wollok-ts-cli-linux-x64 | ||
chmod a+x ./wollok-ts-cli | ||
./wollok-ts-cli test --skipValidations -p ./ | ||
shell: bash |
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,6 @@ | ||
|
||
# Local history | ||
.history | ||
|
||
# Wollok Log | ||
*.log |
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,6 @@ | ||
|
||
|
||
## example | ||
|
||
TODO | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,19 @@ | ||
import grafico.* | ||
import grupo1.* | ||
import grupo2.* | ||
import opiniones.* | ||
|
||
program graficadorEncuestas { | ||
const encuesta = new Encuesta() | ||
encuesta.opiniones().add(grupo1) | ||
encuesta.opiniones().add(grupo2) | ||
|
||
game.boardGround("fondoClaro.jpg") | ||
game.height(14) | ||
game.width(16) new GraficoBarrasIconos( | ||
valores = encuesta.resultados(), | ||
etiquetas = encuesta.descripciones(), | ||
position = game.at(3, 3) | ||
).dibujar() | ||
game.start() | ||
} |
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,101 @@ | ||
import wollok.game.* | ||
|
||
class BarraVertical { | ||
const valor | ||
var position | ||
|
||
method dibujar() { | ||
if (valor > 0) valor.times( | ||
{ i => | ||
new Item(position = position).dibujar() | ||
position = position.up(1) | ||
} | ||
) | ||
} | ||
} | ||
|
||
class GraficoBarras { | ||
const valores | ||
const etiquetas | ||
const maximo = 10 | ||
var property position | ||
|
||
method dibujar() { | ||
self.dibujarBarras() | ||
self.dibujarEtiquetasHorizontales() | ||
self.dibujarEtiquetasVerticales() | ||
} | ||
|
||
method dibujarBarras() { | ||
var pos = position | ||
|
||
valores.forEach( | ||
{ valor => | ||
new BarraVertical(valor = valor, position = pos).dibujar() | ||
pos = pos.right(2) | ||
} | ||
) | ||
} | ||
|
||
method dibujarEtiquetasHorizontales() { | ||
var pos = position.down(2) | ||
etiquetas.forEach( | ||
{ etiqueta => | ||
self.nuevaEtiquetaHorizontal(etiqueta, pos).dibujar() | ||
pos = pos.right(2) | ||
} | ||
) | ||
} | ||
|
||
method dibujarEtiquetasVerticales() { | ||
var pos = position.left(2) | ||
maximo.times( | ||
{ nro => | ||
self.nuevaEtiquetaVertical(nro.toString(), pos).dibujar() | ||
pos = pos.up(1) | ||
} | ||
) | ||
} | ||
|
||
method nuevaEtiquetaHorizontal(etiqueta, pos) = new Etiqueta( | ||
text = etiqueta, | ||
position = pos | ||
) | ||
|
||
method nuevaEtiquetaVertical(etiqueta, pos) = self.nuevaEtiquetaHorizontal( | ||
etiqueta, | ||
pos | ||
) | ||
} | ||
|
||
class GraficoBarrasIconos inherits GraficoBarras { | ||
override method nuevaEtiquetaHorizontal(etiqueta, pos) = new Icono( | ||
image = etiqueta, | ||
position = pos | ||
) | ||
|
||
override method nuevaEtiquetaVertical(etiqueta, pos) = new Icono( | ||
image = ("number-" + etiqueta) + ".png", | ||
position = pos | ||
) | ||
} | ||
|
||
class Visual { | ||
const property position | ||
|
||
method dibujar() { | ||
game.addVisual(self) | ||
} | ||
} | ||
|
||
class Icono inherits Visual { | ||
const property image | ||
} | ||
|
||
class Etiqueta inherits Visual { | ||
const property text | ||
} | ||
|
||
class Item inherits Visual { | ||
method image() = "cuadradoliso.jpg" | ||
} |
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,7 @@ | ||
import opiniones.* | ||
|
||
const grupo1 = new Opinion( | ||
objetos = 9, | ||
funcional = 7, | ||
logico = 3 | ||
) |
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,7 @@ | ||
import opiniones.* | ||
|
||
const grupo2 = new Opinion( | ||
objetos = 6, | ||
funcional = 10, | ||
logico = 4 | ||
) |
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,18 @@ | ||
class Opinion { | ||
|
||
var property objetos | ||
|
||
var property funcional | ||
|
||
var property logico | ||
|
||
} | ||
|
||
|
||
class Encuesta { | ||
const property opiniones = [] | ||
const property descripciones = ["wollok.png", "haskell.png", "prolog.png"] | ||
const property criterios = [{o=>o.objetos()},{o=>o.funcional()},{o=>o.logico()} ] | ||
|
||
method resultados() = criterios.map({c=>opiniones.sum(c)/opiniones.size()}) | ||
} |
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,7 @@ | ||
{ | ||
"name": "encuesta", | ||
"version": "1.0.0", | ||
"wollokVersion": "4.0.0", | ||
"author": "lucas", | ||
"license": "ISC" | ||
} |
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,9 @@ | ||
import grafico.* | ||
|
||
describe "group of tests for grafico" { | ||
|
||
test "valoracion promedio" { | ||
//assert.equals(100, pepita.energy()) | ||
} | ||
|
||
} |