shit_loot = ['Worn Dagger', 'Dirty Panties', 'Broken Staff', 'Bear Claw', 'Used Bandage']
decent_loot = ['Simple Staff', 'Alchemy Bag', 'Mask of Emptiness', 'Cloak of Disappearance', 'Large Health Potion']
epic_loot = ['Sword of 1000 Truths', 'The Master Sword', 'BFG', 'The Fate of the World', 'Infinite Bag of Infinity']
puts "On a scale of 1 - 10 how hard was the battle for the party?"
cr = gets.chomp.to_i
puts "Your party completed a challenge rating #{cr} battle, Great Work!"
if cr <= 3
puts "Your loot is #{shit_loot.sample}, #{shit_loot.sample}, #{shit_loot.sample}. Grats on the shitty loot!"
elsif cr >= 4 && <= 8
puts "Your loot is #{decent_loot.sample}, #{decent_loot.sample}, #{decent_loot.sample}. Grats on the decent loot!"
else cr > 8
puts "Your loot is #{epic_loot.sample}, #{epic_loot.sample}, #{epic_loot.sample}. Grats on the epic loot!"
end
Rubin battle_loot_calc.rb
battle_loot_calc.rb: 12: Syntaxfehler, unerwartete < =
elsif cr> = 4 & & < = 8Warum bekomme ich dies, wenn sonst Fehler in Ruby
Sprache bitte. –