From: "Nick G." Date: 2013-03-25T03:58:04+09:00 Subject: Re: Writing a game, trying to make dynamic loops Hi Calvin, Hmm...okay, that makes sense. I'm reading through the Book of Ruby, but I got caught up with making objects via: player1 = Player.new The looping now works, but I'm stuck with storing this data properly. puts("How many players?") players = gets().to_i x = 1 players.times do puts("Name of player #{x}?") Player.new(gets()) x += 1 end What could I add within the loop to make these new players store as a variable I can recall? What can I add to a basic variable to add in which player the loop is currently on as an additional character in the variable? Is it something like this?: player#{x} = Player.new(gets()) Thanks for your time (and patience)! Calvin B. wrote in post #1103032: > Hello Nick, > > it is, indeed, quite simple. gets returns the input as a string. Since > you want it as an integer, convert it via to_i. Then, with the integer, [...] -- Posted via http://www.ruby-forum.com/.