I have this program,which I am running from the command line, that freezes after this method.This method works but at the end it freezes,and I am left with a constantly flashing cursor.
def self.chooseteams(numberofteams)
i=1
while i<numberofteams
puts "choose a team"
team=gets.chomp
@@c<<team
i+=1
end
end
The program then freezes and fails to call the next method which is.It is meant to perform its function and when the condition is met,pass on to the next method.My guess is that it is caught in a infinite loop,however,I can't see it!
def self.secondfixer(numberofteams)
until @@listofDrawnTeams.length==numberofteams do
firstPick = @@c.sample
@@listofDrawnTeams<<firstPick
@@listofDrawnTeams.uniq!
end
end
The methods are all called at the end of the program
Genfix.gener(64)
Genfix.fixer(64)
Genfix.chooseteams(32)
Genfix.secondfixer(32)
Genfix.fixer(32)