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 Codeword { | |
has Supply $.printer; | |
# has Sub $!codeword; | |
has Sub $.scrambler is rw; | |
has $!string; | |
has $!encoded-string; | |
method new( :$string = "bloop" ) { | |
my $printer = Supply.new; | |
$printer.act: { $_.say }; |
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
A CompUnit is said to be '{@possible.roll(1)}' if and only if | |
it has guarunteed idempotence under the stipulations of | |
the CompUnit Recognition Act, local bylaws withstanding. | |
@possible = < | |
authoritative | |
registered | |
participating | |
idemnified | |
representing |
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 Draw { | |
has $!supply; | |
has $!chan; | |
has $!interval = 1; | |
method new( $interval ) { | |
self.bless(:$interval); | |
} | |
submethod BUILD(:$!interval) { |
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
my %h = 1 => [ [<what what>], [<how how>] ], 2 => [ [<this this>] ]; | |
my $i = 0; | |
my $size = [+] %h.values.map({ +@^a }); | |
(1..$size Z~ %h.values>>.map({ @($^a)})).say; |
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 Test; | |
sub overlaps-with( $r1, $r2 ) { | |
$r1.min ~~ $r2 and $r1.max ~~ $r2 or $r2.min ~~ $r1 and $r2.max ~~ $r1 | |
or ( $r1.min == $r2.min and ($r1.max <= $r2.max or $r2.max <= $r1.max) ) | |
or ( $r2.min < $r1.min < $r2.max <= $r1.max ) | |
or ( $r1.min < $r2.min < $r1.max <= $r2.max ); | |
} | |
my @range-tests = ( |
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/env perl6 | |
use Test; | |
sub overlaps-with( $r1, $r2 ) { | |
$r1.min ~~ $r2 and $r1.max ~~ $r2 or $r2.min ~~ $r1 and $r2.max ~~ $r1 | |
or ( $r1.min == $r2.min and ($r1.max <= $r2.max or $r2.max <= $r1.max) ) | |
or ( $r2.min < $r1.min < $r2.max <= $r1.max ) | |
or ( $r1.min < $r2.min < $r1.max <= $r2.max ); | |
} |
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 v6; | |
use Inline::Perl5; | |
class Sereal::Encoder::Perl5 { | |
has Inline::Perl5 $!p5; | |
has $!encoder; | |
submethod BUILD() { | |
$!p5 := Inline::Perl5.new; |
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
my $begin = DateTime.now; | |
say "Beginning at $begin"; | |
my int @range = 0..^400; | |
my $count = 0; | |
for @range -> int $i { | |
for @range -> int $j { | |
for @range -> int $k { |
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
module <%= @name %> | |
module Configurations | |
class Default < Waves::Configurations::Default | |
attribute 'dependencies' | |
dependencies ['first', 'second'] | |
end | |
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
require 'foundations/simple' | |
module Blog | |
include Waves::Foundations::Simple | |
end | |