module GooseGame module Messages module In PLAYER = /add player (?\w+)/i MOVE = /move (?\w+) (?\d+), (?\d+)/i MOVE_ROLL = /move (?\w+)/i HELP = /help/i EXIT = /exit/i end module Out HELP = ["available commands:", "* add player ", "* move 4, 5", "* move ", "* help", "* exit"].join("\n") UNKNOWN = "can you repeat please?" NO_PLAYER = -> (player) { "#{player}: not an existing player"} PLAYERS = -> (players) { "players: #{players.join(', ')}" } EXISTING = -> (player) { "#{player}: already existing player" } ROLL = -> (player, dice) { "#{player} rolls #{dice.d1}, #{dice.d2}" } PRANK = -> (player, prank) { ". On #{player.position} there is #{prank}, who returns to #{player.prev}" } end end end