Skip to content

Instantly share code, notes, and snippets.

View cbk's full-sized avatar
🏠
Working from home

Michael cbk

🏠
Working from home
View GitHub Profile
#!/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;
class ModTest;
has $id = "Perl 6 ModTest Display";
has $message = "Hello wold!";
method sayHello($name) {
say "$message From: the $id" ~ ". Whats up $name" ~ "?";
}
@cbk
cbk / citytaxdata
Created March 15, 2012 21:29
broken regex
################################################
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
##########################################################
#!/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 };
};