Skip to content

Instantly share code, notes, and snippets.

@timo
Forked from tene/Dancer.rb
Created June 12, 2009 10:30
Show Gist options
  • Save timo/128566 to your computer and use it in GitHub Desktop.
Save timo/128566 to your computer and use it in GitHub Desktop.
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();
class Dancer
def description()
"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
[sweeks@kweh ~]$ perl6 dance.pl
Dancer()
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