From db379fd8e1b9b9f4829217b2d5262e7629360413 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Mon, 25 Jan 2010 23:11:30 +0100 Subject: [PATCH] markov: whitespace cleanup --- data/rbot/plugins/markov.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/data/rbot/plugins/markov.rb b/data/rbot/plugins/markov.rb index 574dde57..28211203 100755 --- a/data/rbot/plugins/markov.rb +++ b/data/rbot/plugins/markov.rb @@ -294,15 +294,15 @@ class MarkovPlugin < Plugin output = word1 keys = [] @chains.each_key(output) do |key| - if key.downcase.include? output - keys << key - else - break - end + if key.downcase.include? output + keys << key + else + break + end end return nil if keys.empty? output = keys[rand(keys.size)].split(/ /) - end + end output = output.split(/ /) unless output.is_a? Array input = [word1, word2] while output.length < @bot.config['markov.max_words'] and (output.first != MARKER or output.last != MARKER) do @@ -317,8 +317,8 @@ class MarkovPlugin < Plugin if output == input nil else - output.join(" ") - end + output.join(" ") + end end def help(plugin, topic="") -- 2.39.5