Skip to content

Instantly share code, notes, and snippets.

@tefanga
Created February 13, 2018 23:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tefanga/399905367c95d6499a9d8eed117cc89a to your computer and use it in GitHub Desktop.
Save tefanga/399905367c95d6499a9d8eed117cc89a to your computer and use it in GitHub Desktop.
zombie
# 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