change python to ruby, very basic -
i not familiar ruby, , want change python code ruby art project, here broken ruby script, know "split" function same, , not sure how 1 part of array in ruby. feel appreciated if can me out right now.
new = line.split(" ") lala = [w w in new if len(new)>=4] newone = lala[1..6].join(" ") + "\n" + lala[6...].join(" ")
the initial python code
new = line.split(" ") lala = [w w in new if len(new)>=4] newone = (" ").join(lala[1:6]) +"\n" +(" ").join(lala[6:])
words = line.split(" ") s = words.select {|w| words.length >=4} result = s[1...6].join(" ") + "\n" + s[6..-1].join(" ")
Comments
Post a Comment