diff --git a/players/cachito.rb b/players/cachito.rb new file mode 100644 index 0000000..0480c97 --- /dev/null +++ b/players/cachito.rb @@ -0,0 +1,15 @@ +module RandomPlayer + def move + player_count = Game.world[:players].count + opponent = Game.world[:players].select{|p|p != self}.first + if opponent && opponent.alive + [[:rest], [:attack, opponent]][rand(2)] + else + [:rest] + end + end + + def to_s + "Don Cachito" + end +end