-
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 c88275c
Showing
11 changed files
with
189 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,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="src" path="src"/> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> | ||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> | ||
<classpathentry kind="output" path="bin"/> | ||
</classpath> |
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 @@ | ||
bin |
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,35 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>jaloguin</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.pde.ManifestBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.pde.SchemaBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
<nature>org.eclipse.pde.PluginNature</nature> | ||
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature> | ||
<nature>org.uqbar.project.wollok.wollokNature</nature> | ||
</natures> | ||
</projectDescription> |
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 @@ | ||
eclipse.preferences.version=1 | ||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled | ||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 | ||
org.eclipse.jdt.core.compiler.compliance=1.8 | ||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error | ||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error | ||
org.eclipse.jdt.core.compiler.source=1.8 |
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,22 @@ | ||
Manifest-Version: 1.0 | ||
Bundle-ManifestVersion: 2 | ||
Bundle-Name: jaloguin | ||
Bundle-Vendor: My Company | ||
Bundle-Version: 1.0.0.qualifier | ||
Bundle-SymbolicName: jaloguin; singleton:=true | ||
Bundle-ActivationPolicy: lazy | ||
Require-Bundle: com.ibm.icu, | ||
org.eclipse.xtext, | ||
org.eclipse.xtext.generator, | ||
org.eclipse.xtend, | ||
org.eclipse.xtend.typesystem.emf, | ||
org.eclipse.xpand, | ||
de.itemis.xtext.antlr;resolution:=optional, | ||
org.eclipse.emf.mwe2.launch;resolution:=optional, | ||
org.uqbar.project.wollok, | ||
org.uqbar.project.wollok.launch, | ||
org.uqbar.project.wollok.lib, | ||
org.eclipse.xtext.ui | ||
Import-Package: org.apache.log4j, | ||
org.apache.commons.logging | ||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8 |
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,3 @@ | ||
source.. = src/ | ||
bin.includes = META-INF/,\ | ||
. |
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 @@ | ||
wollokRoot |
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,49 @@ | ||
import ninio.* | ||
|
||
class Adulto { | ||
|
||
var niniosQueIntentaronAsustarlo = 0 | ||
|
||
method tolerancia() { | ||
return 10 * niniosQueIntentaronAsustarlo | ||
} | ||
|
||
method seAsustaCon(asustador) { | ||
return self.tolerancia() < asustador.capacidadDeSusto() | ||
} | ||
|
||
method caramelosQueDa() { | ||
return self.tolerancia() / 2 | ||
} | ||
|
||
method darCaramelos(asustador) { | ||
asustador.recibirCaramelos(self.caramelosQueDa()) | ||
} | ||
|
||
method recibirSusto(asustador) { | ||
if (self.seAsustaCon(asustador)) { | ||
self.darCaramelos(asustador) | ||
} | ||
if (asustador.tieneMasDe(15)) { | ||
niniosQueIntentaronAsustarlo += 1 | ||
} | ||
} | ||
|
||
} | ||
|
||
class Abuelo inherits Adulto { | ||
|
||
override method seAsustaCon(asustador) = true | ||
|
||
override method caramelosQueDa() { | ||
return super() / 2 | ||
} | ||
|
||
} | ||
|
||
class Necio inherits Adulto { | ||
|
||
override method seAsustaCon(asustador) = false | ||
|
||
} | ||
|
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,10 @@ | ||
log4j.rootLogger=WARN, stdout | ||
|
||
# WHOLE UQBAR | ||
log4j.logger.org.uqbar=WARN | ||
## DEBUGGER | ||
org.uqbar.project.wollok.ui.debugger | ||
|
||
log4j.appender.stdout=org.apache.log4j.ConsoleAppender | ||
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout | ||
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n |
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 @@ | ||
class Ninio { | ||
|
||
var elementos | ||
var actitud | ||
var caramelos = 0 | ||
|
||
constructor(unaActitud, elementosIniciales) { | ||
actitud = unaActitud | ||
elementos = elementosIniciales | ||
} | ||
|
||
method capacidadDeSusto() { | ||
return elementos.sum({ elemento => elemento.capacidadDeSusto() }) * actitud | ||
} | ||
|
||
method asustar(alguien) { | ||
alguien.recibirSusto(self) | ||
} | ||
|
||
method recibirCaramelos(cantidad) { | ||
caramelos += cantidad | ||
} | ||
|
||
method tieneMasDe(cantidad) { | ||
return caramelos > cantidad | ||
} | ||
|
||
method caramelos() = caramelos | ||
} | ||
|
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,24 @@ | ||
import ninio.* | ||
import adulto.* | ||
|
||
describe "tests para ninos" { | ||
|
||
var hijitus | ||
var oaky | ||
var abuelito | ||
fixture { | ||
hijitus = new Ninio(5, #{}) | ||
oaky = new Ninio(10, #{}) | ||
abuelito = new Abuelo() | ||
} | ||
|
||
test "hijitus no tiene elementos entonces su capacidad de susto es 0" { | ||
assert.equals(0, hijitus.capacidadDeSusto()) | ||
} | ||
|
||
// test "oaky asusta a un abuelo y recibe caramelos" { | ||
// abuelito.recibirSusto(oaky) | ||
// assert.equals(2.5, oaky.caramelos()) | ||
// } | ||
} | ||
|