Hi im starting to learn programming and I'm stuck in this
puts "enter as much words as you like and i will sort them" words =  while true words.push gets.chomp if words.last == "" words.delete(words.last) break end end sorted =  def sort unsorted, sorted, num, var while true if unsorted[num] < unsorted[var] var = var + 1 if var + 1 == unsorted.length sorted.push unsorted[num] unsorted[num].delete var = 1 end else ya = unsorted[num] unsorted[num].delete unsorted.push ya var = 1 end break if unsorted == "" end end puts sort [words], [sorted], 0, 1
in line 13 it gives me this error "in `sort': undefined method `<' for #<Array:0x1d331c0> (NoMethodError)"
if I take that out of mi method it works
so mi question is: is there a way to make the main methods like "<" "<=" ">" ">=" to work inside mi custom method or to call them or to define them again?????
please anwer mi question even if the code can be done in some other way i whould really apreciate it