Skip to content

Instantly share code, notes, and snippets.

@skrisna
Created July 23, 2016 07:33
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 skrisna/883d74e784f0af5f3f88679d72d483ec to your computer and use it in GitHub Desktop.
Save skrisna/883d74e784f0af5f3f88679d72d483ec to your computer and use it in GitHub Desktop.
my \Rolex = $;
Rolex = role :: {
has %!player-points;
method !zero-scores(@players) {
for @players -> $player {
%!player-points{$player} = 0
}
}
method score($player, $points) { ... }
method ranking() { ... }
}
my \Classx = $;
Classx = class :: does Rolex {
submethod BUILD(:@players) {
self!zero-scores(@players);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment