more parfait ripples

changes due to previous changes in parfait api
This commit is contained in:
Torsten Ruger
2015-05-18 10:10:31 +03:00
parent d52cd82c92
commit d348e7afe7
6 changed files with 20 additions and 20 deletions

View File

@ -72,16 +72,16 @@ module Parfait
string = string.to_s if string.is_a? Symbol
word = Parfait::Word.new( string.length )
string.codepoints.each_with_index do |code , index |
word.set_char(index , code)
word.set_char(index + 1 , code)
end
word
end
def self.new_list array
list = List.new_object
list.set_length array.length
index = 0
index = 1
while index < array.length do
list.set(index , array[index])
list.set(index , array[index - 1])
end
list
end
@ -89,9 +89,9 @@ module Parfait
Word.class_eval do
def to_s
string = ""
index = 0
while( index < self.length)
string[index] = get_char(index).chr
index = 1
while( index <= self.length)
string[index - 1] = get_char(index).chr
index = index + 1
end
string