Skip to content

Commit

Permalink
comer caramelos
Browse files Browse the repository at this point in the history
  • Loading branch information
juancuiule committed Oct 29, 2018
1 parent 7309d2d commit 5e5b354
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/ninio.wlk
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,12 @@ class Ninio inherits Asustador {

override method elementos() = elementos

method comerCaramelos(cantidad) {
if(cantidad > caramelos) {
self.error("Un niño no puede comer mas caramelos de los que tiene")
}
caramelos -= cantidad
}

}

0 comments on commit 5e5b354

Please sign in to comment.