-
- "Randome strings have if else elsif"
-
-
-
- an = "A nice multiline string
- #comment
- =begin
- this is caomment
- =end
- #"
- defined?[]
- a = Array([1,2 ,3 ])
- class InsertionSort
- def initialize
- @result = [];puts for
- @comparisons = 0
- end
-
- def sort(list)
- puts String("Running //")
- for elem in list
- slot = @result.length
- while slot > 0
- if elem >= @result[slot - 1]
- @comparisons+=1
- break
- end
- slot = slot -1
- end
- @result.insert(slot, elem)
- end
- puts "End" "ed"
-
- def print
- puts @result
- puts "Comparisons {#@comparisons}"
- end
- end
- end
-
- is = InsertionSort.new
- is.sort([6, 3, 234, 64, 12, 65, 445, 42918, 458, 1038, 573])
- is.print