diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2011-12-26 10:12:31 +0100 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2011-12-26 10:12:31 +0100 |
commit | dec5bf5e5d07763e9a5ed0c87b4e219cb786aa99 (patch) | |
tree | c4630d7b54aae049f85701d3d628fabb506c8990 /data/rbot/plugins/games | |
parent | c8aa153ea27b06bccc78b3c0d35366a79a4d5f1e (diff) |
greed: stylistic changes
Sort dices when rolling and separate values with spaces.
Diffstat (limited to 'data/rbot/plugins/games')
-rw-r--r-- | data/rbot/plugins/games/greed.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/data/rbot/plugins/games/greed.rb b/data/rbot/plugins/games/greed.rb index c7dd4de3..3fa7d3be 100644 --- a/data/rbot/plugins/games/greed.rb +++ b/data/rbot/plugins/games/greed.rb @@ -25,7 +25,7 @@ class Greed < Plugin for i in 0..5 do dice[i] = rand(6) + 1 end - dice + dice.sort end def scores @@ -77,9 +77,9 @@ class Greed < Plugin end end end - if roll.sort == [1,2,3,4,5,6] + if roll == [1,2,3,4,5,6] score = 1200 - elsif roll.sort == [2,2,3,3,4,4] + elsif roll == [2,2,3,3,4,4] score = 800 end [score, roll] @@ -89,10 +89,10 @@ class Greed < Plugin player = scores mhash = {m.sourcenick => player[0]} @scoreboard.merge! mhash - m.reply "You have #{player[0]} points. (#{player[1].join("-")})" + m.reply "You have #{player[0]} points. (#{player[1].join(" ")})" if params[:single] == "bot" bot = scores - m.reply "I have #{bot[0]} points. (#{bot[1].join("-")})" + m.reply "I have #{bot[0]} points. (#{bot[1].join(" ")})" if player[0] < bot[0] m.reply "Bot wins!" else |