Hey guys, im trying to code the dragon slayer game from javascript in ruby (not exaclty, but the idea)
but when my code is supposed to stop because the dragon killed me, it keeps going. I dont really understand why. All help is greatly appreciated
dragon = (100)
while dragon > 0 do
r = rand(10...20)
if r > 11
dragon -= r
puts r
puts "Dragon's health is #{dragon}"
else
puts "the dragon killed you"
end
end
puts "congrats, you slew the dragon!"