require 'rubygems' require 'faker' clubs = ["FC %s", "%s FC", "%s United"] * 5 + ["%s Athletic", "%s City", "%s County", "%s Town", "Sporting %s", "%s AC", "%s AC"] locations = [Faker::Address.city, Faker::Address.uk_county].shuffle home = clubs.rand % locations[0] home_players = Array.new(11){Faker::Name.last_name} away = clubs.rand % locations[1] away_players = Array.new(11){Faker::Name.last_name} def make_team_layout keeper = 1 defense = [3,4,5].rand midfield = 3 + rand(11 - keeper - defense - 3) offense = 11 - midfield - defense - keeper [keeper, defense, midfield, offense] end output = [] output << "%s at %s" % [away, home] output << "" ({home => home_players, away => away_players}).each do |team, lineup| output << "STARTING 11: #{team}" make_team_layout.each do |line| output << (Array.new(line, "%s").join(" - ") % Array.new(line){Faker::Name.last_name}) end output << "" end puts output.map{|s| s.center(75)}.join("\n")