fix some word with tests

This commit is contained in:
Torsten Ruger
2015-11-10 19:08:48 +02:00
parent 6c2ce66bfc
commit 760a4beb86
2 changed files with 60 additions and 3 deletions

View File

@ -1,9 +1,19 @@
class Word < Object
int at(int index)
int char_at(int index)
index = index + 2
return get_internal(index)
end
Word add_digit( int i)
int l = self.char_length + 2
int set_length(int i)
set_internal( 2 , i)
return i
end
Word push_char(int i)
int l = self.char_length + 1
self.set_length(l)
l = l + 2
set_internal( l , i)
return self
end