This is likely very simple, but I haven’t stumbled across the right code
I want the following to take place:
class Player end puts "How many players?" players = gets() players.times do puts "Name of player?" playername = gets() # This is where I get stuck. I want to make an object named after what is stored as playername playername = Player.new??? Doesn't seem to work end
I did go through several Google searches, and I can’t seem to find the
location of a break down on loops that run based on user input. Any
tips would be appreciated!
PS: I hope this code was small enough to just toss in here. Sorry if
Edit: Took out players.each and fixed it to players.times do.