Skip to content

Instantly share code, notes, and snippets.

@anteaya
Created April 30, 2011 17:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anteaya/949835 to your computer and use it in GitHub Desktop.
Save anteaya/949835 to your computer and use it in GitHub Desktop.
Object subclass: #Animal
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'Learning Space'!
!Animal methodsFor: 'sounds' stamp: 'AnitaKuno 4/30/2011 11:40'!
makeSound
Transcript
cr;
show: self sound! !
Animal subclass: #Cat
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'Learning Space'!
!Cat methodsFor: 'sounds' stamp: 'AnitaKuno 4/30/2011 11:42'!
meow
self makeSound ! !
!Cat methodsFor: 'sounds' stamp: 'AnitaKuno 4/30/2011 11:42'!
sound
^'meow meow'! !
Animal subclass: #Dog
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'Learning Space'!
!Dog methodsFor: 'sounds' stamp: 'AnitaKuno 4/30/2011 11:31'!
bark
self makeSound! !
!Dog methodsFor: 'sounds' stamp: 'AnitaKuno 4/30/2011 11:30'!
sound
^ 'woof woof'! !
Animal subclass: #Chicken
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'Learning Space'!
!Chicken methodsFor: 'sounds' stamp: 'AnitaKuno 4/30/2011 11:26'!
cluck
" Transcript
cr;
show: 'cluck cluck cluaaaaaawk"
self makeSound! !
!Chicken methodsFor: 'sounds' stamp: 'AnitaKuno 4/30/2011 11:28'!
sound
^'cluck cluck cluaaaaaawk'! !
Object subclass: #Animal
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'Learning Space'!
!Animal methodsFor: 'sounds' stamp: 'AnitaKuno 4/30/2011 11:40'!
makeSound
Transcript
cr;
show: self sound! !
!Animal methodsFor: 'sounds' stamp: 'AnitaKuno 4/30/2011 12:12'!
sound
self subclassResponsibility ! !
Animal subclass: #Cat
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'Learning Space'!
!Cat methodsFor: 'sounds' stamp: 'AnitaKuno 4/30/2011 11:42'!
meow
self makeSound ! !
!Cat methodsFor: 'sounds' stamp: 'AnitaKuno 4/30/2011 11:42'!
sound
^'meow meow'! !
Animal subclass: #Dog
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'Learning Space'!
!Dog methodsFor: 'sounds' stamp: 'AnitaKuno 4/30/2011 11:31'!
bark
self makeSound! !
!Dog methodsFor: 'sounds' stamp: 'AnitaKuno 4/30/2011 12:15'!
makeSound
super makeSound.
self runAround! !
!Dog methodsFor: 'sounds' stamp: 'AnitaKuno 4/30/2011 11:30'!
sound
^ 'woof woof'! !
!Dog methodsFor: 'movement' stamp: 'AnitaKuno 4/30/2011 12:17'!
runAround
Transcript
cr;
show: 'running around'! !
Animal subclass: #Chicken
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'Learning Space'!
!Chicken methodsFor: 'sounds' stamp: 'AnitaKuno 4/30/2011 11:26'!
cluck
" Transcript
cr;
show: 'cluck cluck cluaaaaaawk"
self makeSound! !
!Chicken methodsFor: 'sounds' stamp: 'AnitaKuno 4/30/2011 11:28'!
sound
^'cluck cluck cluaaaaaawk'! !
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment