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
#!/usr/bin/perl6 | |
##################################################################### | |
## Michael D. Hensley | |
## March 27, 2012 | |
## | |
## Mega Millions loto number random picker | |
## Pick 5 numbers from 1 to 56 and 1 number from 1 to 46 | |
## | |
##################################################################### | |
use v6; use Term::ANSIColor; use Test; |
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 ModTest; | |
has $id = "Perl 6 ModTest Display"; | |
has $message = "Hello wold!"; | |
method sayHello($name) { | |
say "$message From: the $id" ~ ". Whats up $name" ~ "?"; | |
} |
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
################################################ | |
grammar cityTaxData { | |
token TOP { <data> } | |
token data { <city> \s* <taxRate> \s* <county> } | |
token city { \w+ [\( \w+ \)]* [\*]* } | |
token taxRate { \d+ [\.]* [\d+]* \% } | |
token county { \T+ } | |
} | |
## Example data | |
# Agoura Hills* 8.750% Los Angeles |
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
########################################################## | |
#!/home/cbk/Work/Perl_6/rakudo-2009-06/perl6 | |
use v6; | |
########################################################### | |
class PetList { | |
has %.petList = (dog => 1, cat => 1, fish =>1, rabbit =>1); | |
has %.petReq; | |
has $.voteMax = 2; | |
method addVote1 (Str $pet) {++ %.petList{ $pet }; | |
}; |