nom
C
code posted
created at 20 Sep 01:21, updated at 21 Sep 14:23
Edit
|
Back
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
1 class("mutter") 2 3 function mutter.new(name) 4 return {name = name} 5 end 6 7 function mutter:print() 8 print("Ausgabe: " .. self.name 9 end 10 11 class("kind", mutter) 12 13 function kind.new(name, alter) 14 return {name = name, alter = alter} 15 end 16 17 function kind:print() 18 print("Ausgabe: " .. self.name .. " (" .. tostring(self.alter) .. ")") 19 end 20 21 a = mutter("Mama") 22 b = kind("Tochter", 5) 23 24 a:print() 25 b:print() |
495 Bytes in 2 ms with coderay