-
-
Save tefanga/399905367c95d6499a9d8eed117cc89a to your computer and use it in GitHub Desktop.
zombie
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
# Translations: Bouba -> Zombie. Juliana -> Human. Salud = Health. atacar! = Attack!. recibir_danio! = recieve_damage! | |
# If Juliana attacks Bouba with 5 damage..Bouba's health has to decrease 10 points... | |
# If she attacks with 10 damage, Bouba's health will decrease 20 points... | |
# If Juliana attacks Bouba a lot.. Bouba's health cannot be negative... | |
# In each above statement I get the same error: wrong number of arguments (given 2, expected 1) | |
# What am I doing wrong ? | |
module Bouba | |
@salud = 100 | |
@grito = "¡agrrrg!" | |
def self.gritar | |
@grito | |
end | |
def self.salud | |
@salud | |
end | |
def self.recibir_danio!(x) | |
x.times {@salud -= 2} | |
self.muerto | |
end | |
def self.sabe_correr? | |
false | |
end | |
def self.muerto | |
if @salud < 0 | |
@salud = 0 | |
end | |
end | |
end | |
module Juliana | |
@energia = 1000 | |
def self.atacar!(x) | |
Bouba.recibir_danio!(x) | |
end | |
def self.energia | |
@energia | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment