Created
June 12, 2009 07:38
-
-
Save tene/128499 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Dancer:from<cardinal>; | |
class FancyDancer is Dancer { | |
method description { "is pretty!" } | |
method steps { | |
"…·•°•·…" | |
} | |
} | |
class KonamiDancer is Dancer { | |
method description { | |
"calls upon ancient powers to heal and inspire" | |
} | |
method steps { | |
"↑↑↓↓←→←→BAselectstart" | |
} | |
} | |
my Dancer $d .= new(); | |
$d.dance(); | |
$d = FancyDancer.new(); | |
$d.dance(); | |
$d = KonamiDancer.new(); | |
$d.dance(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Dancer | |
def description() | |
"My dance is like a beautiful swan, gracefully flying over a lake" | |
end | |
def steps() | |
"⚡→→→→↓↓↓↓←↓→↓←↑↑↑↑→↓←↑Ϟ" | |
end | |
def dance() | |
puts self.WHAT | |
puts "My dance " + self.description | |
puts "My dance goes like: " + self.steps | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[sweeks@kweh ~]$ perl6 dance.pl | |
Dancer() | |
My dance My dance is like a beautiful swan, gracefully flying over a lake | |
My dance goes like: ⚡→→→→↓↓↓↓←↓→↓←↑↑↑↑→↓←↑Ϟ | |
FancyDancer() | |
My dance is pretty! | |
My dance goes like: …·•°•·… | |
KonamiDancer() | |
My dance calls upon ancient powers to heal and inspire | |
My dance goes like: ↑↑↓↓←→←→BAselectstart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment