commit fdff31ee3861c17b2b825df9f53fb28f30cf2f23 parent 5593c6cd5fdd6db5129e2e816728c68c461fdcc5 Author: Doshirae <doshirae@mailfence.com> Date: Tue, 9 May 2017 21:58:47 +0200 OKAY NOW IT WORKS Diffstat:
insultotron.rb | | | 39 | ++++++++++++++++++++++++++++----------- |
1 file changed, 28 insertions(+), 11 deletions(-)
diff --git a/insultotron.rb b/insultotron.rb @@ -2,25 +2,42 @@ class Insulte attr_reader :insulte, :mode def initialize(mode) - @insulte = case mode + case mode when nil - "Espece d#{Insulte.animal} #{Insulte.adjectif} #{Insulte.lieu}" + createDefault when "fort" - "Espece d#{Insulte.animal} #{Insulte.adjectif} #{Insulte.lieu}".upcase + createDefault + @insulte = @insulte.upcase when "kaaris" - "P#{"U"*rand(10..100)}T#{"E"*rand(3..20)}#{"U"*rand(10..100)}H" + createKaaris when "martine" - salope = "SALO" - rand(25..100).times do |jsp| - salope += (rand(0..1) %2 == 0) ? "o" : "O" - end - salope += "PE" - "#{salope}" + createMartine when "haddock" - "#{Insulte.insultesHaddock}" + createHaddock end end + def createDefault + @insulte = "Espece d#{Insulte.animal} #{Insulte.adjectif} #{Insulte.lieu}" + end + + def createKaaris + @insulte = "P#{"U"*rand(10..100)}T#{"E"*rand(3..20)}#{"U"*rand(10..100)}H" + end + + def createMartine + salope = "SALO" + rand(25..100).times do |_|# (so it makes a cup :D + salope += (rand(0..1) %2 == 0) ? "o" : "O" + end + salope += "PE" + @insulte = "#{salope}" + end + + def createHaddock + @insulte = "#{Insulte.insultesHaddock}" + end + def to_s @insulte end