Collection of Advent Calendars!
This file contains hidden or 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 @games = ( | |
| (name => "Villanova", seed => 1), | |
| (name => "MSM", seed => 16), | |
| (name => "Wisconsin", seed => 8), | |
| (name => "Virginia Tech", seed => 9), | |
| (name => "UVA", seed => 5), | |
| (name => "UNC Wilmington", seed => 12), | |
| (name => "Florida", seed => 4), | |
| (name => "ETSU", seed => 13), |
This file contains hidden or 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 ruby | |
| puts "I am the great ORACLE!!" | |
| puts | |
| puts "Ask me any question, if you dare!" | |
| puts "BUT BEWARE!!!!" | |
| puts | |
| puts "You may not like the answer." | |
| puts |
This file contains hidden or 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 Template | |
| def initialize(&block) | |
| @body = block | |
| end | |
| def method_missing(v) | |
| @params[v] | |
| end |
This file contains hidden or 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 Test::QuickCheck { | |
| multi gen(Int) { 1000000.rand.Int } | |
| our sub verify-one( &f, &predicate ) { | |
| my @params = &f.signature.params.map: -> $p { | |
| # say "Param: {$p.gist}"; | |
| gen($p.type) | |
| }; |
This file contains hidden or 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
| # signal(SIGINT).tap: { | |
| # note "Took { now - INIT now } seconds. $*THREAD"; | |
| # } | |
| my $interrupt = signal(SIGINT); | |
| $interrupt.tap: -> $v { | |
| note "[got interrupt $v]"; | |
| } |
This file contains hidden or 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
| sub catch-control { | |
| CONTROL { | |
| die "Caught a CONTROL ({.gist})"; | |
| } | |
| die "forced exception"; | |
| } | |
| for 1 { | |
| catch-control; |
This file contains hidden or 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
| sub no-catch-control { | |
| die "no-catch-control exception"; | |
| } | |
| sub catch-control { | |
| CONTROL { | |
| say "CONTROL: {$_.gist}"; | |
| die "control exception"; | |
| } |
This file contains hidden or 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
| sub no-catch-control { | |
| die "no-catch-control exception"; | |
| } | |
| sub catch-control { | |
| CONTROL { | |
| say "CONTROL: {$_.gist}"; | |
| die "control exception"; | |
| } |
This file contains hidden or 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
| > 5+5 | |
| 10 | |
| > next | |
| CONTROL: Died with CX::Next | |
| EXCEPTION: control exception | |
| in sub eval at simple-repl.p6 line 8 | |
| in block <unit> at simple-repl.p6 line 34 | |
| > last |